[postgis-users] How To Load SRTM Files into PostGIS

10 views
Skip to first unread message

elliott

unread,
Oct 4, 2011, 11:47:02 AM10/4/11
to postgi...@postgis.refractions.net
Hi Everyone,

Does anyone know the best way to read SRTM data and load into PostGIS?
I have tried using gdal but the DatasetReadAsArray does not appear to be
reading the data correctly.

Thanks
_______________________________________________
postgis-users mailing list
postgi...@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Pierre Racine

unread,
Oct 4, 2011, 12:37:36 PM10/4/11
to PostGIS Users Discussion
Hi there is a complete tutorial on how to load SRTM rasters in PostGIS here:

http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01

You load them as true rasters. This implies you have PostGIS Raster installed.

Pierre

Puneet Kishor

unread,
Oct 4, 2011, 12:46:36 PM10/4/11
to PostGIS Users Discussion, Pierre Racine

On Oct 4, 2011, at 11:37 AM, Pierre Racine wrote:

> Hi there is a complete tutorial on how to load SRTM rasters in PostGIS here:
>
> http://trac.osgeo.org/postgis/wiki/WKTRasterTutorial01


This is great! Thanks. A question follows --

>
> You load them as true rasters. This implies you have PostGIS Raster installed.
>

It is not clear from http://trac.osgeo.org/postgis/wiki/WKTRaster whether I can install PostGIS Raster with PostGIS 1.5.3, or if I have to go the PostGIS 2.0 way.

I already have a working copy of PostgreSQL 9.0.1/PostGIS 1.5.3 installed via MacPorts under /opt/local that I want to continue using. So, I'd like to download only the PostGIS Raster source and compile it against my existing software.

How do I accomplish the above?

--
Puneet Kishor

Pierre Racine

unread,
Oct 4, 2011, 1:01:22 PM10/4/11
to Puneet Kishor, PostGIS Users Discussion
You may want to try what is available at :

http://www.kyngchaos.com/software/postgres

Otherwise, I think you might be able to compile a 2.0 version and install just the raster component over your PostGIS 1.5.3 without problem. With the shared libraries renaming from one version to the other, though, this night not work...

Pierre

Puneet Kishor

unread,
Oct 4, 2011, 1:14:31 PM10/4/11
to Pierre Racine, PostGIS Users Discussion
Thanks for the response Pierre.

On Oct 4, 2011, at 12:01 PM, Pierre Racine wrote:

> You may want to try what is available at :
>
> http://www.kyngchaos.com/software/postgres
>

The above won't work for me, as it requires installing different "framework" packages, etc. As I said, I already have Postgres9/PostGIS1.5.3 in /opt/local and working.

> Otherwise, I think you might be able to compile a 2.0 version and install just the raster component over your PostGIS 1.5.3 without problem. With the shared libraries renaming from one version to the other, though, this night not work...
>

The above statement sounds both hopeful and discouraging, and I am unable to figure out the truth from it.

First you say that I might be able to I compile a 2.0 version, and install just the raster component. I would be happy to do that, provided, of course, that I can identify the raster components that have to be copied over.

However, then you say that "with the shared libraries renaming from one version to another... this might not work."

Unless someone has already done what I am hoping for, and can chime in, I am assuming I would just have to try and see if it works, without, hopefully, screwing up my existing installation.

elliott

unread,
Oct 5, 2011, 10:08:14 AM10/5/11
to PostGIS Users Discussion
Thanks! Once loaded how do you query for the altitude given a latitude
and longitude.

Pierre Racine

unread,
Oct 5, 2011, 11:03:46 AM10/5/11
to PostGIS Users Discussion
Regina,

Any chance a build of PostGIS Raster on 2.0 work on PostGIS 1.5.3? Any other option to get PostGIS raster to work on 1.5.3?

Pierre

> -----Original Message-----
> From: postgis-us...@postgis.refractions.net [mailto:postgis-users-

Sandro Santilli

unread,
Oct 5, 2011, 12:45:57 PM10/5/11
to PostGIS Users Discussion
On Wed, Oct 05, 2011 at 11:03:46AM -0400, Pierre Racine wrote:
> Regina,
>
> Any chance a build of PostGIS Raster on 2.0 work on PostGIS 1.5.3? Any other option to get PostGIS raster to work on 1.5.3?

I'm afraid the libpgcommon thing introduced yet more dependency.
Maybe some older raster version would build with 1.5.3.

--strk;

() Free GIS & Flash consultant/developer
/\ http://strk.keybit.net/services.html

Paragon Corporation

unread,
Oct 5, 2011, 1:50:18 PM10/5/11
to PostGIS Users Discussion
I seriously doubt it, but Bborie or Jorge probably have a better idea.

For one in 2.0 the st_box2d got renamed to box2d so that alone I think would
probably make it not work.

I think also since the serialization changed raster code is assuming the new
serialization.

Thanks,
Regina

Jorge Arévalo

unread,
Oct 6, 2011, 5:24:11 AM10/6/11
to PostGIS Users Discussion
Hi,

In the current situation, I think PostGIS Raster won't work with PostGIS 1.5.3.

But Puneet, both versions can live in the same system. You can compile
PostGIS 2.0 with raster support, create a new database and enable it
with PostGIS 2.0 including PostGIS Raster. At same time, your existing
database, enabled with PostGIS 1.5.3, should work without problems.

In my Ubuntu box, I use PostGIS 1.5.3 and PostGIS 2.0, if helps.

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

Puneet Kishor

unread,
Oct 6, 2011, 8:39:27 AM10/6/11
to PostGIS Users Discussion

On Oct 6, 2011, at 4:24 AM, Jorge Arévalo wrote:

> Hi,
>
> In the current situation, I think PostGIS Raster won't work with PostGIS 1.5.3.
>
> But Puneet, both versions can live in the same system. You can compile
> PostGIS 2.0 with raster support, create a new database and enable it
> with PostGIS 2.0 including PostGIS Raster. At same time, your existing
> database, enabled with PostGIS 1.5.3, should work without problems.
>


This is great advice, allowing me to proceed forward.

So, to recap -- compile PostGIS 2.0 against my existing installation of Pg 9.0.x, against which my existing PostGIS 1.5.3 is also compiled.

Then, create a new database to hold only the raster data, enable it with PostGIS 2.0, without affecting my existing apple-cart.

Hopefully, it will all work, just as it for you.

Many thanks,

Reply all
Reply to author
Forward
0 new messages