Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

175
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda