diff options
| author | Nyall Dawson <nyall.dawson@gmail.com> | 2021-11-16 16:16:10 +1000 |
|---|---|---|
| committer | Nyall Dawson <nyall.dawson@gmail.com> | 2021-11-16 16:26:27 +1000 |
| commit | d72a09d2c39e03e3955983f709420d9bf8ff7098 (patch) | |
| tree | 120b0c81b78de9c15b0c01f965b79913c37a234f /scripts | |
| parent | d980257b8e3f5180f346fbb7c4c273bbacca0cc9 (diff) | |
| download | PROJ-d72a09d2c39e03e3955983f709420d9bf8ff7098.tar.gz PROJ-d72a09d2c39e03e3955983f709420d9bf8ff7098.zip | |
When matching conversions from ESRI db, keep searching if we find
a deprecated conversion for a non-deprecated CRS
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/build_db_from_esri.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/build_db_from_esri.py b/scripts/build_db_from_esri.py index 82bb196a..5637c995 100755 --- a/scripts/build_db_from_esri.py +++ b/scripts/build_db_from_esri.py @@ -1027,7 +1027,7 @@ def import_projcs(): conv_name = esri_name + " (Gauss Kruger)" cursor.execute( - """SELECT code FROM conversion WHERE auth_name = 'EPSG' AND + """SELECT code, deprecated FROM conversion WHERE auth_name = 'EPSG' AND method_code = '9807' AND param1_code = '8801' AND param1_value = ? AND param1_uom_code = ? AND param2_code = '8802' AND param2_value = ? AND param2_uom_code = ? AND @@ -1046,6 +1046,20 @@ def import_projcs(): if conv_name == 'unnamed' and src_row: conv_auth_name = 'EPSG' conv_code = src_row[0] + conv_is_deprecated = bool(src_row[1]) + while not deprecated and conv_is_deprecated: + # if we found a deprecated conversion but the CRS isn't deprecated, keep looking... + src_row = cursor.fetchone() + if not src_row: + break + + conv_code = src_row[0] + conv_is_deprecated = bool(src_row[1]) + + if conv_is_deprecated and not deprecated: + # if conversion is marked as deprecated, we have to deprecate the CRS also + print('Flagging ESRI:{} ({}) as deprecated because conversion EPSG:{} is deprecated'.format(code, esri_name, conv_code)) + deprecated = True else: conv_auth_name = 'ESRI' conv_code = code |
