Vector Operations¶
SudaPy provides a set of vector geoprocessing functions accessible from both the CLI and Python API. All functions accept GeoPackage (.gpkg), GeoJSON, and Shapefile (.shp) formats.
Reproject¶
Change the coordinate reference system of a vector dataset.
Clip¶
Clip a vector dataset using another geometry as a mask.
Note
If the clip geometry has a different CRS, SudaPy automatically reprojects it to match the input.
Dissolve¶
Merge geometries by an attribute field.
Calculate area¶
Add an area column in square meters.
Automatic UTM projection
If the input CRS is geographic (lat/lon), SudaPy temporarily projects to the estimated UTM zone for accurate metric area. A warning is emitted. For best accuracy, reproject your data to a projected CRS first.
Buffer¶
Create buffer zones around geometries. Distance is specified in meters.
If the input CRS is geographic, SudaPy auto-projects to UTM, applies the buffer in meters, then projects back to the original CRS.
Simplify¶
Reduce vertex count using the Douglas-Peucker algorithm. Tolerance is in meters.
Fix geometry¶
Repair invalid geometries using Shapely's make_valid.
Tip
Run sudapy report --in file.gpkg first to check how many invalid geometries exist before fixing.
Supported formats¶
| Extension | Format | Read | Write |
|---|---|---|---|
.gpkg |
GeoPackage | Yes | Yes |
.geojson / .json |
GeoJSON | Yes | Yes |
.shp |
ESRI Shapefile | Yes | Yes |
Working with GeoDataFrames directly¶
All functions accept either a file path or a geopandas.GeoDataFrame. The out parameter is optional -- omit it to get the result in memory without writing to disk: