Layer

Luo_Suppe2026-08-15

gma.gio.Layer

class Layer(data = None, name = None, gtype = None, ftypes = None, crs = None, **kwargs):

GMA Layer class. Initialize a Layer object.

Parameters:

data: Layer||Geometry||Feature||list||None. Default None.

The data source to create the Layer. It can be: 1) Another GMA Layer object.

2) A Geometry object or a Feature object, or a list of Geometry/Features.

3) None, create an empty Layer.

name: str||None. Default None.

The name of the Layer. If data is a Layer, name can not be set.

gtype: str||None. Default None.

The geometry type of the Layer. Supported geometry type include: 'Point', 'MultiPoint', 'Line', 'MultiLine', 'Polygon', 'MultiPolygon'.

If data is a Layer, gtype can not be set.

ftypes: FieldType||list||dict||None. Default None.

The field types of the Layer. It can be: 1) A FieldType object.

2) A list of FieldType objects.

3) A dict of field name and field type.

If data is a Layer, ftypes can not be set.

crs: str||int||class||None. Default None.

The coordinate system of the Layer. Can be EPSG, WKT, Proj4, and other types of coordinate characters. If data is a Layer, crs can not be set.

**kwargs:

Other parameters passed to _algos.geodatabase.GeoDatabase.


Methods

add_feature

[method] .add_feature(*features):

Add features to Layer.

Parameters:

*feature: Feature.

One or more vector features.


add_field

[method] .add_field(name = None, dtype = "UNKNOWN"):

Add a field to Layer.

Optional:

name: str. Default = None

The name of the field. None for dtype name.

dtype: str. Default = 'UNKNOWN'

The data type of the field. See `dtypes.DefinedFieldDataTypes` for valid types.


boundary

[method] .boundary(**kwargs):

Creates buffer polygons around input features to a specified distance. **kwargs: Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


buffer

[method] .buffer(distance = 10, side = "Both", dissolve = False, **kwargs):

Creates buffer polygons around input features to a specified distance.

Optional:

distance = float. Default 10.

The distance around the input features that will be buffered.

side = str. Default 'Both'.

Specifies the sides of the input features that will be buffered. May be 'Both', 'Left' or 'Right'. 'Both' is only supported for Polygon.

dissolve = bool. Default False.

Whether to dissolve the buffers into one feature.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


calculate_geometry

[method] .calculate_geometry(area = False, length = False, gtype = False, circularity = False, num_points = False, num_geometries = False, ellipsoid_area = False, ellipsoid_length = False, keep_fields = False, keep_geom = True, **kwargs):

Calculate geometry attribute.

Optional:

area = bool||str. Default False.

Whether to calculate the area of the polygon. GeoGCS: deg2; ProjCS:m2.

If str, it will be the new name of the output result.

length = bool||str. Default False.

Whether to calculate the length of a line. GeoGCS: deg; ProjCS:m.

If str, it will be the new name of the output result.

gtype = bool||str. Default False.

Whether to get the type of the geometry. If str, it will be the new name of the output result.

circularity = bool||str. Default False.

Whether to computes the Circularity Index from the given Geometry.

If str, it will be the new name of the output result.

num_points = bool||str. Default False.

Whether to count the number of inflection points. If str, it will be the new name of the output result.

NumGeometries = bool||str. Default False.

Whether to count the number of geometries. If str, it will be the new name of the output result.

ellipsoid_area = bool||str. Default False.

Whether to calculate the area of the polygon using crs's ellipsoid. Unit: m2.

If str, it will be the new name of the output result.

ellipsoid_length = bool||str. Default False.

Whether to calculate the length of a line using crs's ellipsoid. Unit: m.

If str, it will be the new name of the output result.

keep_fields = bool||list. Default False.

Whether to retain attribute table fields. If list, it specifies the field names to be retained.

keep_geom = bool. Default True.

Whether to retain geometry field.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


calculate_statistics

[method] .calculate_statistics(statistics, case = None, where = None, **kwargs):

Calculates summary statistics for fields in a table.

Parameters:

statistics: dict||list||str.

Conduct statistical analysis on selected fields according to the predefined statistical methods.

