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

pygeoif 1.0.0 is not compatible with pygeofilter 0.1.2, needs to be pinned to an earlier version #57

Closed
philvarner opened this issue Sep 30, 2022 · 5 comments · Fixed by #56

Comments

@philvarner
Copy link

pygeoif released v 1.0.0 on Sept 22 2022, which is the first release since 0.7 in 2017 (!).

pygeoif is unpinned in pygeofilter, so the latest version 1.0.0 is pulled, even though it's not compatible.

stac-fastapi gets this failure when trying to import the cql2 converters:

File "/app/stac_fastapi/pgstac/stac_fastapi/pgstac/core.py", line 13, in
from pygeofilter.backends.cql2_json import to_cql2
File "/usr/local/lib/python3.8/site-packages/pygeofilter/backends/cql2_json/init.py", line 1, in
from .evaluate import to_cql2
File "/usr/local/lib/python3.8/site-packages/pygeofilter/backends/cql2_json/evaluate.py", line 32, in
from ..evaluator import Evaluator, handle
File "/usr/local/lib/python3.8/site-packages/pygeofilter/backends/evaluator.py", line 31, in
from .. import ast
File "/usr/local/lib/python3.8/site-packages/pygeofilter/ast.py", line 32, in
from . import values
File "/usr/local/lib/python3.8/site-packages/pygeofilter/values.py", line 33, in
from pygeoif.geometry import as_shape
ImportError: cannot import name 'as_shape' from 'pygeoif.geometry' (/usr/local/lib/python3.8/site-packages/pygeoif/geometry.py)

The in stac-fastapi was to pin it to 0.7 in setup.py

    "pygeoif==0.7",

Related issues:

@KoalaGeo
Copy link

Same error in our branch of pygeoapi - https://github.com/BritishGeologicalSurvey/pygeoapi/tree/pygeofilter-sqlalchemy

File "/pygeoapi/pygeoapi/provider/postgresql.py", line 60, in <module>
  from pygeofilter.backends.sqlalchemy.evaluate import to_filter
File "/usr/local/lib/python3.8/dist-packages/pygeofilter/backends/sqlalchemy/__init__.py", line 1, in <module>
  from .evaluate import to_filter
File "/usr/local/lib/python3.8/dist-packages/pygeofilter/backends/sqlalchemy/evaluate.py", line 4, in <module>
  from . import filters
File "/usr/local/lib/python3.8/dist-packages/pygeofilter/backends/sqlalchemy/filters.py", line 8, in <module>
  from pygeoif.geometry import as_shape
ImportError: cannot import name 'as_shape' from 'pygeoif.geometry' (/usr/local/lib/python3.8/dist-packages/pygeoif/geometry.py)
ERROR: openapi.yml could not be generated ERROR

@landryb
Copy link

landryb commented Dec 19, 2022

@tomkralidis: hi, should this be reopened since #56 was reverted in 1f187c0 ?

bob-beck pushed a commit to openbsd/ports that referenced this issue Dec 19, 2022
PyGeoIf provides a GeoJSON-like protocol for geo-spatial (GIS) vector data.

You may think of pygeoif as a shapely ultralight which lets you
construct geometries and perform very basic operations like reading and
writing geometries from/to WKT, constructing line strings out of points,
polygons from linear rings, multi polygons from polygons, etc. It was
inspired by shapely and implements the geometries in a way that when you
are familiar with shapely you feel right at home with pygeoif.

Not porting 1.0.0 since pygeofilter isnt compatible with it yet, cf
geopython/pygeofilter#57

ok sthen@
@tomkralidis
Copy link
Member

@landryb AFAICT pygeoif is now pinned to 0.7 in main branch (which is the solution put forth in this ticket)?

@landryb
Copy link

landryb commented Dec 23, 2022

sure, its just that the way forward would still be compatibility with 1.0.0.. or reopen #56 ?

@tomkralidis
Copy link
Member

See #64

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

Successfully merging a pull request may close this issue.

4 participants