Skip to content

Commit

Permalink
fix for issue pyproj4#191
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Mar 14, 2019
1 parent 7ce7476 commit 044f8fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions pyproj/_transformer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ cdef class _Transformer:
transformer.to_geographic = False
return transformer



@staticmethod
def _definition_from_object(in_proj):
"""
Expand All @@ -92,8 +90,8 @@ cdef class _Transformer:
"""
if isinstance(in_proj, Proj):
return in_proj.definition
return cstrencode(CRS.from_user_input(in_proj).to_wkt())
return cstrencode(in_proj.srs)
return cstrencode(in_proj.to_wkt())

def _transform(self, inx, iny, inz, radians):
# private function to call pj_transform
Expand Down
4 changes: 2 additions & 2 deletions pyproj/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,14 @@ def transform(p1, p2, x, y, z=None, radians=False):
>>> p2 = Proj(proj="utm",zone=10,datum='NAD27', preserve_units=False)
>>> x2, y2 = transform(p1, p2, x1, y1)
>>> "%s %s" % (str(x2)[:9],str(y2)[:9])
'1402285.9 5076292.4'
'1402291.0 5076289.5'
>>> from pyproj import CRS
>>> c1 = CRS(proj='latlong',datum='WGS84')
>>> x1 = -111.5; y1 = 45.25919444444
>>> c2 = CRS(proj="utm",zone=10,datum='NAD27')
>>> x2, y2 = transform(c1, c2, x1, y1)
>>> "%s %s" % (str(x2)[:9],str(y2)[:9])
'1402285.9 5076292.4'
'1402291.0 5076289.5'
>>> pj = Proj(init="epsg:4214")
>>> pjx, pjy = pj(116.366, 39.867)
>>> xr, yr = transform(pj, Proj(4326), pjx, pjy, radians=True)
Expand Down

0 comments on commit 044f8fa

Please sign in to comment.