Fixed #25797 -- Fixed regex for getting units from SRS WKT.

This commit is contained in:
Sergey Fedoseev 2015-11-26 00:34:08 +05:00 committed by Tim Graham
parent b52b9cf6f2
commit 717a54c883
2 changed files with 24 additions and 23 deletions

View file

@ -21,12 +21,7 @@ class SpatialRefSysMixin(object):
# TODO: Figure out how to pull out angular units of projected coordinate system and
# fix for LOCAL_CS types. GDAL should be highly recommended for performing
# distance queries.
units_regex = re.compile(
r'.+UNIT ?\["(?P<unit_name>[\w \'\(\)]+)", ?(?P<unit>[\d\.]+)'
r'(,AUTHORITY\["(?P<unit_auth_name>[\w \'\(\)]+)",'
r'"(?P<unit_auth_val>\d+)"\])?\]([\w ]+)?(,'
r'AUTHORITY\["(?P<auth_name>[\w \'\(\)]+)","(?P<auth_val>\d+)"\])?\]$'
)
units_regex = re.compile(r'.+UNIT ?\["(?P<unit_name>[\w \.\'\(\)]+)", ?(?P<unit>[^ ,\]]+)', re.DOTALL)
@property
def srs(self):