[postgis-devel] problems with tiger_2010 loading
Josh Kupershmidt
schmiddy at gmail.com
Sun Dec 18 19:18:59 PST 2011
On Sun, Dec 18, 2011 at 7:29 PM, Josh Kupershmidt <schmiddy at gmail.com> wrote:
To clarify:
> Next, the script generated by a call to:
> SELECT loader_generate_script(ARRAY['DC','RI'], 'sh');
>
> has some problems. It is looking for .zip files like so:
>
> cd $STATEDIR
> for z in *.zip; do $UNZIPTOOL -o -d $TMPDIR $z; done
It is just the above line causing a problem, namely bailing out with:
unzip: cannot find or open *.zip, *.zip.zip or *.zip.ZIP.
when set -e -u is specified at the top of the script.
> Finally, after working around the above problems, I get a complaint
> about "ERROR: AddGeometryColumn() - invalid SRID" with the first call
> to shp2pgsql in the script. I haven't fixed enough things to check
> this, but it seems to me like all the calls to ${PSQL}, such as
>
> ${PSQL} -c "DROP SCHEMA tiger_staging CASCADE;"
>
> should really be honoring the $PGDATABASE variable at the top of the script.
Oh, this is not a problem; I forgot that psql will honor $PGDATABASE
as a libpq environment variable, so specifying -d ${PGDATABASE}
explicitly should not be necessary. But I am still running into the
"ERROR: AddGeometryColumn() - invalid SRID" which looks to come from
this shp2pgsql call:
${SHP2PGSQL} -c -s 4269 -g the_geom -W "latin1" tl_2010_11_state10.dbf tiger_\
staging.dc_state10 | ${PSQL} -d ${PGDATABASE}
and the above ERROR is coming from this SQL command generated:
SELECT AddGeometryColumn('tiger_staging','dc_state10','the_geom','4269','MULTIPOLYGON',2);
Josh
More information about the postgis-devel
mailing list