Geometry
gma.gio.Geometry
[class] Geometry(data = None, gtype = None, crs = None):Create a Geometry object.
Optional:
data = str||list||None. Default None.
The data to create the geometry from. It can be:
- None: create an empty geometry of type gtype.
- str: a string representation of the geometry in WKT, GeoJSON, GML, etc.
- list, tuple or np.ndarray: a collection of points to create the geometry from.
gtype = str. Default None.
The geometry type to create. It can be 'Point', 'LineString', 'Polygon', etc.
This parameter is required if data is a list, tuple or np.ndarray.
crs = str||int||None. Default None.
The projection of the geometry. If None, no projection is set.
Example
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.gtype, len(g))
print(tuple(round(v, 2) for v in g.bounds))
MultiPolygon 5
(112.91, -35.1, 129.0, -13.74)
Method
add_geometry(other)
Add a geometry to this geometry.
Parameters:
other: Geometry.
The other geometry to add.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
other = gio.open_vector('Australia.shp').get_feature(9).geom
print('Before:', len(g))
g.add_geometry(other)
print('After :', len(g))
Before: 5
After : 5
add_point(point)
Add a point to this geometry.
Parameters:
point: list||tuple.
The point coordinates to add. Should be a list or tuple of length 2, 3 or 4 depending on the geometry dimension.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
p = gio.Geometry(gtype='Point') # an empty Point geometry
print('Before:', p.to_str())
p.add_point((115.0, -25.0))
print('After :', p.to_str())
Before: POINT EMPTY
After : POINT (115 -25)
buffer(distance, quadsecs = 30)
Compute buffer of geometry.
Parameters:
distance: float.
The buffer distance to be applied. Should be expressed into the same unit as the coordinates of the geometry.
Optional:
quadsecs = int. Default 30.
The number of segments used to approximate a 90 degree (quadrant) of curvature.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before:', tuple(round(v, 2) for v in g.bounds))
r = g.buffer(1)
print('After :', tuple(round(v, 2) for v in r.bounds), r.gtype)
Before: (112.91, -35.1, 129.0, -13.74)
After : (111.91, -36.1, 130.0, -12.74) Polygon

centroid()
Compute the geometry centroid.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
r = g.centroid()
print(r.gtype, r.to_str())
Point POINT (122.17823301045 -25.4653344819968)
close_rings()
Force rings to be closed.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before:', g.gtype, len(g))
g.close_rings()
print('After :', g.gtype, len(g))
Before: MultiPolygon 5
After : MultiPolygon 5
concave_hull(ratio = 0.0, allow_holes = True)
concave_hull(double ratio, bool allowHoles) --> Geometry
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
r = g.concave_hull(ratio=0.2)
print(r.gtype, len(r), tuple(round(v, 2) for v in r.bounds))
Polygon 1 (112.91, -35.1, 129.0, -13.74)
contains(other)
Test for containment.
Parameters:
other: Geometry.
the other geometry to compare.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
print('WA contains NT :', g.contains(other))
print('WA contains its copy:', g.contains(g.copy()))
WA contains NT : False
WA contains its copy: True
convex_hull()
Compute convex hull.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
r = g.convex_hull()
print(r.gtype, len(r), tuple(round(v, 2) for v in r.bounds))
Polygon 1 (112.91, -35.1, 129.0, -13.74)

