Closed Mendes11 closed 1 year ago
You should create a new geometry with the simplified coordinates. Replacing the existing FlatCoords
break the existing geometry.
Note that xy.SimplifyFlatCoords
is a line simplification algorithm and is only suitable for simplifying LineString geomtries.
First of all, thanks for the library, it's really great and it's helping me a lot!
I'm trying to create an API that is going to load GeoJSON files, simplify them and then send this simplified version to the caller. From what I understand, I can do the simplification using
xy.SimplifyFlatCoords(feature.Geometry.FlatCoords(), .5, feature.Geometry.Stride())
. My problem is since it's returning the indexes that I should use, I would need to recreate the Feature, or replace the existingFlatCoords
, but I don't seem to find a way to do this.What's the best approach here?