public static List <Geometry> LineContentToGeometries(LineContent content) { var serializer = GeoJsonSerializer.Create(SpatialHelpers.Wgs84GeometryFactory(), 3); using var stringReader = new StringReader(content.Line); using var jsonReader = new JsonTextReader(stringReader); var featureCollection = serializer.Deserialize <FeatureCollection>(jsonReader); return(featureCollection.Select(x => SpatialHelpers.Wgs84GeometryFactory().CreateGeometry(x.Geometry)) .ToList()); }
public static Point PointContentToPoint(PointContent content) { return(SpatialHelpers.Wgs84GeometryFactory() .CreatePoint(new CoordinateZ(content.Longitude, content.Latitude, content.Elevation ?? 0))); }