logoalt Hacker News

zekelast Wednesday at 12:46 AM1 replyview on HN

For reducing the number of points I've often used mapshaper.org.

For deciding if a user is in Texas you could create a simple polygon completely inside Texas and one in Oklahoma. 99% would fall in the simple polygon and the rest go to the detailed polygons. Or create bounds near the complex river borders and use the detailed polygons there.

On the other hand I just use simple, non-optimized functions for qquiz.com.


Replies

mynameisashlast Wednesday at 5:27 AM

> For deciding if a user is in Texas you could create a simple polygon completely inside Texas and one in Oklahoma.

This seems like the obvious optimized v1: create extremely compressed (simplified) polygons wholly within the proper geopolitical borders. You get 100% true positives for a significant fraction of queries, and any negatives you can still kick to GMaps. I understand wholly-local is the goal here, but as others have pointed out, even small error rates can be unacceptable in some scenarios.

show 1 reply