Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

167
Vistas
How to find all S2 cells within a specified level within a boundary in JavaScript?

I have a Google Map, and I want to show all of the cells of a specified level on the map. I don't have a problem with the map, and I can already draw the polygon for any cell at a specific coordinate.

But I'm not sure how to find all of the cells within the map boundary. I can start with the center coordinates, or with the southwest or northeast coordinates, but how do I find all of the cells that are completely or partially within the map boundary?

I tried to use the getNeighbors() method but I get an error and haven't been able to get past it (this.face is undefined).

I tried the .move() method, starting with the center coordinates, to find all the cells that have any corner coordinate within the map boundary, but I've been unsuccessful in discovering all of the cells.

Perhaps starting at one corner and going in horizontal rows using the move() method, and then moving down a row and starting over when a cell is completely not in the boundary?

I figure there must be a smarter way, or a different/more supported S2 library to use?

I'm using this library in JavaScript: https://www.npmjs.com/package/@raha.group/s2-geometry/v/1.0.7

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda