minus34 / gnaf-loader

A quick way to get started with Geoscape's open GNAF & Admin Boundaries
Apache License 2.0
182 stars 66 forks source link

raw_admin_bdys_201702.XYZ does not exist #23

Closed mithold closed 6 years ago

mithold commented 7 years ago

Hi Minus34,

Are you able to nudge me in the right direction? I keep getting errors like this -

relation "raw_admin_bdys_201702.aus_state" does not exist relation "raw_admin_bdys_201702.aus_lga" does not exist relation "raw_admin_bdys_201702.aus_ward" does not exist

The script keeps running but eventually dies completely with

Traceback (most recent call last): File "load-gnaf.py", line 953, in if main(): File "load-gnaf.py", line 99, in main create_reference_tables(pg_cur, settings) File "load-gnaf.py", line 650, in create_reference_tables pg_cur.execute(psma.open_sql_file("03-10-reference-split-melbourne.sql", settings)) psycopg2.ProgrammingError: relation "admin_bdys_201702.locality_bdys" does not exist LINE 14: FROM admin_bdys_201702.locality_bdys AS bdy

After it dies the DB looks like this - capture

Im running the script like this: python load-gnaf.py --gnaf-tables-path="C:\GNAF\FEB17 GNAF PipeSeperatedValue\GNAF\G-NAF FEBRUARY 2017" --admin-bdys-path="C:\GNAF\feb17adminboundsesrishapefileordbffile\FEB17_AdminBounds_ESRIShapefileorDBFfile" --pgdb="GNAF" --pguser="postgres" --pgpassword="postgres" f1 f2

I have added the postgre bin folder to PATH variable. I've confirmed that both shp2pgsql and psql run in command line.

My machine -

Windows 10 Postgres 9.5.0 and PostGIS 2.2.1 Python 3.6.1

Full log file attached. load-gnaf.log.txt

Much appreciated.

minus34 commented 7 years ago

There was an issue on Windows importing Shapefiles. That process has been hardened. Can you grab the latest code and try again.

andrewharvey commented 6 years ago

I ran into the same error at the end, but I'm fairly sure it's due to a different issue based on comparing your log file to mine.

My issue was on ubuntu I had the postgresql-9.6 and postgresql-9.6-postgis-2.3 packages but I didn't have the postgis package to provide shp2pgsql.

minus34 commented 6 years ago

I haven't been able to replicate on macOS since the fix. Also, I haven't tried Ubuntu.

FYI - this is my PostGIS install script for Ubuntu (for census-loader):

install Postgres

sudo add-apt-repository -y "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y update sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y install postgresql-9.6 sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y install postgresql-9.6-postgis-2.3 postgresql-contrib-9.6 sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y install postgis

In case you hadn't come across the issue before - the last line, which seems unnecessary, installs shp2pgsql.

minus34 commented 6 years ago

Closing as original issue fixed