Skip to content

Commit

Permalink
check if bound crs is geographic (issue pyproj4#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Apr 18, 2019
1 parent 37bdbd3 commit d69af25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyproj/_crs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,8 @@ cdef class _CRS(Base):
is_geographic = sub_crs.source_crs.is_geographic
else:
is_geographic = sub_crs.is_geographic
elif self.is_bound:
is_geographic = self.source_crs.is_geographic
else:
is_geographic = self._type in (
PJ_TYPE_GEOGRAPHIC_CRS,
Expand All @@ -1379,6 +1381,8 @@ cdef class _CRS(Base):
is_projected = sub_crs.source_crs.is_projected
else:
is_projected = sub_crs.is_projected
elif self.is_bound:
is_projected = self.source_crs.is_projected
else:
is_projected = self._type == PJ_TYPE_PROJECTED_CRS
return is_projected
Expand Down
6 changes: 6 additions & 0 deletions test/test_crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,12 @@ def test_ellipsoid__from_epsg__empty():
assert Ellipsoid.from_epsg(1) is None


def test_bound_crs_is_geographic():
assert CRS(
"proj=longlat datum=WGS84 no_defs ellps=WGS84 towgs84=0,0,0"
).is_geographic


# def test_coordinate_operation_towgs84():
# crs = CRS("+proj=latlong +ellps=GRS80 +towgs84=-199.87,74.79,246.62")
# assert crs.coordinate_operation.towgs84 == [-199.87, 74.79, 246.62]

0 comments on commit d69af25

Please sign in to comment.