Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active January 31, 2023 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/42be5aedf1d0b13b4cf163cac18efe7b to your computer and use it in GitHub Desktop.
Save aspose-com-gists/42be5aedf1d0b13b4cf163cac18efe7b to your computer and use it in GitHub Desktop.
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