Raster Images

Brent Fraser bfraser at GEOANALYTIC.COM
Mon Jan 30 19:35:55 PST 2006


> I'm new to mapsever, but have been able to get the demo code to run and
> have further been able to read data from a PostgreSQL database to
> display shapes, lines, etc.
>
> I want to be able to add a raster layer as the first layer to my map.
> I'm stuck though.
>
> My map file is as follows:
>
> #
> # Start of map file
> #
> MAP
>   NAME TESTMAP
>   STATUS ON
>   SIZE 600 600
>   EXTENT 0 0 125 125
>   UNITS METERS
>   SHAPEPATH "data"
>   IMAGECOLOR 0 0 0
>   TEMPLATEPATTERN "test"
>
>   IMAGETYPE PNG24
>
>   #
>   # Start of web interface definition (including WMS enabling metadata)
>   #
>
>   LAYER
>     NAME "Terrain"
>     TYPE RASTER
>     STATUS ON
>     DATA "../graphics/testing_29_28.png"
>     DEBUG ON
>   END
>
> END # MAPFILE
>
> Debug doesn't output any errors.
> testing_29_28.png is a 24 bit image that is 125x125 pixels.
>
> All I get back though is a black image (e.g my background image color).
>
> OS is WinXP with IIS running.
>
> Installation of mapserver was from HOBU's Kitchen sink download.  I
> would not at all be suprised if I am missing something from my
> installation.
>
> Bryce Bangerter


Bryce,

  Most likely the problem is with coordinates.  The units of the EXTENT
are the map projection units (e.g. feet, meters, degrees, etc depending
on your projection).  Have a look at Pericles' tutorial at
http://hypnos.cbs.umn.edu/tutorial/example1-6.html

  And don't forget to make sure that your input raster is "geo-referenced".

  And if your desired output projection is not the same as your input data
projection, you will need to add a definition for each in the map file.

Brent Fraser
GeoAnalytic Inc.
Calgary, Alberta



More information about the MapServer-users mailing list