copy()
Make a copy of this object.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
cp = g.copy()
cp.empty()
print('original:', g.gtype, len(g), g.is_empty())
print('copy :', cp.gtype, len(cp), cp.is_empty())
print('same object:', cp is g)
original: MultiPolygon 5 False
copy : MultiPolygon 0 True
same object: False
crosses(other)
Test for crossing.
Parameters:
other: Geometry.
the other geometry to compare.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
print(g.crosses(other))
False
delaunay_triangulation(tolerance = 0.0, only_edges = True)
Return a Delaunay triangulation of the vertices of the geometry.
Optional:
dfTolerance = float||default 0.
optional snapping tolerance to use for improved robustness
bOnlyEdges = bool||default True.
If True, will return a MULTILINESTRING, otherwise it will return a GEOMETRYCOLLECTION containing triangular POLYGONs.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
r = g.delaunay_triangulation(tolerance=0.01)
print(r.gtype, len(r))
MultiLineString 1272
difference(other)
Perform spatial difference between two Geometries.
Parameters:
other: Geometry.
The other geometry to overlay.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
r = g.difference(other)
print(r.gtype, len(r), tuple(round(v, 2) for v in r.bounds))
MultiPolygon 5 (112.91, -35.1, 129.0, -13.74)
disjoint(other)
Test for disjointness.
Parameters:
other: Geometry.
The other geometry to compare.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
print(g.disjoint(other))
False
distance(other)
Compute distance between two geometries.
Parameters:
other: Geometry.
The other geometry to compare against.
Returns:
Type: Geometry.
NOTE: 3.0.4.1 returns an empty Geometry instead of a float.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
d = g.distance(other)
print('type :', type(d).__name__) # 3.0.4.1 returns an empty Geometry, not a float
type : Geometry
empty()
Clear geometry information.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before:', g.gtype, len(g), g.is_empty())
g.empty()
print('After :', g.gtype, len(g), g.is_empty())
Before: MultiPolygon 5 False
After : MultiPolygon 0 True
equals(other)
Returns True if two geometries are equivalent.
Parameters:
other: Geometry.
The other geometry to test against.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('g equals its copy:', g.equals(g.copy()))
g equals its copy: True
extent()
The extent of a geometry is the bounding rectangle.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
r = g.extent()
print(r.gtype, tuple(round(v, 2) for v in r.bounds))
Polygon (112.91, -35.1, 129.0, -13.74)
flatten()
Convert geometry to strictly 2D.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before:', g.gtype, len(g))
g.flatten()
print('After :', g.gtype, len(g))
Before: MultiPolygon 5
After : MultiPolygon 5
get_area(geodesic = False)
Compute geometry area.
Optional:
geodesic = bool. Default False.
whether considered as a surface on the underlying ellipsoid of the SRS attached to the geometry.
Returns:
Type: float.
The area of the geometry (planar or geodesic).
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('planar :', round(g.get_area(), 2))
print('geodesic:', round(g.get_area(geodesic=True), 2))
planar : 227.81
geodesic: 2528691844636.59
get_length(geodesic = False)
Compute geometry length.
Optional:
geodesic = bool. Default False.
whether considered as a surface on the underlying ellipsoid of the SRS attached to the geometry.
Returns:
Type: float.
The perimeter or length of the geometry.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('planar :', round(g.get_length(), 2))
print('geodesic:', round(g.get_length(geodesic=True), 2))
planar : 82.19
geodesic: 8745433.58
intersection(other)
Perform spatial intersection between two Geometries.
Parameters:
other: Geometry.
The other geometry to overlay.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
r = g.intersection(other)
print(r.gtype, r.is_empty(), 'bytes:', r.wkb_size())
LineString False bytes: 41
intersects(other)
Determines whether two geometries intersect.
Parameters:
other: Geometry.
The other geometry to test against.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
print(g.intersects(other))
True
is_empty()
Test if the geometry is empty.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.is_empty())
False
is_measured()
See whether this geometry is measured.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.is_measured())
False
is_ring()
Test if the geometry is a ring.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.is_ring())
False
is_simple()
Returns True if the geometry is simple.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.is_simple())
True
is_valid()
Test if the geometry is valid.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.is_valid())
True
make_valid(options = [])
Attempts to make an invalid geometry valid without losing vertices.
Optional:
options = list[str]. Default [].
papszOptions to be passed in. For example: ["METHOD=STRUCTURE"].
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
r = g.make_valid()
print(type(r).__name__, r.gtype, r.is_valid())
Geometry MultiPolygon True
normalize()
Attempts to bring geometry into normalized/canonical form.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before bytes:', g.wkb_size())
g.normalize()
print('After bytes :', g.wkb_size())
Before bytes: 7082
After bytes : 7082
overlaps(other)
Test for overlap.
Parameters:
other: Geometry.
the other geometry to compare.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
print(g.overlaps(other))
False
plot(ax = None, **kwargs)
Make plots of Geometry.
Optional:
ax = None||matplotlib. ~.AxesSubplot. Default None.
A matplotlib subplot. If None, a default axes will be created.
**kwargs
Other plotting parameters. For more, see:
~.carto.utils.PolyCollection/LineCollection/PointCollection.
Returns:
Type: Axes.
The matplotlib axes with the geometry plotted on it.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(6, 4.5))
ax = g.plot(ax=ax, facecolor='cornflowerblue', edgecolor='navy')
print(type(ax).__name__)
Axes

point_on_surface()
Returns a point guaranteed to lie on the surface.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
r = g.point_on_surface()
print(r.gtype, r.to_str())
Point POINT (121.208692520469 -24.3448241559099)
remove_geometry(i)
remove_geometry(int iSubGeom)
Parameters:
i: int.
Sub geom's id.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before:', g.gtype, len(g))
g.remove_geometry(0)
print('After :', g.gtype, len(g))
Before: MultiPolygon 5
After : MultiPolygon 4
remove_lower_dimension_sub_geoms()
remove lower dimension sub geoms.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before:', g.gtype, len(g))
g.remove_lower_dimension_sub_geoms()
print('After :', g.gtype, len(g))
Before: MultiPolygon 5
After : MultiPolygon 5
segmentize(max_length)
Modify the geometry such it has no segment longer then the given distance.
Parameters:
max_length: float.
the maximum distance between 2 points after segmentization
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before bytes:', g.wkb_size())
g.segmentize(0.5)
print('After bytes :', g.wkb_size())
Before bytes: 7082
After bytes : 7754
set_crs(crs)
Set the geometry's crs.
Parameters:
crs: str||int.
The output coordinate system. Can be EPSG, WKT, Proj4, and other types of coordinate characters. The default is no coordinate system!
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before:', g.crs)
g.set_crs('EPSG:3857')
print('After :', g.crs)
Before: <CoordinateReferenceSystem:WGS 84>
After : <CoordinateReferenceSystem:WGS 84 / Pseudo-Mercator>
set_dim(dim = "XY")
Set space dimension of geometry.
Optional:
dim = str. Default 'XY'.
Space dimensions. Can be 'XY', 'XYZ', 'XYM' or 'XYZM'.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before:', g.dim)
g.set_dim('XYZ')
print('After :', g.dim)
Before: XY
After : XYZ
simplify(tolerance, preserve_topology = False)
Compute a simplified geometry.
Parameters:
tolerance: float.
The distance tolerance for the simplification.
Optional:
preserve_topology = bool. Default False.
Simplify the geometry while preserving topology.
Returns:
Type: Geometry.
A simplified copy of the geometry.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before bytes:', g.wkb_size())
r = g.simplify(0.05, preserve_topology=True)
print('After bytes :', r.wkb_size(), r.gtype)
Before bytes: 7082
After bytes : 2714 MultiPolygon