Format 1: Statistics = {Method: [Field0, Field1, ...]} All fields will undergo Method(Field) and will be stored in Field_Method field.

Example: Statistics = {'sum': ['field0', 'field1']} Format 2: Statistics = {Method: {Field0: NewName0, Field1: NewName1, ...}} All fields will undergo Method(Field) and will be stored in NewName field.

Example: Statistics = {'sum': {'field0': 'NewName0sum', 'field1': 'NewName1sum'}} Format 3: Statistics = 'Field0 + Field1 AS sum_result' Calculate the sum of Field0 and Field1 as "sum_result".

If it is a list, it must be a list of str in the format 3.

Including statistics types: 'min', 'max', 'sum', 'avg', 'count', 'total', ...

For more, see SQLite grammar.

Optional:

case = str||list||None. Default None.

The field or fields in the input that will be used to calculate statistics separately for each unique attribute value (or combination of attribute values when multiple fields are specified).

where = str||None. Default None.

The SQL query string expressions to evaluate. For example: Where = 'ROWID = 1 OR Name IN ("GMA", "Layer")' 'ROWID' and 'Name' are the Layer field names.

Supported Rules: Comparison Operators: =, !=, <>, <, >, <=, >= Logical Operators: AND, OR, NOT Wildcard Search Symbols: LIKE Range Condition: BETWEEN, IN, NOT IN Null-Value Check Operators: IS NULL, IS NOT NULL Regular expression matching: REGEXP

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


centroid

[method] .centroid(**kwargs):

The points representing the centroid of each geometry.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


clip

[method] .clip(other, **kwargs):

Clip off areas that are not covered by the method layer.

Parameters:

Optional:

**kwargs:

Other parameters passed to io.CreateLayer.

Returns:

Type: Layer.


closest_point

[method] .closest_point(other, **kwargs):

Calculate the closest point on the tow layer.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


collect

[method] .collect(use_field = None, keep_fields = True, **kwargs):

Collect features based on field values.

Optional:

use_field = str||list||None. Default None.

The field name(s) used to merge Features! If it's None, then dissolve all features.

keep_fields = bool||list. Default False.

Whether to retain attribute table fields. If list, it specifies the field names to be retained.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


concave_hull

[method] .concave_hull(**kwargs):

The concave hull of a geometry is the smallest concave Polygon containing all the points in each geometry.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


convex_hull

[method] .convex_hull(**kwargs):

The convex hull of a geometry is the smallest convex Polygon containing all the points in each geometry.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


copy

[method] .copy(**kwargs):

Copy replica to default driver.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


delaunay_triangulation

[method] .delaunay_triangulation(edges_only = False, tolerance = 0, **kwargs):

Return a Delaunay triangulation of the vertices of the geometry.

Optional:

tolerance = float. Default 0.0.

Snapping tolerance to use for improved robustness.

edges_only = bool. Default False.

Whether the output geometry should be filled polygons(False) or just boundary lines(True).

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


dissolve

[method] .dissolve(use_field = None, keep_fields = True, **kwargs):

Dissolve features based on field values.

Optional:

use_field = str||list||None. Default None.

The field name(s) used to dissolve Features! If it's None, then dissolve all features.

keep_fields = bool||list. Default False.

Whether to retain attribute table fields. If list, it specifies the field names to be retained.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


distance

[method] .distance(other, method = None, densify_fract = 0.1, **kwargs):

Calculates the distance between all geometric shapes within two Layers.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

method = str||None. Default None.

Calculate method. May be None(normal distance), 'Hausdorff' or 'Frechet'.

densify_fract = float. Default 0.1.

A value between 0 and 1, that splits each subsegment of a line string into equal length segments, making the approximation less coarse.

A densify value of 0.5 will add a point halfway between each pair of points. A densify value of 0.25 will add a point every quarter of the way between each pair of points.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


drop

[method] .drop(rows = None, fields = None):

Drop specified features or fields.

Optional:

rows = int||list||None. Default None.

List of FIDs to be deleted.

fields = str||list||None. Default None.

List of field names to be deleted.


envelope

[method] .envelope(union = False, **kwargs):

