EO-College / tomography_tutorial

A tutorial for Synthetic Aperture Radar Tomography
GNU General Public License v3.0
110 stars 40 forks source link

GeoViewer #4

Closed njw2023 closed 1 year ago

njw2023 commented 1 year ago

Hi dear John There is a program error in epsg = int(srs.GetAuthorityCode(None)) which TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'. I don't know why it went wrong. Please help me,Thanks a lot. Best regards, Frank

johntruckenbrodt commented 1 year ago

Hi @njw2023. This kind of error might occur if the CRS does not have an EPSG representation. What is the CRS of your input data? Here is a reproducible independent example:

from osgeo import osr
srs = osr.SpatialReference()
srs.SetFromUserInput('EPSG:4326')
srs.AutoIdentifyEPSG()
code = int(srs.GetAuthorityCode(None))
print(code)

See here for a more comprehensive function for converting between different CRS representations: https://spatialist.readthedocs.io/en/latest/spatialist.html#spatialist.auxil.crsConvert

njw2023 commented 1 year ago

Thanks for that piece of advice!That solved my issue.

johntruckenbrodt commented 1 year ago

You're welcome