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

Import fails on 'osm.build_nested_admin_polygons' procedure missing #347

Closed
asitemade4u opened this issue Jul 6, 2023 · 4 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@asitemade4u
Copy link

asitemade4u commented Jul 6, 2023

What version of PgOSM Flex are you using?

Last version, using docker:latest
The hash of the image is sha256:d6d41e431ded9dafb61be1efd6e178c8b9f4243556f4f0425bd7a7f719010436

Docker image

latest

What operating system, osm2pgsql, and PostgreSQL/PostGIS versions are you using?

  • Rocky Linux 8 > docker-compose, latest version
  • PostGIS 3.3.3+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 15 bullseye

What did you do exactly?

Here is the instructions I executed in the Terminal of the host (I obfuscated the user and the password for security reasons).
Also, I have downloaded the osm.pbf file for the State of NY.

docker exec -it \
    -e POSTGRES_USER=<my_user> \
    -e POSTGRES_PASSWORD=<my_password> \
    -e POSTGRES_HOST=192.168.1.14 \
    -e POSTGRES_DB=gis \
    -e POSTGRES_PORT=5432 \
    pgo python3 docker/pgosm_flex.py \
    --ram=20 \
    --region=north-america/us \
    --subregion=new-york \
    --input-file=/mnt/pbf/nys.pbf \
    --layerset=parks \
    --force \
    --language=en

Lastly, here is the personalized layerset I am applying (parks.ini):

[layerset]
amenity=false
building_combined_point=false
building=false
indoor=false
infrastructure=false
landuse=true
leisure=false
natural=true
place=false
poi_combined_point=false
poi=false
public_transport=false
road_major=false
road=false
shop_combined_point=false
shop=false
tags=true
traffic=false
unitable=false
water=false

What did you expect to happen?

It to work ;o))
More seriously, to download the Parks in NYS.

What did happen instead?

I got an error on nested polygons:

2023-07-06 10:40:06,042:INFO:pgosm-flex:pgosm_flex:Calculating nested polygons
2023-07-06 10:40:06,042:INFO:pgosm-flex:db:Building nested polygons... (this can take a while)
2023-07-06 10:40:06,075:INFO:pgosm-flex:db:Nested polygon output: 
 ERROR:  procedure osm.build_nested_admin_polygons() does not exist
LINE 1: CALL osm.build_nested_admin_polygons();
             ^
HINT:  No procedure matches the given name and argument types. You might need to add explicit type casts.

I have a hunch (as the log says) that the procedure osm.build_nested_admin_polygons is just missing.

What did you do to try analyzing the problem?

Read the logs.

@rustprooflabs
Copy link
Owner

Hi @asitemade4u - Thank you for reporting this! This is a bug, sorry!

This issue affects any layersets that do not define place=true to include the function definition. To work around with current versions, try adding --skip-nested to your docker exec command. That should bypass the failing query. At least, it works in my quick test!

Source of the issue

The logic here is responsible for skipping the function call when necessary, apparently it's not working. It appears like it's trying to check for and avoid this issue (see here and here) but somehow it's not working as expected.

@rustprooflabs rustprooflabs added this to the 0.9.1 milestone Jul 11, 2023
@rustprooflabs rustprooflabs added the bug Something isn't working label Jul 11, 2023
@rustprooflabs
Copy link
Owner

On a closer look I think I got it a bit wrong in my prior comment.

This affects layersets that define place=false. Omitting the place layer from the .ini file appears to succeed without requiring the --skip-nested workaround. Looks like this logic is being evaluated improperly.

@rustprooflabs
Copy link
Owner

This is fixed in main, just pushed an updated latest Docker image. This should fix your issue @asitemade4u!

@asitemade4u
Copy link
Author

THANKS!

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

No branches or pull requests

2 participants