The envelope of a geometry is the bounding rectangle.

Optional:

union = bool. Default True.

Whether to first integrate all elements before calculating.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


erase

[method] .erase(other, **kwargs):

Remove areas that are covered by the method layer.

Parameters:

other: Layer.

Another GMA Layer!

**kwargs:

Other parameters passed to io.CreateLayer.

Returns:

Type: Layer.


explode

[method] .explode(**kwargs):

Separate a selected multipart feature into its individual.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


extent

[method] .extent(**kwargs):

The extent of a geometry is the bounding rectangle.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


exterior_ring

[method] .exterior_ring(**kwargs):

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


find_overlaps

[method] .find_overlaps(**kwargs):

Find overlapping features in Layer.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.


fix_geometry

[method] .fix_geometry(**kwargs):

Fix invalid geometric features in Layer.

Returns:

Type: Layer.


gen_grid

[method] .gen_grid(grid_type = "Square", size = 1, **kwargs):

Gen a grid of cells (having the edge length of size) precisely covering the input Layer.

Optional:

grid_type = str. Default 'Square'.

Grid type.Can be 'Square', 'Triangular', 'Hexagonal'.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


geom_self_test

[method] .geom_self_test():

Geometry self-test. Include: Empty, Simple, Valid, 3D, Measured, Valid Reason, Polygon Clockwise Rule(Counter-Clockwise Rule).

Returns:

Type: Layer.

In this context, 0 indicates False, 1 indicates True, -1 indicates that the input geometry object is not of the required type.


geom_to_str

[method] .geom_to_str(wkt = True, gml = False, kml = False, json = False, ewkb = False, ewkt = False, svg = False, **kwargs):

Converts geometry to string.

Optional:

wkt = bool. Default True.

Whether to convert to WTK string.

gml = bool. Default False.

Whether to convert to Gml string.

kml = bool. Default False.

Whether to convert to Kml string.

json = bool. Default False.

Whether to convert to GeoJSON string.

ewkb = bool. Default False.

Whether to convert to EWKB string.

ewkt = bool. Default False.

Whether to convert to EWKT string.

svg = bool. Default False.

Whether to convert to SVG string.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


get_feature

[method] .get_feature(row_num = 0):

Fetch a feature by its identifier.

Optional:

row_num = int. Default 0.

The feature number of the feature to read.

Returns:

Feature:

A new feature now owned by the caller


identity

[method] .identity(other, o_prefix = "L1_", **kwargs):

Identify the features of this layer with the ones from the identity layer.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

o_prefix = str. Default 'L1_'.

Set a prefix for the field names that will be created from the fields of the method layer.

**kwargs:

Other parameters passed to io.CreateLayer.

Returns:

Type: Layer.


interior_ring

[method] .interior_ring(n = 1, **kwargs):

Optional:

n = int. Default 1.

Extracted inner ring index (starting from 1).

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


interpolation

[method] .interpolation(v_field, bounds = None, resolution = None, method = "idw", ipt_opts = {}, **kwargs):

Interpolate points into raster dataset.

Parameters:

v_field: str.

The field to be interpolated.

Optional:

bounds = tuple. Default None.

The four boundaries of the interpolation result are the minimum longitude (left), the minimum latitude (bottom), the maximum longitude (right), and the maximum latitude (top). The default (None) is to extract the range from the input coordinate points.

resolution = float. Default None.

The resolution of the interpolation result. The default (None) is 1/10 of the minimum bounds X and Y difference.

method = str. Default 'idw'.

Interpolation method. Can be 'b_spline', 'idw', 'kriging', 'natural_neighbor', 'nearest', 'rbf' and 'trend'. For more, see smc.interp.

ipt_opts = dict. Default {}.

Interpolation parameters. Corresponding to the interpolation method.

**kwargs:

Other parameters passed to _algos.geo.dataset.raster_translate.

Returns:

Type: Dataset||dict.

Contains the raster dataset and other interpolation results. The keys are the names of the results, and the values are the corresponding raster datasets or other results.


intersection

[method] .intersection(other, o_prefix = "L1_", **kwargs):

Intersection of two layers.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

o_prefix = str. Default 'L1_'.

Set a prefix for the field names that will be created from the fields of the method layer.

**kwargs:

Other parameters passed to io.CreateLayer.

Returns:

Type: Layer.


join

[method] .join(other, spatial_join = None, left_on = None, right_on = None, one_to_one = True, suffixes = "", ext_cond = None, **kwargs):

Join the attribute table of RLayer into the first Layer.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

spatial_join = str. Default None.

Spatial join method. Supported 'Intersects', 'Disjoint', 'Within', 'Equals', 'Touches'.

Default(None) no spatial join.

left_on = str||list||None. Default None.

Feild names to join on in the self Layer. Can also be a list of the length of the self Layer. Default(None) using self FID column if spatial_join is None.

right_on = str||list||None. Default None.

Feild names to join on in the other Layer. Can also be a list of the length of the other Layer. Default(None) using other FID column if spatial_join is None.

one_to_one = bool. Default False.

Whether to keep only one feature in the second layer for each feature in the first layer.

suffixes = str. Default ''.

Extended character used to mark the second layer column.

ext_cond = str||None. Default None.

Additional SQL conditions for joining the two layers. For example: ext_cond = 'a0.field0 > 10 AND a1.field1 < 20'.

a0 and a1 are the aliases of the self and other layers, respectively.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


line_equidistant_points

[method] .line_equidistant_points(length, keep_fields = True, **kwargs):

Generate equidistant points along the line geometry.

Parameters:

length: float.

Distance between points.

Optional:

keep_fields = bool. Default True.

Whether to retain attribute table fields.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


merge

[method] .merge(*others, **kwargs):

Merge all layers.

Parameters:

*others: Layer||listofLayer.

Other GMA Layers!

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


min_bounding_circle

[method] .min_bounding_circle(**kwargs):

Constructs the Minimum Bounding Circle for a generic geometry.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


min_rotated_rectangle

[method] .min_rotated_rectangle(**kwargs):

Calculate the minimum rotated rectangular polygon which encloses the input geometry.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


min_width

[method] .min_width(**kwargs):

Calculate the LINESTRING geometry which represents the minimum diameter of the geometry.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


multi

[method] .multi(**kwargs):

Make single part geometry into their multi counterpart.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


order_by

[method] .order_by(fields, ascending = True, **kwargs):

Sort by field.

Parameters:

fields: str||list.

Fields or list of fields to be sorted.

Optional:

ascending = bool||list. Default True.

Sort order, which can be True(ascending) or False(descending).

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


plot

[method] .plot(ax = None, **kwargs):

Make plots of Layer.

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:

matplotlib.~.AxesSubplot.


point_on_surface

[method] .point_on_surface(**kwargs):

Computes a point guaranteed to lie in a polygon, or on a geometry.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


query

[method] .query(expr, tran_opts = {}, **kwargs):

Query the data with a full SpatiaLite SQL expression.

Parameters:

expr: str.

The query string to evaluate.

Optional:

tran_opts = dict. Default {}.

Vector translate options. For more, see _algos.geo.layer.vector_translate.

**kwargs:

Other parameters passed to ._algos.geo.vrt.VRTGeoDatabase.add_layer.

Returns:

Type: Layer.


rotate

[method] .rotate(angle = 90, **kwargs):

Rotate an angle of the layer.

Parameters:

Angle = float. Default 90.

Rotation angle (In Degrees) with the point [0, 0] as the origin.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


sanitize

[method] .sanitize(**kwargs):

Sanitize geometry. Including removing duplicate points and ensuring closed rings.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


scale

[method] .scale(factor = 1, **kwargs):

Select the intersecting features.

Optional:

factor = float||list. Default 1.

X, Y scale factors. If a single value is provided, it is assumed that X = Y.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


select

[method] .select(where = "", keep_fields = True, keep_geom = True, **kwargs):

Using SQL WHERE expressions to filter features by attribute table fields.

Optional:

where = str. Default ''.

The SQL query string expressions to evaluate. For example: Where = 'ROWID = 1 OR Name IN ("GMA", "Layer")' 'ROWID' and 'Name' are the Layer field names.

Supported Rules: Comparison Operators: =, !=, <>, <, >, <=, >= Logical Operators: AND, OR, NOT Wildcard Search Symbols: LIKE Range Condition: BETWEEN, IN, NOT IN Null-Value Check Operators: IS NULL, IS NOT NULL Regular expression matching: REGEXP

keep_fields = bool||list. Default False.

Whether to retain attribute table fields. If list, it specifies the field names to be retained.

keep_geom = bool. Default True.

Whether to retain geometry field.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


select_overlay

[method] .select_overlay(other, method = "Intersects", **kwargs):

Select features that conform to the overlay rule.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

method = str. Default 'Intersects'.

Overlay method. Supported methods include: 'Intersects', 'Disjoint', 'Within', 'Equals', 'Touches'.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


set_feature

[method] .set_feature(feature, fid = None):

Rewrite an existing feature. To set a feature, but create it if it doesn't exist.

Parameters:

feature: Feature.

A vector feature.

Optional:

fid = int||None. Default None.

The FID added to the layer. Defaults to the feature's FID.


set_spatial_filter

[method] .set_spatial_filter(geom = None):


shared_paths

[method] .shared_paths(other, **kwargs):

Calculate the shared paths between two layers.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


shift

[method] .shift(distance = 1, **kwargs):

Shilf a distance of the layer.

Optional:

distance = float||list. Default 1.

X, Y shift distance. If a single value is provided, it is assumed that X = Y.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


shortest_line

[method] .shortest_line(other, **kwargs):

Calculate the shortest line between the geometries of tow layers.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


simplify

[method] .simplify(tolerance = 0, preserve_topology = False, **kwargs):

Simplify geometries in the Layer.

Optional:

tolerance = float. Default 0.0.

Tolerance allowed when simplifying geometric features.

preserve_topology = bool. Default False.

Simplify the geometry while preserving topology.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


snap

[method] .snap(other = None, tolerance = 0, **kwargs):

Snap vertices to the nearest vertices of another geometry.

Optional:

other = None||Layer. Default None.

Another GMA Layer! If None, snap to the grid.

tolerance = float. Default 0.0.

Tolerance allowed when processing features. If snapped to the grid, this parameter represents the size of the grid. All points and vertices will be aligned to a grid defined by its origin and size.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


sym_difference

[method] .sym_difference(other, o_prefix = "L1_", **kwargs):

Symmetrical difference of two layers.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

o_prefix = str. Default 'L1_'.

Set a prefix for the field names that will be created from the fields of the method layer.

**kwargs:

Other parameters passed to io.CreateLayer.

Returns:

Type: Layer.


to_bytearray

[method] .to_bytearray(keep_geom = False, keep_fields = True):

Read vector attribute table to a bytearray.

Optional:

keep_geom = bool. Default False.

Whether to export the geometry in WKT format!

keep_fields = bool||list. Default False.

Whether to retain attribute table fields. If list, it specifies the field names to be retained.

Returns:

Type: bytearray.


to_crs

[method] .to_crs(crs = "WGS84", **kwargs):

Reproject to another coordinate system.

Optional:

crs = str||int||class. Default 'WGS84'.

The output coordinate system. Can be EPSG, WKT, Proj4, and other types of coordinate characters.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


to_dataset

[method] .to_dataset(resolution = 1, field = None, bounds = None, nodata = None, **kwargs):

Translate Layer to DataSet!

Optional:

resolution = float. Default 1.

Resolution of the DataSet.

field = str||None. Default None.

The field to be translated. By default (None), the DataSet will be generated with 0 and 1.

bounds = tuple. Default None.

The four boundaries of the interpolation result are the minimum longitude (left), the minimum latitude (bottom), the maximum longitude (right), and the maximum latitude (top). The default (None) is the bounds of the input Layer.

nodata = float||None. Default None.

The output DataSet nodata value. By default (None), the nodata value is automatically calculated.

**kwargs:

Other parameters passed to algos.dataio.utils.CreateRasterEx.

Returns:

Type: DataSet.


to_dim

[method] .to_dim(dim = "XY", z = None, m = None, **kwargs):

