Skip to main content

Aspose.GIS for Python via .NET is a standalone API to read, write, process, convert GDB, GPX, Shapefile, GML, FileGDB, KML and other popular gis formats. Integration with DataBases and Rendering capabilities of GIS data out from the box.

Project description

GIS Formats Analyzing and Manipulation API

Product Page | Documentation | Demos | Blog | API Reference | Search | Free Support | Temporary License | EULA


Try our free online Apps demonstrating some of the most popular Aspose.GIS functionality.

Aspose.GIS for Python via .NET is a robust API designed for developers to handle geospatial data formats without relying on external GIS software. It facilitates the reading, writing, and conversion of multiple GIS formats, along with rendering maps and performing geometry creation and analysis. This makes it an all-encompassing solution for GIS-related tasks within Python applications. It's crossplatform: Windows, MacOS, MacOS-ARM, Linux are supported.

Aspose.GIS for Python via .NET is an ultimate, flexible, stable and powerful API to work with most kinds of GIS Formats. Aspose.GIS is a cross-platform library, it is Windows x32/x64, Linux x64, and MacOS x64/Arm64 compatible.

Aspose.GIS for Python requires you to use python programming language. For the additional languages please visit Aspose.GIS Family Official Page, we recommend you to check Aspose.GIS for .NET.

Aspose.GIS for Python via .NET examples can be found on GitHub

Product Features

The following are Aspose.GIS’s core features:

  • Support of Vector and Raster GIS Layers
  • Reading, Editing and Creating Layers Features
  • Database integration
  • Built-in configurable rendering of Vector and Raster Images onto Maps
  • Geometry Types Analytics Features
  • Flexible filtering of Layers, Features and Attributes
  • Spatial Reference Systems Convert and Casting Features
  • Streams and Remote Storage Support

Supported File Formats

Vector Formats

The following table lists the vector formats that Aspose.GIS for Python can read or write.

Description Format Read Write
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 ✔️

Supported Databases

The following table lists the supported databases. Possible, additional DB are supported, because Aspose.GIS supports unified way to work with DBs. But please note, first version of Aspose.GIS for Python via .NET has some limitation with generic methods, filtering and DB.

| Description         | Read | Write |
|---------------------|------|-------|
| Post GIS            | ✔️   | ✔️    |
| SQL Server (MS SQL) | ✔️   | ✔️    |
| PostgreSQL          | ✔️   | ✔️    |

Raster Formats

The following table lists the raster formats that Aspose.GIS for .NET can only read.

Description Format Read
Geo TIFF, TIFF .tiff, .tif ✔️
Geo Big TIFF .tiff, .tif ✔️
Esri ASCII .ascii ✔️
World File (.png, .jpg, .tiff) + .pgw ✔️

Web Tiles

The following web tile formats can be loaded from the Internet.

Format Description
XYZ Tiles Slippy Maps

Map Rendering Formats

Maps can be rendered into the following formats.

Format Description
.SVG Scalable Vector Graphics
.PNG Portable Network Graphics
.JPG JPEG
.BMP Bitmap Image Files

Platform Independence

Aspose.GIS for Python can be used to develop applications for a wide range of operating systems, such as Windows (x32/x64), Linux (x64), and MacOS (x64/arm64) where Python 3.5 or later is installed.

The base .NET platform is .NET Standard 2.0

Get Started

Ready to give Aspose.GIS for Python a try?

Simply run pip install aspose-gis-net from the console to fetch the package. If you already have Aspose.GIS for Python and want to upgrade the version, please run pip install --upgrade aspose-gis-net to get the latest version.

You can run the following snippets in your environment to see how Aspose.GIS works, or check out the GitHub Repository or Aspose.PSD for Python Documentation for other common use cases.

Convert one GIS format to another

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

Rendering of map from the several Layers

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.svg)

Create a Layer of specified format from scratch

result = "sample_out.topojson"

with Drivers.topo_json.create_layer(result) as layer:
    # Add attributes that we are going to set
    layer.attributes.add(FeatureAttribute("name", AttributeDataType.STRING))
    layer.attributes.add(FeatureAttribute("measurement", AttributeDataType.DOUBLE))
    layer.attributes.add(FeatureAttribute("id", AttributeDataType.INTEGER))

    feature0 = layer.construct_feature()
    feature0.set_value("name", "name_0")
    feature0.set_value("measurement", 1.03)
    feature0.set_value("id", 0)
    feature0.geometry = Point(1.3, 2.3)
    layer.add(feature0)

    feature1 = layer.construct_feature()
    feature1.set_value("name", "name_1")
    feature1.set_value("measurement", 10.03)
    feature1.set_value("id", 1)
    feature1.geometry = Point(241.32, 23.2)
    layer.add(feature1)

