Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to generate contours with gdal_contour command. It generates an output as shapefile by default. I want this utility to output a postgresql (postgis) table.

The documentation says there is a -f option, but I couldn't find any examples on specifying a format. http://www.gdal.org/gdal_contour.html

Can anyone provide an example of specifying postgis table as an output for gdal_contour?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Solved. Just like in ogr2ogr:

gdal_contour -f PostgreSQL -i 1 -nln cont iamrast.tif "PG:host=localhost user=iampg password=iampgpass dbname=iamgis"
share|improve this answer

I have not seen -f option using as you too.

as a practical solution for loading output shapefile:

shp2pgsql -s 4326 -W latin5 -I -S -D contour.shp contours | psql -U postgres -h localhost -d mydatabase

beside this you can check out gdal extension on qgis how it formatting your command.(it shows gdal command in windows) at Raster->Extraction->Contour menu...

i hope it helps you...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.