geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
460 stars 250 forks source link

`get_collection_items` fails due to usage of @staticmethod #1652

Closed Moritz-Langer closed 1 month ago

Moritz-Langer commented 1 month ago

Description A call to get_collection_items leads to call of static_method create_crs_transform_spec which is just a function leading to TypeError: 'staticmethod' object is not callable.

Steps to Reproduce Steps to reproduce the behavior: Use latest Master and request features of a collection. Request the following: curl "$PYGEOAPI_URL/collections/collection_name/items"

Expected behavior GeoJSON with results

Screenshots/Tracebacks

[2024-05-13T11:11:35Z] {/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/werkzeug/_internal.py:96} INFO - 127.0.0.1 - - [13/May/2024 11:11:35] "GET /collections/afz_yyyy/items HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/flask/app.py", line 1498, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/flask/app.py", line 1476, in wsgi_app
    response = self.handle_exception(e)
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/flask_cors/extension.py", line 178, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/flask_cors/extension.py", line 178, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/pygeoapi/flask_app.py", line 283, in collection_items
    return execute_from_flask(itemtypes_api.get_collection_items,
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/pygeoapi/flask_app.py", line 160, in execute_from_flask
    headers, status, content = api_function(api_, api_request, *args)
  File "/home/xlanger/pygeoapi_0_17_dev/pygeoapi_0_17/lib64/python3.9/site-packages/pygeoapi/api/itemtypes.py", line 332, in get_collection_items
    crs_transform_spec = create_crs_transform_spec(
TypeError: 'staticmethod' object is not callable

Environment

Additional context In order to fix the issue remove lines: https://github.com/geopython/pygeoapi/blob/fd928618569abca898967f992359cdbf678c476f/pygeoapi/api/itemtypes.py#L1185 and https://github.com/geopython/pygeoapi/blob/fd928618569abca898967f992359cdbf678c476f/pygeoapi/api/itemtypes.py#L1248