Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

208
Views
¿Cómo encontrar el punto (lat, lng) dentro de un polígono con h3-js?

Tengo un polígono creado con polyfill , ¿es posible saber si el point = [lat, lng] está en ese polígono (usando solo h3-js)?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Sí, esto es posible, aunque hay una simplificación involucrada: polyfill devuelve celdas cuyos centros se encuentran dentro del polígono, por lo que tendrá casos en los bordes del polígono donde los puntos específicos cerca del borde se incluirán o excluirán incorrectamente del polígono. La compensación es que la verificación de inclusión debería ser mucho más rápida que un algoritmo tradicional de punto en poli, y el código es más simple:

 // Create a set of H3 indexes representing the polygon. Using a finer // value for H3_RES will give you better fidelity to the original // polygon, at the cost of more memory usage const polygonSet = new Set(h3.polyfill(myPolygon, H3_RES)); // Check whether a given point is in the polygon function isPointInPoly(point) { const h3Index = h3.geoToH3(point.lat, point.lng, H3_RES); return polygonSet.has(h3Index); }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!