Skip to content

Commit 69d7913

Browse files
authored
allow https in srsName to lookup EPSG code (#8)
* Update test_get_crs_code to validate https can be in srsName * Update RE_CRS_CODE to allow https in srsName
1 parent 825a6a4 commit 69d7913

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pygml/axisorder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@
184184

185185
RE_CRS_CODE = re.compile(
186186
r'(EPSG:|'
187-
r'http://www\.opengis\.net/def/crs/epsg/0/|'
188-
r'http://www\.opengis\.net/gml/srs/epsg\.xml\#|'
187+
r'http[s]?://www\.opengis\.net/def/crs/epsg/0/|'
188+
r'http[s]?://www\.opengis\.net/gml/srs/epsg\.xml\#|'
189189
r'urn:EPSG:geographicCRS:|'
190190
r'urn:ogc:def:crs:EPSG::|'
191191
r'urn:ogc:def:crs:OGC::|'
@@ -201,6 +201,8 @@ def get_crs_code(crs: str) -> Union[int, str]:
201201
* ``EPSG:<EPSG code>``
202202
* ``http://www.opengis.net/def/crs/EPSG/0/<EPSG code>``
203203
* ``http://www.opengis.net/gml/srs/epsg.xml#<EPSG code>``
204+
* ``https://www.opengis.net/def/crs/EPSG/0/<EPSG code>``
205+
* ``https://www.opengis.net/gml/srs/epsg.xml#<EPSG code>``
204206
* ``urn:EPSG:geographicCRS:<epsg code>``
205207
* ``urn:ogc:def:crs:EPSG::<EPSG code>``
206208
* ``urn:ogc:def:crs:OGC::<EPSG code>``

tests/test_axisorder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ def test_get_crs_code():
88
assert get_crs_code('EPSG:4326') == 4326
99
assert get_crs_code('http://www.opengis.net/def/crs/EPSG/0/4326') == 4326
1010
assert get_crs_code('http://www.opengis.net/gml/srs/epsg.xml#4326') == 4326
11+
assert get_crs_code('https://www.opengis.net/def/crs/EPSG/0/4326') == 4326
12+
assert get_crs_code('https://www.opengis.net/gml/srs/epsg.xml#4326') == 4326
1113
assert get_crs_code('urn:EPSG:geographicCRS:4326') == 4326
1214
assert get_crs_code('urn:ogc:def:crs:EPSG::4326') == 4326
1315
assert get_crs_code('urn:ogc:def:crs:EPSG:4326') == 4326

0 commit comments

Comments
 (0)