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

Klaida su skirtingais bbox parametrais geometry summary endpointe #523

Closed
sirex opened this issue Oct 17, 2023 · 1 comment · Fixed by #524
Closed

Klaida su skirtingais bbox parametrais geometry summary endpointe #523

sirex opened this issue Oct 17, 2023 · 1 comment · Fixed by #524
Labels
bug Something isn't working U2 Užsakymo indeksas

Comments

@sirex
Copy link
Collaborator

sirex commented Oct 17, 2023

https://test.data.gov.lt/datasets/1906/models/MeteorologineAikstele/koord/

Patraukus žemėlapį į šoną, dingsta pinai.

Čia spintos pusėje su šiuo modeliu, naudojant bbox atributą gaunama klaida, pvz.:
https://get.data.gov.lt/datasets/gov/lhmt/klimatologija/MeteorologineAikstele/:summary/koord?bbox(0,0,180,180)
image

Taip pat visur bbox neveikia panaudojus neigiamą koordinatę:
https://get.data.gov.lt/datasets/gov/lhmt/klimatologija/MeteorologineAikstele/:summary/koord?bbox(-10,0,180,180)
image

Originally posted by @adp-atea in atviriduomenys/katalogas#339 (comment)

Serverio loguose randu:

[ERROR] Exception in ASGI application
Traceback (most recent call last):
  File "sqlalchemy/engine/base.py", line 1705, in _execute_context
    self.dialect.do_execute(
  File "sqlalchemy/engine/default.py", line 716, in do_execute
    cursor.execute(statement, parameters)
psycopg2.errors.InternalError_: Operation on mixed SRID geometries
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "spinta/api.py", line 95, in homepage
    return await create_http_response(context, params, request)
  File "spinta/utils/response.py", line 139, in create_http_response
    return await commands.summary(
  File "spinta/commands/read.py", line 455, in summary
    return render(context, request, model, params, rows, action=action)
  File "spinta/renderer.py", line 23, in render
    return commands.render(
  File "spinta/formats/json/commands.py", line 25, in render
    return _render(
  File "spinta/formats/json/commands.py", line 52, in _render
    aiter(peek_and_stream(fmt(data))),
  File "spinta/utils/response.py", line 232, in peek_and_stream
    peek = list(itertools.islice(stream, 2))
  File "spinta/formats/json/components.py", line 19, in __call__
    for i, row in enumerate(data):
  File "spinta/backends/postgresql/commands/summary.py", line 441, in summary
    count_exec = connection.execute(f'SELECT COUNT(DISTINCT "{prop}") FROM "{model}" {bounding_box}')
  File "sqlalchemy/engine/base.py", line 1185, in execute
    return self._exec_driver_sql(
  File "sqlalchemy/engine/base.py", line 1484, in _exec_driver_sql
    ret = self._execute_context(
  File "sqlalchemy/engine/base.py", line 1748, in _execute_context
    self._handle_dbapi_exception(
  File "sqlalchemy/engine/base.py", line 1929, in _handle_dbapi_exception
    util.raise_(
  File "sqlalchemy/util/compat.py", line 211, in raise_
    raise exception
  File "sqlalchemy/engine/base.py", line 1705, in _execute_context
    self.dialect.do_execute(
  File "sqlalchemy/engine/default.py", line 716, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.InternalError: (psycopg2.errors.InternalError_) Operation on mixed SRID geometries
SQL:
   SELECT COUNT(DISTINCT "koord")
   FROM "datasets/gov/lhmt/klimatologija/MeteorologineAikstele"
   WHERE ST_Intersects("koord", ST_MakeEnvelope(0, 0, 180, 180, 4326))
@sirex sirex added the bug Something isn't working label Oct 17, 2023
@sirex sirex transferred this issue from atviriduomenys/katalogas Oct 17, 2023
@sirex
Copy link
Collaborator Author

sirex commented Oct 17, 2023

Dubliuoja #520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working U2 Užsakymo indeksas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants