Commit 951cea46 authored by Nicolas Garcia Ospina's avatar Nicolas Garcia Ospina
Browse files

Defined aea as crs input

parent f056be07
Pipeline #24291 passed with stage
in 4 minutes and 22 seconds
...@@ -153,7 +153,7 @@ class TileProcessor: ...@@ -153,7 +153,7 @@ class TileProcessor:
def reproject_polygon(input_polygon, input_crs, target_crs): def reproject_polygon(input_polygon, input_crs, target_crs):
""" """
Returns a (multi)polygon object transformed from input_crs to target_crs. if Returns a (multi)polygon object transformed from input_crs to target_crs. if
"albers" is specified as target crs, returns the Albers equal area transformed "aea" is specified as target crs, returns the Albers equal area transformed
polygon. polygon.
More information on the Albers equal area can be found at: More information on the Albers equal area can be found at:
...@@ -164,14 +164,14 @@ class TileProcessor: ...@@ -164,14 +164,14 @@ class TileProcessor:
input_crs (str): Initial crs of the input_polygon (e.g. "epsg:4326"). input_crs (str): Initial crs of the input_polygon (e.g. "epsg:4326").
target_crs (str): Target crs for the final polygon object. If "albers" is target_crs (str): Target crs for the final polygon object. If "aea" is
specified, process the complete Albers equal area transformation. specified, process the complete Albers equal area transformation.
Returns: Returns:
geometry (shapely.geometry.polygon.Polygon): Polygon object reprojected to geometry (shapely.geometry.polygon.Polygon): Polygon object reprojected to
target_crs. target_crs.
""" """
if target_crs == "albers": if target_crs == "aea":
project = pyproj.Transformer.from_proj( project = pyproj.Transformer.from_proj(
pyproj.Proj(input_crs), pyproj.Proj(input_crs),
pyproj.Proj("epsg:4326"), pyproj.Proj("epsg:4326"),
...@@ -267,7 +267,7 @@ class TileProcessor: ...@@ -267,7 +267,7 @@ class TileProcessor:
Albers equal area system. Albers equal area system.
""" """
polygon = TileProcessor.reproject_polygon(input_polygon, polygon_crs, "albers") polygon = TileProcessor.reproject_polygon(input_polygon, polygon_crs, "aea")
return polygon.area return polygon.area
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment