API Reference#

The API Reference provides an overview of all public objects, functions and methods implemented in GeofileOps.

Spatial operations on a single layer#

apply(input_path, output_path, func[, ...])

Apply a python lambda function on the geometry column of the input file.

buffer(input_path, output_path, distance[, ...])

Applies a buffer operation on geometry column of the input file.

clip_by_geometry(input_path, output_path, ...)

Clip all geometries in the imput file by the geometry provided.

convexhull(input_path, output_path[, ...])

Applies a convexhull operation on the input file.

delete_duplicate_geometries(input_path, ...)

Copy all rows to the output file, except for duplicate geometries.

dissolve(input_path, output_path, ...[, ...])

Applies a dissolve operation on the input file.

dissolve_within_distance(input_path, ...[, ...])

Dissolve geometries that are within the distance specified.

export_by_bounds(input_path, output_path, bounds)

Export the rows that intersect with the bounds specified.

isvalid(input_path[, output_path, ...])

Checks for all geometries in the geofile if they are valid.

makevalid(input_path, output_path[, ...])

Makes all geometries in the input file valid.

select(input_path, output_path, sql_stmt[, ...])

Execute a SELECT SQL statement on the input file.

simplify(input_path, output_path, tolerance)

Applies a simplify operation on geometry column of the input file.

warp(input_path, output_path, gcps[, ...])

Warp all input features to the output file according to the gcps specified.

Spatial operations on two layers#

clip(input_path, clip_path, output_path[, ...])

Clip the input layer with the clip layer.

erase(input_path, erase_path, output_path[, ...])

Erase all geometries in the erase layer from the input layer.

export_by_distance(...[, input1_layer, ...])

Exports all features within the distance specified.

export_by_location(...[, ...])

Exports all intersecting features.

intersection(input1_path, input2_path, ...)

Calculate the pairwise intersection of alle features.

join_by_location(input1_path, input2_path, ...)

Joins all features in input1 with all features in input2.

join_nearest(input1_path, input2_path, ...)

Joins features of input1 with the nb_nearest closest features of input2.

select_two_layers(input1_path, input2_path, ...)

Execute a SELECT SQL statement on the input files.

identity(input1_path, input2_path, output_path)

Intersection of the input layers, but retain the non-intersecting parts of input1.

symmetric_difference(input1_path, ...[, ...])

Calculates the "symmetric difference" of the two input layers.

union(input1_path, input2_path, output_path)

Calculates the pairwise "union" of the two input layers.

General layer operations#

append_to(src, dst[, src_layer, dst_layer, ...])

Append src file to the dst file.

add_column(path, name, type[, expression, ...])

Add a column to a layer of the geofile.

add_layerstyle(path, layer, name, qml[, ...])

Add the layer style to the geofile.

copy_layer(src, dst[, src_layer, dst_layer, ...])

Read a layer from a source file and write it to a new destination file.

create_spatial_index(path[, layer, ...])

Create a spatial index on the layer specified.

drop_column(path, column_name[, layer])

Drop the column specified.

execute_sql(path, sql_stmt[, sql_dialect])

Execute a SQL statement (DML or DDL) on the file.

get_crs(path)

Get the CRS (projection) of the file.

get_default_layer(path)

Get the default layer name to be used for a layer in this file.

get_layer_geometrytypes(path[, layer])

Get the geometry types in the layer by examining each geometry in the layer.

get_layerinfo(path[, layer, raise_on_nogeom])

Get information about a layer in the geofile.

get_layerstyles(path[, layer, name])

Get the layer styles saved in the geofile.

get_only_layer(path)

Get the layername for a file that only contains one layer.

has_spatial_index(path[, layer, no_geom_ok])

Check if the layer/column has a spatial index.

read_file(path[, layer, columns, bbox, ...])

Reads a file to a geopandas GeoDataframe.

remove_layerstyle(path, id)

Remove a layer style.

remove_spatial_index(path[, layer])

Remove the spatial index from the layer specified.

rename_column(path, column_name, new_column_name)

Rename the column specified.

rename_layer(path, new_layer[, layer])

Rename the layer specified.

update_column(path, name, expression[, ...])

Update a column from a layer of the geofile.

to_file(gdf, path[, layer, ...])

Writes a pandas dataframe to file.

General file operations#

cmp(path1, path2)

Compare if two geofiles are identical.

copy(src, dst)

Copies the geofile from src to dst.

get_driver(path)

Get the gdal driver name for the file specified.

listlayers(path[, only_spatial_layers])

Get the list of layers in a geofile.

move(src, dst)

Moves the geofile from src to dst.

remove(path[, missing_ok])

Removes the geofile.

Classes#

BufferEndCapStyle(value)

Enumeration of the possible end point buffer styles.

BufferJoinStyle(value)

Enumeration of the available buffer styles for intermediate points.

DataType(value)

This enum defines the standard data types that can be used for columns.

LayerInfo(name, featurecount, total_bounds, ...)

A data object containing meta-information about a layer.

PrimitiveType(value)

Enumeration of the different existing primitive types of a geometry.

SimplifyAlgorithm(value)

Enumeration of the supported simplification algorythms.