-
Notifications
You must be signed in to change notification settings - Fork 66
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
Lots of Shapefile SQL Errors #58
Comments
The (now updated) readme was missing a note to download the GDA94 Shapefile version of the Admin Bdys (not the GDA2020 ones)! Please try again with the GDA94 files |
I downloaded the GDA94 files, but the same errors are coming up. |
Odd error! A couple of things to check:
|
Yep. Both of those things have been done. |
One more thing to double check - have you got the latest code? The August 2021 release PR was this morning, Sydney time, and there have been a couple of significant changes to the data (thanks Geoscape!) Other than that - can you please share the full log with me and also the command line you're using to run it |
Ok, my original hunch was right. The mass of errors is due to a locked transaction from the first failure. I added the "-e" flag to the shp2pgsql command to treat each command individually, and not as part of a transaction. After this was done most of the imports went smoothly, except for the one error for each state because of a missing column.
|
Interesting - the code should import SHP files of the same layer (e.g town points) sequentially, so PG shouldn't be locking the table. I'll go with it being a knock-on effect from the 1st failure... but could be the code isn't doing that... A couple of more avenues to investigate re: the initial error:
|
The error file for error_debug_ACT_TOWN_POINT_shp.shp.sql is
The table exists, but is missing the geom column. |
Ok, so shp2pgsql worked, but the table missing the geom field is very strange... I'm short of ideas right now as I've run this multiple times over the last few days on 2 Macs without that issue; and it hasn't come up in the last 3-4 years. I can't see why CentOS would be any different. Linux != Unix, but close enough... A corrupt PostGIS install maybe?! Can you double check this SQL works in your DB:
|
Yep. That SQL works fine. Here's the dump of the table schema.
I'm not sure I understand where the table schemas come from. |
The table is created by the first state to be loaded for each layer. So Another test! - uncomment line 379 in load-gnaf.py ( There should be no .dbf files for layers that have a .shp file. BTW - I had thought about refactoring the Shapefile load to use SHP > GeoPandas > PG, now I'm wishing I had :-) |
I can see the problem.... This file is processed first -
Then this file comes afterwards -
The dbf file creates the table, but this does not create the geom column. When the shp file is appended, it will crash. So the problem is that a .dbf file exists for the aus_town_point table. |
Yes. The order seems to be wrong. TAS_GCCSA_2011_POLYGON_shp.dbf |
Cool, we've got the problem nailed down. Curious that the behaviour is different between operating systems, but not as important as finding a universal fix... I've just updated the code to filter out |
I've been trying to load this datbase today, but I'm getting odd errors that I'm not sure about.
This is running on Centos 7 with Python 3.8.6 with Psycopg2 2.8.4 and Postgres 13.4 on x86_64-pc-linux-gnu and PostGIS 3.1.3 (with GEOS 3.9.1-CAPI-1.14.2).
I've downloaded the Geoscape Admin Boundaries - ESRI Shapefile - GDA2020(ZIP) file, which I'm hoping is the correct one.
The first error is
This is true. The "geom" column does not exist in the table.
Then we launch into an awful lot of these errors.
Is this because of that first error?
The text was updated successfully, but these errors were encountered: