Free Support Forum -

How to control the accuracy when conversion to geojson

{“type”:“FeatureCollection”, “features”:[

x,y,z too long, can we control the accuracy?

Hi, @lsl

Yes, you can do it. Please consider the below code that converts a shapefile to geojson.

        var options = new ConversionOptions()
            DestinationDriverOptions = new GeoJsonOptions()
                XYPrecisionModel = PrecisionModel.Rounding(2),
                ZPrecisionModel = PrecisionModel.Rounding(2),
                MPrecisionModel = PrecisionModel.Rounding(2),

            "source.shp", Drivers.Shapefile,
            "destination.json", Drivers.GeoJson, options);

Best regards.

ok, I get it, work fine now, thanks