Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get function no longer working #22

Open
jgutierrezm113 opened this issue Aug 2, 2022 · 5 comments
Open

Get function no longer working #22

jgutierrezm113 opened this issue Aug 2, 2022 · 5 comments

Comments

@jgutierrezm113
Copy link

It seems like there has been a recent change to epsg.io web page where now the gml return is no longer supported from the URL request, so the get function is broken when it tries to convert the request from the string into an XML. Is there any expected update to the library or was the update to the epsg web page a bug?

@MBennGit
Copy link

MBennGit commented Aug 3, 2022

I created an issue here: maptiler/epsg.io#185

@j08lue
Copy link

j08lue commented Aug 3, 2022

Steps to reproduce and traceback:

Python 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:39:48)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyepsg
>>> pyepsg.get(21781)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ferguson/.conda/envs/s1coh-pyrosar/lib/python3.9/site-packages/pyepsg.py", line 288, in get
    root = ET.fromstring(xml)
  File "/home/ferguson/.conda/envs/s1coh-pyrosar/lib/python3.9/xml/etree/ElementTree.py", line 1347, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0

@aleksandaratanasov
Copy link

aleksandaratanasov commented Sep 6, 2024

Project is dead. Issue still present in 2024, while last version is 6 years old. The inability to use get() renders pyepsg practically useless. If you have the free space, just go with osgeo with its gdal submodule. Sadly, that alternative requires a local binary installation of GDAL (the PyPl package is just the wrapper for it), which some people may have a problem with (easy to tackle in virtual env such as the one from Anaconda though).

@j08lue
Copy link

j08lue commented Sep 6, 2024

Like Cartopy, you should probably use pyproj instead

from pyproj import CRS
crs = CRS.from_epsg(21781)

Or, if you are using the the CRS with Rasterio anyways, you might as well

from rasterio.crs import CRS
crs = CRS.from_epsg(21781)

Is there functionality of pyepsg that you are missing in either of the two, @aleksandaratanasov?

@aleksandaratanasov
Copy link

Like Cartopy, you should probably use pyproj instead

from pyproj import CRS
crs = CRS.from_epsg(21781)

Or, if you are using the the CRS with Rasterio anyways, you might as well

from rasterio.crs import CRS
crs = CRS.from_epsg(21781)

Is there functionality of pyepsg that you are missing in either of the two, @aleksandaratanasov?

Thanks for the tip.

I completely switched to GDAL due to other project requirements. The big drawback (compared to the two you have posted) is how clunky the Python API of GDAL is (imho).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants