Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created July 15, 2025 13:45
Show Gist options
  • Save aspose-com-gists/c3b85095c638b3bdfa856052ebddaa54 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/c3b85095c638b3bdfa856052ebddaa54 to your computer and use it in GitHub Desktop.
GeoJSON to BMP
// Set the path to the documents directory.
string dataDir = "files";
// Create an instance of the Map class.
using (var map = new Aspose.Gis.Rendering.Map(600, 300))
{
// 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(1) };
// Open a layer and add to the map.
map.Add(Aspose.Gis.VectorLayer.Open(dataDir + "sample.geojson", Aspose.Gis.Drivers.GeoJson), symbolizer);
// Invoke the Render method to process the map to BMP format.
map.Render(dataDir + "sample-output.bmp", Aspose.Gis.Rendering.Renderers.Bmp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment