Aspose.GIS  via .NET

The complete Python via .NET API for reading, writing, and converting GIS file formats like Shapefile, GeoJSON, KML, GML, GeoPackage.

Manipulate, convert, and visualize GIS data including KML, OpenStreetMap, GeoPackage, Shapefile, GeoJSON, and World Raster Images, tiles. Full support for Python on macOS (Intel and Apple Silicon), Linux and Windows.

  Download Free Trial
  
 

Aspose.GIS for Python via .NET provides comprehensive GIS data processing capabilities accessible through Python via .NET interoperability. This powerful API enables developers to read, write, convert, and analyze geographic information from various vector and raster formats including GeoPackage, Shapefile, GeoJSON, FileGDB, KML, and GeoTIFF, World Raster Images and much more.

Our API supports cross-platform development with full compatibility for macOS (both Intel and ARM architectures), Windows, and Linux systems. Create sophisticated mapping applications with advanced rendering capabilities to SVG, PNG, JPEG, and BMP formats with complete control over feature styling and symbology.

Aspose.GIS combines enterprise-grade performance with developer-friendly APIs, making complex spatial operations accessible while maintaining flexibility for custom GIS solutions.

Advanced GIS Data Processing Features

Comprehensive spatial data manipulation capabilities for Python developers using .NET

Read and write GeoPackage format with full feature support

Process world raster images (GeoTIFF) and extract band values

Native support for macOS (Intel & ARM architectures)

Create complex geometries including points, lines, and polygons

Convert between 20+ GIS formats with reprojection support

Render high-quality maps to SVG, PNG, JPEG, and BMP

Coordinate system transformation with 3000+ CRS support

Spatial indexing for high-performance queries

Advanced styling based on feature attributes

Support of popular GIS formats

Please check list of support for the most popular formats that can be processed in Aspose.GIS for Python

FormatExtensionsReadWrite
ESRI Shapefile.shp, .shx, .dbf, .qix, .cpg✔️✔️
GeoJSON.json, .geojson✔️✔️
GeoJSON Seq.json, .geojson✔️✔️
ESRI File Geodatabase (FileGDB).gdb✔️✔️
Geography Markup Language.gml✔️✔️
Keyhole Markup Language.kml✔️✔️
GPS Exchange Format.gpx✔️✔️
TopoJSON.json, .topojson✔️✔️
MapInfo Interchange Format.mif✔️✔️
MapInfo TAB format.tab, .dat, .dbf, .map, .id✔️✔️
OpenStreetMap (OSM) XML.osm✔️✔️
Comma-Separated Values.csv✔️✔️
GeoPackage.gpkg✔️

Read Features and Attributes from ShapeFile - Python via .NET

input = "InputShapeFile.shp"

with VectorLayer.open(input, Drivers.shapefile) as layer:
    for i in range(layer.count):
        feature = layer[i]

        # case 1
        name_value = feature.get_value("name")  # attribute name is case-sensitive
        age_value = feature.get_value("age")
        dob_value = datetime.fromisoformat(feature.get_value("dob")).strftime("%Y-%m-%d")
				
        print(f"Attribute value for feature #{i} is: {name_value}, {age_value}, {dob_value}")

        # case 2
        obj_name = feature.get_value("name")  # attribute name is case-sensitive
        obj_age = feature.get_value("age")
        obj_dob = feature.get_value("dob")
				
        print(f"Attribute object for feature #{i} is: {obj_name}, {obj_age}, {obj_dob}")
    

Raster Image Processing

Process georeferenced raster data including GeoTIFF, BigTiff and world raster files with Aspose.GIS. Combine it with Vector GIS Formats. Read band values, extract raster statistics, and integrate raster data with vector features for comprehensive spatial analysis. Support for various raster formats ensures compatibility with most GIS data sources.

Read Features and Attributes from ShapeFile - Python via .NET


input1 = "world1.jpg"
input2 = "ug.shp"

output = "result1071.jpg"

# Open the JPEG layer
layer_1 = Drivers.jpeg_w.open_layer(input1)

# Open the Shapefile layer
layer_2 = Drivers.shapefile.open_layer(input2)

# Create a new Map instance
map_instance = Map()

# Add the layers to the map
map_instance.add(layer_1, self.GetGrayBand(), False)
map_instance.add(layer_2)

# Render the map to a JPEG file
map_instance.render(output, Renderers.jpeg)

Support of DataBase-based formats

Aspose.GIS supports DataBase-based GIS formats. Post GIS, SQL Server (MS SQL), PostgreSQL database connections supported for the processing of GIS Data. Also, Aspose.GIS Supports GeoPackage format. Please note, Aspose.GIS for Python can have some limitation in work with DB, please firstly check if the Python version suits your needs.

Open the GeoPackage DataSet and iterate layers with Aspose.GIS for Python


