[mapserver-users] HDF Data projection in MapServer

Frank Warmerdam warmerdam at pobox.com
Tue May 18 09:58:10 EDT 2010


Reddem wrote:
> Hi Everybody,
> 
> I am trying to display HDF files using MapServer, and upto some extent
> i have done it. Still i am facing problem with the projection of map.
...
>    Mapped - Composited mapped:Limit=4 62 27 95
>    Mapped - Composited mapped:Projection ID=8
>    Mapped - Composited mapped:Latitude Center=0
>    Mapped - Composited mapped:Longitude Center=78.5

> I am facing problem with projection of HDF data set which is 1 KM
> gridded dataset. and as without defining Projection Derivative it is
> showing somewhere else in the map.  can anyone help me in this regard
> to define Projection section of HDF data layer.

Venkat,

Projection ID = 8 in the USGS GCTP system means equidistant conic, which
we can express in PROJ.4 terms as "+proj=eqdc +lon_0=78.5 +datum=WGS84".

Hmm, on further review, equidistant conic needs two standard parallels
and there do not seem to be meaningful values expressed in the file.  Perhaps
we could use the latitude extents of the image, though that is guesswork.
That would be:

   +proj=eqdc +lat_1=4 +lat_2=27 +lon_0=78.5 +datum=WGS84

If we were to reproject the image center it would be:

proj +proj=eqdc +lon_0=78.5 +lat_1=4 +lat_2=27 +datum=WGS84
78.5 15.5
0.00    1714315.16

We know the pixel size is 1K and the image is 3630 x 2530 so this gives
us extents of:

  upper left x = 0 - (1000 * (3630*0.5))          = -1815000.0
  upper left y = 1714315.16 + (1000 * (2530*0.5)) = 2979315.16
  lower left x = 0 + (1000 * (3630*0.5))          =  1815000.0
  lower left y = 1714315.16 - (1000 * (2530*0.5)) =  449315.16

So you could use the gdal_translate arguments:

  -a_ullr -1815000.0 2979315.16  1815000.0 449315.16
  -a_srs '+proj=eqdc +lon_0=78.5 +lat_1=4 +lat_2=27 +datum=WGS84'

In the mapfile your layer would have this projection block:

  PROJECTION
    "+proj=eqdc +lon_0=78.5 +lat_1=4 +lat_2=27 +datum=WGS84"
  END

Hopefully this will give respectable results, but we are still guessing
with regard to the standard parallels.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list