Open garychen2002 opened 8 months ago
HI @garychen2002, thanks for reporting.
It seems like the issue is a bit different, because (according to name schemes) both urn:ogc:def:crs:EPSG::3163
and urn:ogc:def:crs:OGC:1.3:CRS84
are valid CRS definitions. Parsing EPSG codes is easy and thus implemented by us, but it seems like we could catch some more cases by replacing ::
with :.*:
in the pattern.
But in any case, I'll mark this on our to-do list.
Describe the bug
I tried to load a geojson with the crs property name of urn:ogc:def:crs:OGC:1.3:CRS84 and it did not work.
To Reproduce
Steps to reproduce the behavior:
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }
Expected behavior
The new object should be created successfully.
Environment
Python 3.11.5
Stack trace or screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
I believe the issue is related to this line where the CRS is parsed with a regex pattern: https://github.com/sentinel-hub/sentinelhub-py/blob/c7f59125b802873d28843f089ab177ebbd1d435b/sentinelhub/constants.py#L133
crs_template = re.compile(r"urn:ogc:def:crs:.+::(?P<code>.+)", re.IGNORECASE)
The end of the pattern has two colons at +:: where there should only be one.