[gdal-dev] how to use ogr to change the postgis file to shape file

Mateusz Loskot mateusz at loskot.net
Sat Apr 19 04:59:31 EDT 2008


windwxc at sina.com wrote:
> So someone tell me i can
> use ogr to transform the data from postgis to shape by code but now i
> cannot find a good example how to it .

Have you read the OGR Tutorial?

http://gdal.org/ogr/ogr_apitut.html

Also, you should complete it with reading the docs about Shapefile
and PostgreSQL providers:

http://gdal.org/ogr/drv_shapefile.html
http://gdal.org/ogr/drv_pg.html

Next, check the CSharp Wiki:

http://trac.osgeo.org/gdal/wiki/GdalOgrInCsharp

where you will find links to C# apps examples at

http://trac.osgeo.org/gdal/browser/trunk/gdal/swig/csharp/apps

Now, combine the exmaple of OGR reading/writing presented in the OGR 
Tutorial
with CSharp interface, leveraging information about how to connect to 
Shapefile/PostgreSQL
datasets to in read and write modes.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net


More information about the gdal-dev mailing list