geoutils.projtools
GeoUtils.projtools provides a toolset for dealing with different coordinate reference systems (CRS).
Contents
Functions
bounds2poly
- geoutils.projtools.bounds2poly(boundsGeom, in_crs=None, out_crs=None)[source]
Converts self’s bounds into a shapely Polygon. Optionally, returns it into a different CRS.
- Parameters
boundsGeom – A geometry with bounds. Can be either a list of coordinates (xmin, ymin, xmax, ymax), a rasterio/Raster object, a geoPandas/Vector object
in_crs – Input CRS
out_crs – Output CRS
- Returns
Output polygon
compare_proj
merge_bounds
- geoutils.projtools.merge_bounds(bounds_list, merging_algorithm='union')[source]
Merge a list of bounds into single bounds, using either the union or intersection.
- Parameters
bounds_list – A list of geometries with bounds, i.e. a list of coordinates (xmin, ymin, xmax, ymax), a rasterio/Raster object, a geoPandas/Vector object.
merging_algorithm – the algorithm to use for merging, either “union” or “intersection”
- Returns
Output bounds (xmin, ymin, xmax, ymax)
reproject_from_latlon
- geoutils.projtools.reproject_from_latlon(pts, out_crs, round_=2)[source]
Reproject a set of point from lat/lon to out_crs.
- Parameters
pts – Input points to be reprojected. Must be of shape (2, N), i.e (x coords, y coords)
out_crs – Output CRS
round – Output rounding. Default of 2 ensures cm accuracy
- Returns
Reprojected points, of same shape as pts.
reproject_points
- geoutils.projtools.reproject_points(pts, in_crs, out_crs)[source]
Reproject a set of point from input_crs to output_crs.
- Parameters
pts – Input points to be reprojected. Must be of shape (2, N), i.e (x coords, y coords)
in_crs – Input CRS
out_crs – Output CRS
- Returns
Reprojected points, of same shape as pts.
reproject_shape
reproject_to_latlon
- geoutils.projtools.reproject_to_latlon(pts, in_crs, round_=8)[source]
Reproject a set of point from in_crs to lat/lon.
- Parameters
pts – Input points to be reprojected. Must be of shape (2, N), i.e (x coords, y coords)
in_crs – Input CRS
round – Output rounding. Default of 8 ensures cm accuracy
- Returns
Reprojected points, of same shape as pts.