ost.helpers.vector¶
Functions
Helper function to transform various AOI formats into WKT |
|
|
|
Creates an exterior vector of an input vector |
|
Function to parse features from GeoDataFrame in such a manner that rasterio wants them |
|
|
|
|
|
Get the proj4 string from a projection file of a shapefile |
|
|
|
|
A helper function to create a WKT representation of Lat/Lon pair |
Reproject a wkt geometry based on EPSG code |
|
A helper function to translate a shapefile into WKT |
|
|
|
|
- ost.helpers.vector.aoi_to_wkt(aoi)[source]¶
Helper function to transform various AOI formats into WKT
This function is used to import an AOI definition into an OST project. The AOIs definition can be from difffrent sources, i.e. an ISO3 country code (that calls GeoPandas low-resolution country boundaries), a WKT string,
- Parameters
aoi (str/Path) – AOI , which can be an ISO3 country code, a WKT String or a path to a shapefile, a GeoPackage or a GeoJSON file
- Returns
AOI as WKT string
- Return type
WKT string
- ost.helpers.vector.exterior(infile, outfile, buffer=None)[source]¶
Creates an exterior vector of an input vector
- Parameters
infile –
outfile –
buffer –
- Returns
- ost.helpers.vector.gdf_to_json_geometry(gdf)[source]¶
Function to parse features from GeoDataFrame in such a manner that rasterio wants them
- ost.helpers.vector.geodesic_point_buffer(lon, lat, meters, envelope=False)[source]¶
- Parameters
lat –
lon –
meters –
envelope –
- Returns
- ost.helpers.vector.get_proj4(prjfile)[source]¶
Get the proj4 string from a projection file of a shapefile
- Parameters
prjfile –
- Returns
- ost.helpers.vector.latlon_to_shp(lon, lat, shapefile)[source]¶
- Parameters
lon –
lat –
shapefile –
- Returns
- ost.helpers.vector.reproject_geometry(geom, inproj4, out_epsg)[source]¶
Reproject a wkt geometry based on EPSG code
- Parameters
geom – an ogr geom object
inproj4 – a proj4 string
out_epsg – the EPSG code to which the geometry should transformed
- Returns
the transformed geometry (ogr-geometry object)
- ost.helpers.vector.shp_to_wkt(shapefile, buffer=None, convex=False, envelope=False)[source]¶
A helper function to translate a shapefile into WKT
- Parameters
shapefile –
buffer –
convex –
envelope –
- Returns