Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Convert GeoJSON to SVG Programmatically in C# .NET
// Create a map
using (var map = new Aspose.Gis.Rendering.Map(800, 400))
{
// Use the specified SRS
map.SpatialReferenceSystem = Aspose.Gis.SpatialReferencing.SpatialReferenceSystem.Wgs84;
// Use the specified style to draw lines
var symbolizer = new Aspose.Gis.Rendering.Symbolizers.SimpleLine() { Width = Aspose.Gis.Rendering.Measurement.Pixels(2) };
// Open a layer and add to the map
map.Add(Aspose.Gis.VectorLayer.Open("sample.geojson", Aspose.Gis.Drivers.GeoJson), symbolizer);
// Render the map to SVG format
map.Render("sample.svg", Aspose.Gis.Rendering.Renderers.Svg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment