Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alan D. Snow <[email protected]>
  • Loading branch information
Kirill888 and snowman2 committed Jan 19, 2024
1 parent eef18db commit d2a1305
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rioxarray/rioxarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,9 +1248,9 @@ def get_gcps(self) -> Optional[list[GroundControlPoint]]:
except (KeyError, AttributeError):
return None

def parse_gcp(gcp) -> GroundControlPoint:
def _parse_gcp(gcp) -> GroundControlPoint:
x, y, *z = gcp["geometry"]["coordinates"]
z = z[0] if len(z) > 0 else None
z = z[0] if z else None
return GroundControlPoint(
x=x,
y=y,
Expand All @@ -1261,7 +1261,7 @@ def parse_gcp(gcp) -> GroundControlPoint:
info=gcp["properties"]["info"],
)

gcps = [parse_gcp(gcp) for gcp in geojson_gcps["features"]]
gcps = [_parse_gcp(gcp) for gcp in geojson_gcps["features"]]
return gcps


Expand All @@ -1280,7 +1280,7 @@ def _convert_gcps_to_geojson(
A FeatureCollection dict.
"""

def gcp_coordinates(gcp):
def _gcp_coordinates(gcp):
if gcp.z is None:
return [gcp.x, gcp.y]
return [gcp.x, gcp.y, gcp.z]
Expand All @@ -1294,7 +1294,7 @@ def gcp_coordinates(gcp):
"row": gcp.row,
"col": gcp.col,
},
"geometry": {"type": "Point", "coordinates": gcp_coordinates(gcp)},
"geometry": {"type": "Point", "coordinates": _gcp_coordinates(gcp)},
}
for gcp in gcps
]
Expand Down

0 comments on commit d2a1305

Please sign in to comment.