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

psycopg2.errors.ArraySubscriptError: cannot accumulate arrays of different dimensionality #128

Open
Zaczero opened this issue Aug 20, 2023 · 4 comments
Labels
backend bug Something isn't working

Comments

@Zaczero
Copy link
Member

Zaczero commented Aug 20, 2023

JOSM export is borked for this area:
https://budynki.openstreetmap.org.pl/josm_data?filter_by=bbox&layers=buildings_to_import&xmin=16.578997439673998&ymin=50.4842215286819&xmax=16.581572360328096&ymax=50.48498866820512

[2023-08-20 06:42:39,099] ERROR in app: Exception on /josm_data [GET]
Traceback (most recent call last):
  File "/opt/gugik2osm/venv/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/gugik2osm/venv/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/opt/gugik2osm/venv/lib/python3.8/site-packages/flask_restful/__init__.py", line 467, in wrapper
    resp = resource(*args, **kwargs)
  File "/opt/gugik2osm/venv/lib/python3.8/site-packages/flask/views.py", line 83, in view
    return self.dispatch_request(*args, **kwargs)
  File "/opt/gugik2osm/venv/lib/python3.8/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/gugik2osm/app/resources/internal.py", line 135, in get
    data = objects.layers.select_data_for_layers([(layer, {'geojson_geometry': geojson_geometry_string}) for layer in selected_layers])
  File "/opt/gugik2osm/app/common/objects/layers.py", line 148, in select_data_for_layers
    data[layer.id] = layer.get_data(params)
  File "/opt/gugik2osm/app/common/objects/layers.py", line 27, in get_data
    data = db.data_from_db(self.query, geometry, row_as=dict)
  File "/opt/gugik2osm/app/common/database.py", line 124, in data_from_db
    cur.execute(query, parameters) if parameters else cur.execute(query)
  File "/opt/gugik2osm/venv/lib/python3.8/site-packages/psycopg2/extras.py", line 251, in execute
    return super(RealDictCursor, self).execute(query, vars)
psycopg2.errors.ArraySubscriptError: cannot accumulate arrays of different dimensionality
@Zaczero Zaczero added bug Something isn't working backend labels Aug 20, 2023
@Zaczero
Copy link
Member Author

Zaczero commented Aug 20, 2023

image

This building is the cause of the issue. Performing exports around it works just fine.

https://budynki.openstreetmap.org.pl/#map=19/50.4846051/16.5802849

@ttomasz
Copy link
Contributor

ttomasz commented Aug 20, 2023

Manually added the building to the list of excluded objects as a workaround.
Geometry contains some super small second part that messes up encoding.
Leaving example here for reference: https://dbfiddle.uk/Y2qY4oyy but I don't have time implement fix so we'll just stick with the workaround.

@Zaczero
Copy link
Member Author

Zaczero commented Aug 21, 2023

And here the visualization of the 2 polygons

image

image

@ttomasz
Copy link
Contributor

ttomasz commented Nov 23, 2023

#138

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

No branches or pull requests

2 participants