Casting space dimension of Layer.

Optional:

dim = str. Default 'XY'.

Space dimensions. Can be 'XY', 'XYZ', 'XYM' or 'XYZM'.

z = float||None. Default None.

Z value. Only valid when SDIM is in 'XYZ', 'ZYZM' and layer SDIM is 'XY'.

m = float||None. Default None.

M value. Only valid when SDIM is in 'XYM', 'ZYZM' and layer SDIM is 'XY'.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


to_file

[method] .to_file(out_dst, driver = "ESRI Shapefile", layer_name = None, mode = None, **kwargs):

in_src, out_dst = None, driver = None, optional Save Layer as a vector file.

Parameters:

out_dst: str.

The output vector file path.

Optional:

driver = str. Default 'ESRI Shapefile'.

Output file driver. For other drivers, see ._algos.geo.driver.DriveStatistics().vectors.

layer_name = str||None. Default None.

Output layer name. Default(None) is the self name.

mode = str||None. Default None.

Access mode. Default(None) is 'creation'. Other supported mode include: 'update', 'append', 'upsert' and 'overwrite'.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.


to_gtype

[method] .to_gtype(gtype = "MultiPolygon", **kwargs):

Change the geometric type of Layer.

Optional:

gtype = str. Default 'MultiPolygon'.

Output geometry type. Supported geometry type include: 'Point', 'MultiPoint', 'Line', 'MultiLine', 'Polygon', 'MultiPolygon'.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


to_pandas

[method] .to_pandas(keep_geom = False, keep_fields = True, **kwargs):

Read vector attribute table to a pandas DataFrame.

Optional:

keep_geom = bool. Default False.

Whether to export the geometry in WKT format!

keep_fields = bool||list. Default False.

Whether to retain attribute table fields. If list, it specifies the field names to be retained.

**kwargs:

Other parameters passed to pd.read_csv.

Returns:

Type: DataFrame.


union

[method] .union(other, o_prefix = "L1_", **kwargs):

Union of two layers.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

o_prefix = str. Default 'L1_'.

Set a prefix for the field names that will be created from the fields of the method layer.

**kwargs:

Other parameters passed to io.CreateLayer.

Returns:

Type: Layer.


update

[method] .update(other, **kwargs):

Update this layer with features from the update layer.

Parameters:

other: Layer.

Another GMA Layer!

Optional:

**kwargs:

Other parameters passed to io.CreateLayer.

Returns:

Type: Layer.


vertices_to_points

[method] .vertices_to_points(**kwargs):

Creates points generated from specified vertices or locations.

Optional:

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


voronoj_diagram

[method] .voronoj_diagram(ext_frame_size = 5, edges_only = False, **kwargs):

Return a geometric object representing the Voronoj Diagram corresponding to the input Geometry.

Optional:

ext_frame_size = float. Default 5(%).

Allows to arbitrarily set the percent extension of the bounding frame.

edges_only = bool. Default False.

Whether the output geometry should be filled polygons(False) or just boundary lines(True).

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


xy_table_to_point

[method] .xy_table_to_point(x_field, y_field, crs = "WGS84", **kwargs):

Creates a point Layer based on X, Y-coordinates from a table.

Parameters:

x_field: str.

The field in the input table that contains the x-coordinates (or longitude).

y_field: str.

The field in the input table that contains the y-coordinates (or latitude).

Optional:

crs = str||int||class||None. Default 'WGS84'.

The output coordinate system. Can be EPSG, WKT, Proj4, and other types of coordinate characters.

**kwargs:

Other parameters passed to _algos.geo.layer.vector_translate.

Returns:

Type: Layer.


Property

bounds

Layer bounds(left, bottom, right, top). --> tuple


crs

Layer coordinate reference system. --> CoordinateReferenceSystem


driver

Layer driver. --> VectorDriver


fid_col

FID field name. --> str


ftypes

Field definitions. --> FieldTypes


geom_col

Geometry field name. --> str


gtype

Layer geometry type. --> GMADataType


Layer path link. --> str


name


spatial_filter


tb


Last Updated 8/15/2026, 8:42:21 AM