[postgis-users] raster2pgsql vs gdal2wktraster ...can someone clarify?

Jorge Arévalo jorge.arevalo at deimos-space.com
Mon Mar 14 08:10:58 PDT 2011


On Mon, Mar 14, 2011 at 4:05 PM, AJ7 <ackbar at ackadij.com> wrote:
>
> Hi
> Can someone please clarify as to which script should be used to convert a
> raster tif to a postgis raster table?
>
> I have only got the gdal2wktraster script (I am on snow leopard, with
> postgres 9).
>
> Also, if I have got a raster image with each pixel representing a value,
> what is the command to export this to a postgis raster table? would this
> work (emphasis on the 1x1)?
> -> gdal2wktraster.py -r yourimage.tif -t [data_table]  -s 4326 -k 1x1 -I
> script.sql
>
> thanks
> --
> View this message in context: http://old.nabble.com/raster2pgsql-vs-gdal2wktraster-...can-someone-clarify--tp31145027p31145027.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>

Hi,

You can use both of them, but gdal2wktraster.py belongs to the old and
abandoned WKT Raster extension. Since October 2010, extension is
official part of PostGIS, and is named PostGIS Raster. The new loader
script is named raster2pgsql.py

So, my advice: Use PostGIS 2.0 from trunk, and compile it with raster
support. This will allow you to use PostGIS Raster.

The raster2pgsql syntax is the same than the old syntax from
gdal2wktraster. Your example is correct.

Further information:

http://gis4free.wordpress.com/2010/10/01/wkt-raster-is-now-postgis-raster/
http://gis4free.wordpress.com/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows/

-- 
Jorge Arévalo
Internet & Mobilty Division, DEIMOS
jorge.arevalo at deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g



More information about the postgis-users mailing list