Get Value Of A Feature Attribute

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}")

Iterate Over Geometries In Geometry

point_geometry = Point(40.7128, -74.006)
line_geometry = LineString()
line_geometry.add_point(78.65, -32.65)
line_geometry.add_point(-98.65, 12.65)
geometry_collection = GeometryCollection()
geometry_collection.add(point_geometry)
geometry_collection.add(line_geometry)

for geometry in geometry_collection:
    if geometry.geometry_type == GeometryType.POINT:
        point = geometry
        assert str(point) == "POINT (40.7128 -74.006)"
    elif geometry.geometry_type == GeometryType.LINE_STRING:
        line = geometry
        assert str(line) == "LINESTRING (78.65 -32.65, -98.65 12.65)"

Example of specific GIS operations

# Getting the Centroid

polygon = Polygon()
ring = LinearRing()
ring.add_point(1, 0)
ring.add_point(2, 2)
ring.add_point(0, 4)
ring.add_point(5, 5)
ring.add_point(6, 1)
ring.add_point(1, 0)

polygon.exterior_ring = ring

# Get the centroid of the polygon
centroid = polygon.get_centroid()
	
# Get the point on surface.  Point on surface is guaranteed to be inside a polygon.
point_on_surface = polygon.get_point_on_surface()

# Get the Area of Polygon.
area = multi_polygon.polygon()

Set License Example

from aspose.gis import License

license = License()
licensePath = "PathToLicenseFile"
license.set_license(licensePath)

Product Page | Documentation | Demos | Blog | API Reference | Search | Free Support | Temporary License | EULA

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

aspose_gis_net-26.5.0-py3-none-win_amd64.whl (62.0 MB view details)

Uploaded Python 3Windows x86-64

aspose_gis_net-26.5.0-py3-none-win32.whl (53.8 MB view details)

Uploaded Python 3Windows x86

aspose_gis_net-26.5.0-py3-none-manylinux1_x86_64.whl (85.1 MB view details)

Uploaded Python 3

aspose_gis_net-26.5.0-py3-none-macosx_11_0_arm64.whl (61.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

aspose_gis_net-26.5.0-py3-none-macosx_10_14_x86_64.whl (76.7 MB view details)

Uploaded Python 3macOS 10.14+ x86-64

File details

Details for the file aspose_gis_net-26.5.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for aspose_gis_net-26.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f8a954686c036750a75c826184c85f1eeb13b1105224b2719fe6dff083ddb814
MD5 00062c73f6115cde82fbe4ba24e168ca
BLAKE2b-256 3efee126a48815e4a42b7e1a8e489c783857c2a8cd0c1f4ef6bdb37f12585f50

See more details on using hashes here.

File details

Details for the file aspose_gis_net-26.5.0-py3-none-win32.whl.

File metadata

  • Download URL: aspose_gis_net-26.5.0-py3-none-win32.whl
  • Upload date:
  • Size: 53.8 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for aspose_gis_net-26.5.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 3a1e0bc77c23c2c480058a18f05caf3db8c8fbc5871f6232aff1cc8e236028e2
MD5 902070876ad3d4a3cc97a3de12f5efd5
BLAKE2b-256 2b0b1cc497de9b9a27c2d68cc3d979105dfc45e45bc40e06f1df25e8dbc1193d

See more details on using hashes here.

File details

Details for the file aspose_gis_net-26.5.0-py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for aspose_gis_net-26.5.0-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5c7f9e87adc8b8065bfc0d728aa36b2a7486df8b08858591b5d176e2806d1268
MD5 356625238fa41116db8c2748c164f86d
BLAKE2b-256 906ead73b7ee6cff8b740727c9d48525bf8c44d144e5b3182b5aee75e6dc3058

See more details on using hashes here.

File details

Details for the file aspose_gis_net-26.5.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aspose_gis_net-26.5.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0021db0465145cfd5032189fcba77878b57d307af82c96d3bafe6b47613ec2f0
MD5 29556c22dbc1115786ce7dfb4f19f0c5
BLAKE2b-256 f227c9cf82d88f890cc04adf7c94f8a3547bc3552435bb83ab2da80e214a2f61

See more details on using hashes here.

File details

Details for the file aspose_gis_net-26.5.0-py3-none-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for aspose_gis_net-26.5.0-py3-none-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8356d67d4add51b9fc959ed846d54f31daf84448520914d52e05e25c6bb47387
MD5 6ac66a1bf93e4367d61a7571ce8d4908
BLAKE2b-256 d6dca6fc8eeaafe6431b0055598c5ecbb16400bbc61e68311b9f02e10905b103

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page