Skip to main content

pygml

A pure python parser and encoder for OGC GML Geometries.

PyPI version CI Documentation Status

Installation

$ pip install pygml

Features

Parse GML 3.1, 3.2, compact encoded GML 3.3 and GeoRSS geometries to a Geo Interface compliant class.

>>> import pygml
>>> geom = pygml.parse("""
... <gml:Point gml:id="ID" xmlns:gml="http://www.opengis.net/gml/3.2">
...    <gml:pos>1.0 1.0</gml:pos>
... </gml:Point>
... """)
>>> print(geom)
Geometry(geometry={'type': 'Point', 'coordinates': (1.0, 1.0)})
>>> print(geom.__geo_interface__)
{'type': 'Point', 'coordinates': (1.0, 1.0)}

Conversely, it is possible to encode GeoJSON or Geo Interfaces to GML

>>> from pygml.v32 import encode_v32
>>> from lxml import etree
>>> tree = encode_v32({'type': 'Point', 'coordinates': (1.0, 1.0)}, 'ID')
>>> print(etree.tostring(tree, pretty_print=True).decode())
<gml:Point xmlns:gml="http://www.opengis.net/gml/3.2" srsName="urn:ogc:def:crs:OGC::CRS84" gml:id="ID">
  <gml:pos>1.0 1.0</gml:pos>
</gml:Point>

>>>

Release files for pygml 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygml 0.3.2
File Size Uploaded
pygml-0.3.2.tar.gz 29.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygml 0.3.2
File Interpreter ABI Platform
pygml-0.3.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 74.5 kB

Release files / pygml-0.3.2.tar.gz

Download URL pygml-0.3.2.tar.gz
Size 29.6 kB
Tags Source
SHA-256 checksum
How to use checksums
eeb4175daa25200881b90c071df3d9249079b7e0c78485d7d773974556892b16
BLAKE2b-256 checksum
How to use checksums
a572dfa8e0ccc7b692322c2c4541b2c285b0022cb7b4e0eb436aa7b67daf6873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pygml-0.3.2-py2.py3-none-any.whl

Download URL pygml-0.3.2-py2.py3-none-any.whl
Size 44.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1aeeeac8f1ba7c07fd6e9cc5d9c61892e2e3574a165abf3005934237baa70961
BLAKE2b-256 checksum
How to use checksums
6dd34829b61d0048b2097ce403d4dafb4687de1ce3fbd2bacee3cbab494e4669
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page