swap()
Swap x and y coordinates.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before:', g.to_str()[:70])
g.swap()
print('After :', g.to_str()[:70])
Before: MULTIPOLYGON (((113.131812939816 -25.9519921855907,113.148226515042 -2
After : MULTIPOLYGON (((-25.9519921855907 113.131812939816,-25.9738330065878 1
sym_difference(other)
Perform spatial symmetric difference between two Geometries.
Parameters:
other: Geometry.
The other geometry to overlay.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
r = g.sym_difference(other)
print(r.gtype, len(r), tuple(round(v, 2) for v in r.bounds))
MultiPolygon 15 (112.91, -35.1, 138.0, -10.97)
to_bytearray(stype = "wkb")
Convert a geometry into bytearray.
Optional:
stype = str. Default 'wkb'.
Export string type: 'iso_wkb' or 'wkb'.
Returns:
Type: bytearray.
The WKB or WKT representation as bytes.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
b = g.to_bytearray()
print(type(b).__name__, len(b))
bytearray 7082
to_crs(crs, copy = True)
Reproject geometry to new spatial reference system.
Parameters:
crs: CoordinateReferenceSystem.
The spatial reference system to apply.
Optional:
copy = bool. Default True.
Whether to return a copy of the reprojected geometry.
Returns:
Type: Geometry.
A new geometry reprojected to the given CRS.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before:', g.crs, tuple(round(v, 2) for v in g.bounds))
r = g.to_crs('EPSG:3857')
print('After :', r.crs, tuple(round(v, 2) for v in r.bounds))
Before: <CoordinateReferenceSystem:WGS 84> (112.91, -35.1, 129.0, -13.74)
After : <CoordinateReferenceSystem:WGS 84 / Pseudo-Mercator> (12568878.13, -4177180.15, 14360432.5, -1544883.41)
to_geom_base()
Split complex geometry into basic geometries.
Returns:
Type: dict.
Basic geometries grouped by geometry type.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
d = g.to_geom_base()
print(type(d).__name__, list(d.keys()))
for k, v in d.items():
print(k, len(v))
dict ['Polygon']
Polygon 5
to_points(ndim = 2, node = False)
Get all points from the geometry.
Parameters:
ndim: int. Default 0.
The number of dimensions for each point: 2, 3 or 4. If 0, it will use the geometry's own dimension.
Optional:
node = bool||default False.
Whether to add node markers for points.
Returns:
Type: list.
Point coordinates grouped by component geometry.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
pts = g.to_points()
print(type(pts).__name__, len(pts))
print('points in first part:', len(pts[0]))
print('first two points :', pts[0][:2])
list 5
points in first part: 11
first two points : [(113.13181293981552, -25.95199218559071), (113.14822651504176, -25.973833006587824)]
to_precision(precision)
Set the geometry's precision.
Parameters:
precision: float.
Geometric coordinate precision. e.g: 0.001.
Returns:
Type: None.
Modify the geometry in place.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print('Before bytes:', g.wkb_size())
g.to_precision(2)
print('After bytes :', g.wkb_size())
Before bytes: 7082
After bytes : 7082
to_str(stype = "wkt")
Convert a geometry into str / bytes.
Optional:
stype = str. Default 'wkt'.
Export string type: 'iso_wkt', 'json', 'kml' or 'wkt'.
Returns:
Type: str.
The WKT or WKB string of the geometry.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
s = g.to_str()
print('format : WKT (length %d)' % len(s))
print('starts :', s[:70])
format : WKT (length 15268)
starts : MULTIPOLYGON (((113.131812939816 -25.9519921855907,113.148226515042 -2
touches(other)
Test for touching.
Parameters:
other: Geometry.
the other geometry to compare.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
print(g.touches(other))
True
unary_union()
Union all sum Geometries.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
r = g.unary_union()
print(r.gtype, len(r), tuple(round(v, 2) for v in r.bounds))
MultiPolygon 5 (112.91, -35.1, 129.0, -13.74)
union(other)
Perform spatial union between two Geometries.
Parameters:
other: Geometry.
The other geometry to overlay.
Returns:
Type: Geometry.
A new geometry with the operation applied.
Example:
from gma import gio
ly = gio.open_vector('Australia.shp')
g = ly.get_feature(0).geom # Western Australia
other = ly.get_feature(1).geom # Northern Territory
r = g.union(other)
print(r.gtype, len(r), tuple(round(v, 2) for v in r.bounds))
MultiPolygon 15 (112.91, -35.1, 138.0, -10.97)

within(other)
Test for containment.
Parameters:
other: Geometry.
the other geometry to compare.
Returns:
Type: bool.
Whether the spatial relation / predicate holds.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.within(g.convex_hull()))
True
wkb_size()
Returns size of related binary representation.
Returns:
Type: int.
Size of the WKB representation in bytes.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.wkb_size())
7082
Property
boundary
Compute boundary.
Returns:
Geometry:
A new geometry.
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
b = g.boundary
print(b.gtype, len(b))
MultiLineString 5
bounds
Computes and returns the bounds for this geometry in the passed psEnvelope structure.
Returns:
list of float:
minx, maxx, miny, maxy
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.bounds)
(112.9081532637623, -35.097803081147106, 129.00196002963185, -13.744181661854043)
crs
Geometry coordinate reference system. --> CoordinateReferenceSystem
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.crs)
<CoordinateReferenceSystem:WGS 84>
dim
The dimension of the geometry. --> str(XY(2), XYZ(3) and XYM(3), XYZM(4)).
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.dim)
XY
gtype
Fetch WKT name for geometry type. --> str
Example:
from gma import gio
g = gio.open_vector('Australia.shp').get_feature(0).geom # Western Australia
print(g.gtype)
MultiPolygon