turf
turf copied to clipboard
line self-intersect after bezier
turf 4.7.3
Before:
Afer:
@jingsam could you please provide some more details on the issue? Could you please provide some data and a code snippet that replicate the issue so we can take test it?
- [ ] GeoJSON data as a gist file or geojson.io (filename extension must be
.geojson
). - [ ] Snippet of source code or for complex examples use jsfiddle.
Closing due to inactivity and lack of info
I have the same issue, here is an example: before : http://geojson.io/#id=gist:mmomtchev/eb8c16374613397f3a0d6323cfb594b0&map=6/49.246/-1.923 after : http://geojson.io/#id=gist:mmomtchev/9d1f6a1138b4c96ebe37ee83cb8a96f7&map=6/48.320/2.010
this is with bezierSpline with 10000, 0.85
I was able to greatly reduce the frequency of it appearing by segmentizing the lines and then simplifying them before applying bezier
This is a problem that still exists for version [email protected] Test: https://jsfiddle.net/devfzm/12zbspqk/2/
![image](https://user-images.githubusercontent.com/56671014/174240931-f62779d4-29a7-436d-bd88-9b045c4ead57.png)
{
type: 'FeatureCollection',
features: [turf.lineOffset(mapData, 300, {
units: 'meters',
})]
}
How can I share GeoJSON?
You can share GeoJSON like you share JSON in GitHub comments; using three backticks and then writing json, pasting your formatted GeoJSON, then closing with three backticks again:
It renders like this:
{
"type": "Feature",
"properties": {
"name": "Coors Field",
"amenity": "Baseball Stadium",
"popupContent": "This is where the Rockies play!"
},
"geometry": {
"type": "Point",
"coordinates": [-104.99404, 39.75621]
}
}