You can use shp2text:

http://www.obviously.com/gis/shp2text/

It won't output the insert statements directly but it will create a tab
delimited file that you could then parse into your database.



Aleksey Naumov wrote:
> Dear GDAL users,
> 
> Is there a way to use ogr2ogr or other means to convert a layer (e.g. a
> shapefile) into an SQL text file suitable for insertion into PostGIS? In
> other words, a file with SQL text like:
> 
> INSERT INTO "my_table" ("the_geom" ) VALUES
> (GeomFromEWKT('SRID=-1;POLYGON (( ...))'::TEXT) );
> 
> which could be read into PostgreSQL later. Ideally, I am looking for a
> direct conversion, i.e. not involving PostGIS.
> 
> Thank you,
> Aleksey
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gdal-dev mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to