Geo raster

Hi all,
Can't find any examples on google, then I come here to see if it's possible to
display a georeferenced map (geotiff on my side) into Basemap.
The PCL module seems great, but there's not useful information on the Trac
website.
Thanks

···

--
Lionel Roubeyrie - lroubeyrie@...1068...
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr

Lionel Roubeyrie wrote:

Hi all,
Can't find any examples on google, then I come here to see if it's possible to display a georeferenced map (geotiff on my side) into Basemap.
The PCL module seems great, but there's not useful information on the Trac website.
Thanks

Lionel: There's an example in Basemap (warpimage.py) of displaying a plain old png file on different map projections. If you can figure out how to read a geotiff (I've never tried it, but GDAL should be able to do it), you should be able to use the projection information in the file to figure out the lat/lon values of each pixel. Then you could follow the warpimage.py example to transform it to some other map projection. Or, if you want to display it in it's native projection, just use the projection information in the geotiff to define a Basemap instance, extract the rgba values and plot them with Basemap.imshow.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328

Hi Jeff,
thanks for the reply. Effectively, I saw the warpimage example, and based on
that I just want to know if somebody has already used the PCL module to
retrieve geographical informations (or another module).

···

Le jeudi 20 septembre 2007, Jeff Whitaker a écrit :

Lionel Roubeyrie wrote:
> Hi all,
> Can't find any examples on google, then I come here to see if it's
> possible to display a georeferenced map (geotiff on my side) into
> Basemap.
> The PCL module seems great, but there's not useful information on the
> Trac website.
> Thanks

Lionel: There's an example in Basemap (warpimage.py) of displaying a
plain old png file on different map projections. If you can figure out
how to read a geotiff (I've never tried it, but GDAL should be able to
do it), you should be able to use the projection information in the file
to figure out the lat/lon values of each pixel. Then you could follow
the warpimage.py example to transform it to some other map projection.
Or, if you want to display it in it's native projection, just use the
projection information in the geotiff to define a Basemap instance,
extract the rgba values and plot them with Basemap.imshow.

-Jeff

--
Lionel Roubeyrie - lroubeyrie@...1068...
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr

Hi Lionel,

Hi Jeff,
thanks for the reply. Effectively, I saw the warpimage example, and based on
that I just want to know if somebody has already used the PCL module to
retrieve geographical informations (or another module).

With GDAL, it's trivial. I work with data from many sources, and I am
usually bypassing basemap altogether and going GDAL/OGR+MPL.

To show the first band of a raster map, I just do the following:
import pylab
import gdal

fname="/path/to/file"

g = gdal.Open ( fname)
data = g.GetRasterBand(1).ReadAsArray()
#data is a Numeric/numpy array. Can modify at will
pylab.imshow(data)
pylab.show()

Cheers,
Jose

···

On 9/20/07, Lionel Roubeyrie <lroubeyrie@...1068...> wrote: