[Gdal-dev] problem with ogr2ogr -f PostgreSQL...

Thom DeCarlo t.r.decarlo at larc.nasa.gov
Thu Mar 9 12:18:51 EST 2006


Ethan,
So... if I have a shapefile that uses a latlong/WGS84 projection whose EPSG
is 4326, then I use "shp2pgsql -s 4326 ...."?

Oh, goody.... another email list. I think that will make an even dozen. 

Thanks,
Thom

OBTW, Frank... did you see my comment that the postgresql driver
documentation page has a mistake in it?

--
Thom DeCarlo
---------------------------------------------------------
      Given sufficient time and money, all things are possible.
  In lieu of time and money, caffeine and aspirin may also work.


> -----Original Message-----
> From: Ethan Alpert
> Sent: Wednesday, March 08, 2006 4:02 PM
> To: Thom DeCarlo; gdal-dev at lists.maptools.org
> Subject: RE: [Gdal-dev] problem with ogr2ogr -f PostgreSQL...
> 
> 
> 
> SRID == Spatial Reference ID
> 
> It defines the coordinate system and projection of your data. Once you
> get to the mapserver part you'll really need to understand it to get
> maps displayed or to do spatial operations on your data like intersect,
> etc...
> 
> There is a mapserver user list: MAPSERVER-USERS at LISTS.UMN.EDU
> 
> -e
> 
> -----Original Message-----
> From: Thom DeCarlo
> Sent: Wednesday, March 08, 2006 1:32 PM
> To: gdal-dev at lists.maptools.org
> Subject: RE: [Gdal-dev] problem with ogr2ogr -f PostgreSQL...
> 
> Ethan (and everybody else...),
> It looks like you folks have already hashed out all of my problems. ;-)
> I
> think the *real* problem is that I'm trying to learn SQL, PostgreSQL,
> PostGIS, MapServer, and Apache all in one swell foop.
> 
> That said... I was trying to load the shapefiles into a PostgreSQL
> database
> using the ogr2ogr command. I was blindly following the examples given on
> the
> PostgreSQL page of the gdal.org site.
> (http://www.gdal.org/ogr/drv_pg.html)
> The example there says:
> 
> % ogr2ogr -f PostgreSQL PG:dbname=warmerda tiger_michigan \
>      -lco OVERWRITE=yes CompleteChain
> % ogr2ogr -update -append -f PostgreSQL PG:dbname=warmerda tiger_ohio \
>      CompleteChain
> 
> Unfortunately, as you show in your example, the commands should actually
> look like this:
> 
> % ogr2ogr -f PostgreSQL PG:dbname=warmerda tiger_michigan \
>      -lco OVERWRITE=yes -nln CompleteChain
>                         ^^^^
> % ogr2ogr -update -append -f PostgreSQL PG:dbname=warmerda tiger_ohio \
>      -nln CompleteChain
>      ^^^^
> 
> When I add the "-nln" the new lay is properly created and appended. This
> error is duplicated on the PostGIS OGR Wiki page
> http://postgis.refractions.net/support/wiki/index.php?OGR%20Examples
> 
> Now if I can just figure out what you mean by that "SRID" thingy....
> 
> Thom
> 
> --
> Thom DeCarlo
> -------------------------------------------------------
>      That Which Does Not Kill Me
>        Can Still Hurt Really Bad.
> 
> > -----Original Message-----
> > From: Ethan Alpert
> > Sent: Tuesday, March 07, 2006 5:55 PM
> > To: Thom DeCarlo; gdal-dev at lists.maptools.org
> > Subject: RE: [Gdal-dev] problem with ogr2ogr -f PostgreSQL...
> >
> >
> > Are you trying to load the shapefiles? If so post your command line.
> >
> >
> > Should be something like:
> >
> > Ogr2ogr -f PostgresSQL "PG:dbname=<dbname>" your_shapefile.shp -nln
> > layer
> >
> > There are many creation options -lco's you may want to use but it
> would
> > be helpful to know what command line you used as well as what version
> of
> > GDAL.
> >
> > One important thing is to makesure you have granted your database user
> > permissions to modify the postgis geometry_columns table. But you'd
> get
> > an error if that happened.
> >
> > -e
> >
> > -----Original Message-----
> > From: Thom DeCarlo
> > Sent: Tuesday, March 07, 2006 3:22 PM
> > To: gdal-dev at lists.maptools.org
> > Subject: [Gdal-dev] problem with ogr2ogr -f PostgreSQL...
> >
> > I've set up my PostGIS-enabled PostgreSQL database and created a
> dataset
> > called "spatial". I have several shapefiles that I want to load into a
> > single layer. I found the instructions on the gdal website but when I
> > specify a layername at the end of the ogr2ogr command it quietly
> fails.
> > That
> > is, no messages of any kind either at the command line nor in the
> pgsql
> > logfile. If I don't specify a layername the command works just fine.
> >
> > Are there known problems with this function? I'm using PostGIS 1.1.0
> and
> > PostgreSQL 8.1.1 on RHEL3.
> >
> > Thanks,
> > Thom
> >
> > --
> > Thom DeCarlo
> > -------------------------------------------------------
> >              Who is General Failure
> >          and why is he reading my disk?
> >
> >





More information about the Gdal-dev mailing list