derrickpelletier / geohash-poly Goto Github PK
View Code? Open in Web Editor NEWTransform a geoJSON MultiPolygon or Polygon into a list of geohashes that form it.
License: MIT License
Transform a geoJSON MultiPolygon or Polygon into a list of geohashes that form it.
License: MIT License
when the current row intersection is performed, and the poly is returned which represents the parts of the original poly that fall within the current row, rather than starting at the leftmost edge of the current row in the entire bounding box, we really only need to start at the leftmost edge of the bounding box of that poly that was returned.
and similarly end at the eastern extent.
This would save a lot of wasted checks. A turf.extent()
would need to be performed for every row.
Really need some tests for this.
Dear sir, could I return different geohash level (precision) in one run? Beside it, could you tell me more details about your algorithm? How can you find the row bounding? Does it look like the image below? Another problem that I still don't understand is that how you build the row hash (the size, the offset)?
Thanks in advance!
Currently the geohash centre point must be within a poly to pass as being part of the poly. This allows dealing with a large amount of shapes that are flush, there would be no overlapping hashes. In many cases there will be parts of the poly that are not covered by a geohash.
Would be nice to specify an option where coverage infers that the poly is entirely covered. Would require intersection detection I think.
Error: Each LinearRing of a Polygon must have 4 or more Positions.
When attempting to run the streaming example on the massive polygon.
right now it's just accepting the string of a poly coordinates. Would like it to accept a geojson file perhaps.
Hi,
first of all thank you for your work and this great tool. It's really quite fast compared to other approaches.
I found a bug that occurs when using the hashMode 'intersection':
When you specify 'intersection' only (without a threshold) it includes geohashes which do not even touch the polygon:
geohashpoly({coords: coords, precision: 8, hashMode: "intersect" ....
results in:
A workaround is using a really small threshold:
geohashpoly({coords: coords, precision: 8, hashMode: "intersect", threshold: 0.0001} .....
results in:
The second case should be the default behavior in my opinion.
Since it's easy to use a small threshold, a fix might not be needed but one should know about this issue, that's why I'm posting it here.
Best regards!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.