Skip site navigation (1) Skip section navigation (2)

Problem loading data from Intro to Postgis

From: Tim Clark <mudiver1200(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Problem loading data from Intro to Postgis
Date: 2009-11-29 04:57:15
Message-ID: 174215.94405.qm@web36107.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
Dear List,

I just installed postgis and am trying to work through the Introduction to Postgis workhop at 
http://2007.foss4g.org/workshops/W-04/PostGIS%20Workshop.doc#_Toc177458966

I have postgis and postgresql installed on a Dell Inspiron 5150 running Windows XP.  My problem is that I can't get any data into the database.  I have gotten to page 26-27, loading shapefiles.  I have run the pg_setenv.bat file at the windows command prompt and it seems to have set up the path correctly.  I have looked in the postgresql bin directory and the proper commands are in the folder.  However, when I run the given shp2pgsql or psql commands I get an error that the command "is not recognized as an internal or external command, operable program or batch file."

I would appreciate any help or suggestions you could give to gelp me past page 27!

Thanks,

Tim



C:\postgis_workshop\data>dir
 Volume in drive C has no label.
 Volume Serial Number is 6071-6A25

 Directory of C:\postgis_workshop\data

11/28/2009  05:55 PM    <DIR>          .
11/28/2009  05:55 PM    <DIR>          ..
06/26/2007  11:15 AM            31,260 bc_border.dbf
06/26/2007  11:15 AM               170 bc_border.prj
06/26/2007  11:15 AM         1,196,124 bc_border.shp
06/26/2007  11:15 AM            41,692 bc_border.shx
06/26/2007  11:15 AM             3,298 bc_hospitals.dbf
06/26/2007  11:15 AM               431 bc_hospitals.prj
06/26/2007  11:15 AM             1,332 bc_hospitals.shp
06/26/2007  11:15 AM               452 bc_hospitals.shx
06/26/2007  11:15 AM             7,388 bc_municipality.dbf
06/26/2007  11:15 AM               431 bc_municipality.prj
06/26/2007  11:15 AM           278,184 bc_municipality.shp
06/26/2007  11:15 AM             1,396 bc_municipality.shx
06/26/2007  11:15 AM            63,193 bc_pubs.dbf
06/26/2007  11:15 AM               431 bc_pubs.prj
06/26/2007  11:15 AM            10,576 bc_pubs.shp
06/26/2007  11:15 AM             3,436 bc_pubs.shx
06/26/2007  11:15 AM         6,690,323 bc_roads.dbf
06/26/2007  11:15 AM               431 bc_roads.prj
06/26/2007  11:15 AM        19,687,612 bc_roads.shp
06/26/2007  11:15 AM         1,305,516 bc_roads.shx
06/26/2007  11:15 AM             1,544 bc_roads.sld
08/23/2007  08:01 PM         1,206,304 bc_voting_areas.dbf
06/26/2007  11:15 AM               431 bc_voting_areas.prj
08/23/2007  08:01 PM        12,586,104 bc_voting_areas.shp
08/23/2007  08:01 PM            63,988 bc_voting_areas.shx
06/26/2007  11:15 AM           532,252 cities.dbf
06/26/2007  11:15 AM               142 cities.prj
06/26/2007  11:15 AM            71,024 cities.shp
06/26/2007  11:15 AM           141,281 cities.shp.xml
06/26/2007  11:15 AM            20,364 cities.shx
06/26/2007  11:15 AM            14,551 countries.dbf
06/26/2007  11:15 AM               142 countries.prj
06/26/2007  11:15 AM         1,537,144 countries.shp
06/26/2007  11:15 AM             1,772 countries.shx
06/26/2007  11:15 AM             6,263 countries.sld
06/26/2007  11:15 AM            48,914 newyork_census.dbf
06/26/2007  11:15 AM            69,652 newyork_census.htm
06/26/2007  11:15 AM               570 newyork_census.prj
06/26/2007  11:15 AM         3,662,668 newyork_census.shp
06/26/2007  11:15 AM            17,828 newyork_census.shx
06/26/2007  11:15 AM           122,367 nnewyork_census.xml
08/22/2007  01:16 PM                55 pg_setenv.bat
08/22/2007  01:16 PM               402 pg_shpsql.bat
06/26/2007  11:15 AM               332 timezone.dbf
06/26/2007  11:15 AM               142 timezone.prj
06/26/2007  11:15 AM           466,308 timezone.shp
06/26/2007  11:15 AM           136,399 timezone.shp.xml
06/26/2007  11:15 AM               404 timezone.shx
06/26/2007  11:15 AM             1,165 timezone.sld
06/26/2007  11:15 AM         1,327,200 usa_counties.dbf
06/26/2007  11:15 AM               164 usa_counties.prj
06/26/2007  11:15 AM         1,518,248 usa_counties.shp
06/26/2007  11:15 AM            25,228 usa_counties.shx
              53 File(s)     52,905,028 bytes
               2 Dir(s)  18,336,935,936 bytes free

C:\postgis_workshop\data>pg_setenv.bat

C:\postgis_workshop\data>SET PATH="C:\Program Files\PostgreSQL\8.2\bin";C:\Progr
am Files\MiKTeX 2.7\miktex\bin;C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;
C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\MATLAB7\bin\win32;C:\PROGRA~1\AUTOSI~1.7;
C:\Program Files\QuickTime\QTSystem\

C:\postgis_workshop\data>dir *.shp
 Volume in drive C has no label.
 Volume Serial Number is 6071-6A25

 Directory of C:\postgis_workshop\data

06/26/2007  11:15 AM         1,196,124 bc_border.shp
06/26/2007  11:15 AM             1,332 bc_hospitals.shp
06/26/2007  11:15 AM           278,184 bc_municipality.shp
06/26/2007  11:15 AM            10,576 bc_pubs.shp
06/26/2007  11:15 AM        19,687,612 bc_roads.shp
08/23/2007  08:01 PM        12,586,104 bc_voting_areas.shp
06/26/2007  11:15 AM            71,024 cities.shp
06/26/2007  11:15 AM         1,537,144 countries.shp
06/26/2007  11:15 AM         3,662,668 newyork_census.shp
06/26/2007  11:15 AM           466,308 timezone.shp
06/26/2007  11:15 AM         1,518,248 usa_counties.shp
              11 File(s)     41,015,324 bytes
               0 Dir(s)  18,336,935,936 bytes free

C:\postgis_workshop\data>shp2pgsql -i -D -s 3005 bc_pubs.shp bc_pubs > bc_pubs.s
ql
'shp2pgsql' is not recognized as an internal or external command,
operable program or batch file.

C:\postgis_workshop\data>psql -U postgres -f bc_pubs.sql -d postgis
'psql' is not recognized as an internal or external command,
operable program or batch file.

C:\postgis_workshop\data>psql
'psql' is not recognized as an internal or external command,
operable program or batch file.





Tim Clark
Department of Zoology 
University of Hawaii


      

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2009-11-29 05:10:12
Subject: Re: Problem loading data from Intro to Postgis
Previous:From: Bob McConnellDate: 2009-11-28 13:19:15
Subject: Re: bytea and text

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group