You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is very similar to #27, but now for System.Text.Json.
Example:
varcoords=new[]{newCoordinate(0.001,0.001),newCoordinate(10.1,0.002),newCoordinate(10,10.1),newCoordinate(0.05,9.999),newCoordinate(0.001,0.001)};// Creating the polygon with PrecisionModels.Fixedvarpolygon=GeometryFactory.Fixed.CreatePolygon(coords);varstr=polygon.ToString();// The precision is one decimal place as expected// POLYGON ((0 0, 10.1 0, 10 10.1, 0.1 10, 0 0))varjson1=JsonSerializer.Serialize(polygon,newJsonSerializerOptions{Converters={newGeoJsonConverterFactory()}});// The precision is ignored// {"type":"Polygon","coordinates":[[[0.001,0.001],[10.1,0.002],[10.0,10.1],[0.05,9.999],[0.001,0.001]]]}varjson2=JsonSerializer.Serialize(polygon,newJsonSerializerOptions{Converters={newGeoJsonConverterFactory(GeometryFactory.Fixed)}});// The precision is ignored// {"type":"Polygon","coordinates":[[[0.001,0.001],[10.1,0.002],[10.0,10.1],[0.05,9.999],[0.001,0.001]]]}
NetTopologySuite.IO.GeoJSON4STJ version: 4.0.0
The text was updated successfully, but these errors were encountered:
MizardX
added a commit
to MizardX/NetTopologySuite.IO.GeoJSON
that referenced
this issue
Oct 29, 2023
MizardX
changed the title
Serializer ignores the IPrecisionModel of geometries (STJ)
Serializer ignores the PrecisionModel of geometries (STJ)
Oct 29, 2023
This is very similar to #27, but now for System.Text.Json.
Example:
NetTopologySuite.IO.GeoJSON4STJ version: 4.0.0
The text was updated successfully, but these errors were encountered: