Skip to content

Commit

Permalink
added support for init from ITRF, Compound EPSG, & urn projection str…
Browse files Browse the repository at this point in the history
…ings
  • Loading branch information
snowman2 committed May 12, 2019
1 parent 309583a commit c9e7609
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproj/_crs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ cdef class _CRS(Base):
def __init__(self, proj_string):
# setup proj initialization string.
if not is_wkt(proj_string) \
and not re.match("^\w+:\d+$", proj_string.strip())\
and "=" in proj_string\
and "type=crs" not in proj_string:
proj_string += " +type=crs"
# initialize projection
Expand Down
15 changes: 15 additions & 0 deletions test/test_crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,3 +568,18 @@ def test_to_proj4_enum():
crs = CRS.from_epsg(4326)
assert crs.to_proj4(4) == crs.to_proj4(ProjVersion.PROJ_4)
assert crs.to_proj4(5) == crs.to_proj4(ProjVersion.PROJ_5)


def test_itrf_init():
crs = CRS("ITRF2000")
assert crs.name == "ITRF2000"


def test_compound_crs_init():
crs = CRS("EPSG:2393+5717")
assert crs.name == "KKJ / Finland Uniform Coordinate System + N60 height"


def test_compound_crs_urn_init():
crs = CRS("urn:ogc:def:crs,crs:EPSG::2393,crs:EPSG::5717")
assert crs.name == "KKJ / Finland Uniform Coordinate System + N60 height"

0 comments on commit c9e7609

Please sign in to comment.