-
Notifications
You must be signed in to change notification settings - Fork 943
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
Apply equidistance @turf/buffer to polygons #660
Comments
Please provide a GeoJSON of the input & output. Have you tried measuring the buffer distances using http://geojson.io? Also there might be some distance distortions the higher/lower you are in latitudes since the buffer distance units are calculated in Degrees and not in metric/imperial units. |
Thanks for getting back. I put the following into geojson.io: [http://bl.ocks.org/anonymous/raw/a8a2f66eb676b01a40676077d8ebd7fe/] and it appears that the problem is with the other way around: Zipped geoJSON: map.zip Code:
|
Note: Instead of zipping, you could simply share your URL as a Gist: https://gist.github.com/f66c382ee9ee9d8e0894b9e61f2af3d1 |
Good tip (took me a while to absorb it). |
@flightsurvey To extend my answer, the issue is because the Solution: Issue - Polygon in northern latitude |
Thanks for taking time to look at it |
I took this challenge before here https://github.com/w8r/moscow-rings, maybe you'll find it useful. |
👍 Awesome stuff! The visual map looks are pretty darn good! Useful reference from Any reason why you didn't use your I've briefly discussed this in other posts, however i'll go over the ideal buffer workflow:
@w8r Sounds about right? Correct me if anything seems off. @mourner @morganherlocker : By no means we should support reprojections (only internally). This seems like this is the only accurate option for equi-distance buffers. As for performance, I believe the heavy lifting is the buffer operations and not the reprojection. |
Oh, I forgot how shitty that code is)) Didn't use polygon offset, cause it was a very naive implementation before I stumbled upon martinez algorithm, and there was no proper settings to make the contour smooth, nor did it support holes in polygons. As for the algorithm outline - why to mercator? The most important point is that you have to do the geometrical calculations in the R2 space where they make sense, so abstract equidistant does the trick. This is what I do there, EPSG:3857 is only used to get the distances in meters and project back onto the leaflet map. Useful parts are actually here and here Your note about performance is right, offsetting is much heavier than reprojection |
👍 Thanks @w8r for the feedback, I'll have a look at it further and i'll CC you whenever I do a PR on Turf. |
This is fixed in PR #718 |
Please see attached screen shot of a buffer created around a polygon. It appears that the north and south extents are further away than they should be.
The text was updated successfully, but these errors were encountered: