Convert GeoJSON to SVG Programmatically in C# .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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