with Dataset.open("testdb.gpkg", Drivers.geo_package) as dataset:
    layers_count = dataset.layers_count
    layer_names = []

    # Get all layer names
    for i in range(dataset.layers_count):
        layer_names.append(dataset.get_layer_name(i))
    

Unified API for Multiple Formats

Aspose.GIS abstracts the complexities of various GIS file formats, providing a clean, consistent object model for spatial data. Work with multiple formats using the same codebase, reducing development time and complexity.

Read from multiple formats - Python

# Read from Shapefile
with VectorLayer.open("data.shp", Drivers.c) as layer:
    process_features(layer)

# Read from GeoPackage  
with VectorLayer.open("data.gpkg", Drivers.geo_package) as layer:
    process_features(layer)

# Read from GeoJSON
with VectorLayer.open("data.geojson", Drivers.geo_json) as layer:
    process_features(layer)

GIS Format Conversion

Convert spatial data between formats with a single line of code. Aspose.GIS supports bidirectional conversion between all major GIS formats including GeoPackage, Shapefile, GeoJSON, KML, GML, and many others. Perform reprojection during conversion and customize attribute schemas as needed.

Convert Shapefile to GeoPackage - Python


source_format_path = "sample.geojson"
destination_format_path = "output.topojson")

# Perform the conversion
VectorLayer.convert(source_format_path, Drivers.geo_json, destination_format_path, Drivers.topo_json)
		
# Check the list of supported drivers: esri_json, gdal, geo_json, geo_json_seq, in_memory, in_file, kml, shapefile, gpkg, osm_xml, gpx, gml, file_gdb, topo_json, map_info_interchange, map_info_tab, post_gis, sql_server, esri_ascii, geo_tiff, world_raster, jpeg_w, png_w, bmp_w, tiff_w, xyz_tiles, csv
# Please note there can be unsupported conversion pairs
     

Supported conversion examples include:

  • Shapefile to GeoPackage
  • GeoJSON to GeoPackage
  • KML to Shapefile
  • GeoPackage to GeoJSON
  • File Geodatabase to GeoPackage
  • GPX to GeoPackage
  • MapInfo TAB to GeoPackage

Cross-Platform Compatibility

Aspose.GIS for .NET delivers true cross-platform support for Python developers. Our API runs seamlessly on:

  • Windows with .NET Framework 4.7+ or .NET Core 2.0+
  • macOS (Intel x64) with .NET Core 2.0+
  • macOS (Apple Silicon ARM) with .NET Core 2.0+
  • Linux with .NET Core 2.0+

Develop once and deploy anywhere with consistent API behavior across all platforms.

Advanced Map Rendering

Create professional-quality maps with sophisticated styling options. Render GIS data to SVG, PNG, JPEG, or BMP formats with complete control over symbology, labeling, and layout. Support for complex symbolizers and attribute-based styling enables highly customized visualizations.

Render a map to PNG, SVG or other Format - Python

bandColor = BandColor()

bandColor.band_index = 0
bandColor.min = 0
bandColor.max = 255

color = MultiBandColor()
color.red_band = bandColor

with Map(Measurement.pixels(500), Measurement.pixels(500)) as map_instance:
    layer = Drivers.geo_tiff.open_layer("raster_float32.tif"))
    map_instance.add(layer, color, False)
    map_instance.render(output, Renderers.png)
    map_instance.render(output, Renderers.svg)

Coordinate Reference Systems

Transform data between thousands of coordinate reference systems with comprehensive EPSG database support. Reproject individual geometries or entire layers seamlessly. Import CRS definitions from WKT or lookup by SRID code.

Operations with MaidenHead coordinate system


# Convert coordinates to Maidenhead point text
point_text = GeoConvert.as_point_text(80.0, 151.0, PointFormats.MAIDENHEAD)

# Parse Maidenhead point text to coordinates
point_parse = GeoConvert.parse_point_text("BB40ma")
    

Spatial Analysis Operations with respect of coordinate reference system. Work with Geometry data.

Perform sophisticated spatial analysis with DE-9IM model support. Includes intersection testing, buffer creation, convex hull computation, area calculation, and distance measurement. Build spatial indexes to optimize query performance for large datasets.

Operations with MaidenHead coordinate system


point = Point(23.5732, 25.3421)
point.m = 40.3
point.spatial_reference_system = SpatialReferenceSystem.wgs84

print(point.as_text(WktVariant.ISO))  # POINT M (23.5732, 25.3421, 40.3)
print(point.as_text(WktVariant.SIMPLE_FEATURE_ACCESS_OUTDATED))  # POINT (23.5732, 25.3421)
print(point.as_text(WktVariant.EXTENDED_POST_GIS))  # SRID=4326;POINTM (23.5732, 25.3421, 40.3)
    
  

Support and Learning Resources