Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate TurfJS for geometry repair/simplification #267

Open
prashtx opened this issue Dec 30, 2014 · 3 comments
Open

Investigate TurfJS for geometry repair/simplification #267

prashtx opened this issue Dec 30, 2014 · 3 comments
Assignees

Comments

@prashtx
Copy link
Contributor

prashtx commented Dec 30, 2014

https://github.com/Turfjs/turf-simplify
https://github.com/Turfjs/turf-kinks

We need to confirm that the libraries behave well with problematic parcels that we've encountered in the past.

@prashtx
Copy link
Contributor Author

prashtx commented Dec 31, 2014

It looks like turf-kinks doesn't detect overlaps with no crossover, as in

{
  "type": "Polygon",
  "coordinates": [[ [5,5],[5,6],[6,6],[7,6],[6,6],[6,5],[5,5] ]]
}

image

It also doesn't detect repeated points, although those are easier for us to deal with separately:

{
  "type": "Polygon",
  "coordinates": [[ [5,5],[5,6],[6,6],[6,6],[6,5],[5,5] ]]
}

@hampelm
Copy link
Contributor

hampelm commented Dec 31, 2014

Should we file a bug? Is a self-overlap without crossover technically a
kink?

On Wed, Dec 31, 2014 at 3:09 PM, Prashant Singh [email protected]
wrote:

It looks like turf-kinks doesn't detect overlaps with no crossover, as in

{
"type": "Polygon",
"coordinates": [[ [5,5],[5,6],[6,6],[7,6],[6,6],[6,5],[5,5] ]]
}

[image: image]
https://cloud.githubusercontent.com/assets/1307783/5590209/631f1f26-90e4-11e4-942f-4251212a61eb.png

It also doesn't detect repeated points, although those are easier for us
to deal with separately:

{
"type": "Polygon",
"coordinates": [[ [5,5],[5,6],[6,6],[6,6],[6,5],[5,5] ]]
}


Reply to this email directly or view it on GitHub
#267 (comment)
.

@prashtx
Copy link
Contributor Author

prashtx commented Feb 26, 2015

We can possibly use turf-envelope to index a feature's bounding box. It's possible to get a degenerate polygon out of turf-envelope, so we'd still need to do some validation. If we commit to simplifying all indexed polygons/multipolygons, then we start with computing the envelope. If the area is 0, we can index the centroid instead. The envelope is always a rectangular polygon, so we won't encounter weird zero-width arms. It should either be valid or have zero area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants