[gdal-dev] Dump Shapefile into DB using ogr2ogr

Ingo Weinzierl ingo.weinzierl at intevation.de
Fri Aug 19 09:05:43 EDT 2011


Thanks for the quick reply, but the "-select" option only solves one
of the two parts of my problem. I still need to append a further
column that does not exist in the shapefile and which should be
defined manually.
I already played a while with VRT files. I tried to define a <Field>
node for each column I want to insert into my database - without any
success...

Regards, Ingo

On Thu, Aug 18, 2011 at 05:00:58PM +0530, Chaitanya kumar CH wrote:
> Ingo,
> 
> Use the -select option with an empty string in ogr2ogr [1].
> ogr2ogr -select "" dest.shp src.shp
> 
> [1]: http://www.gdal.org/ogr2ogr.html
> 
> On Thu, Aug 18, 2011 at 3:53 PM, Ingo Weinzierl <
> ingo.weinzierl at intevation.de> wrote:
> 
> > Hello GDAL community,
> >
> > I have already used GDAL to get information about shapefiles or to
> > insert a shapefile into a database. So, many thanks to all of you!
> >
> > Now, I've just tried to dump a shapefile into an existing table of a
> > spatial database (PostGIS / Oracle) using ogr2ogr. Therefore, I need
> > some help:
> >
> > The only thing of the shapefile I need is the geometry column, but
> > the database schema requires a further Integer column (NOT NULL
> > constraint). In my use-case, I would like to define this Integer
> > value manually while calling ogr2ogr. Therefore, I've already
> > searched for some VRT examples, with no success.
> >
> > In simple words: I want to insert the geometry column (shapefile)
> > and an Integer value (manually defined) into a pre-defined spatial
> > database (PostGIS / Oracle).
> >
> > I would be glad if someone could give me some hints how to realize
> > such a ogr2ogr call.
> >
> > Regards, Ingo
> > --
> > Ingo Weinzierl | ++49-541-335083-0 | OpenPGP key: 0x2D2E2573
> > Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B
> > 18998
> > Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> >
> 
> 
> 
> -- 
> Best regards,
> Chaitanya kumar CH.
> 
> +91-9494447584
> 17.2416N 80.1426E

-- 
Ingo Weinzierl | ++49-541-335083-0 | OpenPGP key: 0x2D2E2573
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


More information about the gdal-dev mailing list