[mapserver-users] How to use ANNOTATION layer in combination with RASTER data?

Rahkonen Jukka (Tike) jukka.rahkonen at mmmtike.fi
Wed Jun 4 03:53:45 PDT 2014


Hi,

I believe that Mapserver has many pieces for you but perhaps some work will be needed for putting them together.

1) For the first, the attribute name for some pixel value based stuff is "pixel". Here is an example about selecting a pixel value range: 
CLASSITEM "[pixel]"
  # class using an EXPRESSION using only [pixel].
 CLASS
  EXPRESSION ([pixel] >= 25 AND [pixel] < 39)

2) I do not know which kind of client application you want to have, but read if UTF Grid could be of any use for you http://mapserver.org/development/rfc/ms-rfc-93.html
Connectiontype CONTOUR proves that converting your raster into labels is for sure possible to do while perhaps not supported at the moment http://mapserver.org/development/rfc/ms-rfc-85.html

3) There are also ways to convert your raster data into shapefiles. See for example this http://www.slideshare.net/shencoop/qgis-raster-to-point
There is also a SEXTANTE algorithm for this and in my SEXTANTE toolbox it seems to be in Vectorization - Raster layer to points layer. There must be corresponding ones in GRASS, SAGA and others.
 
-Jukka Rahkonen-


Jorrit Goddijn wrote:



> Hi Jörg, Hi Stephen,
> 
> Instead of showing the grayscaled pixels of the RASTER image, I would like to
> show the actual value.
> 
> I have my data only in GRIB format available, so creating a point layers  and
> using the FEATURE attribute is not possible as I would need the data as a
> shapefile for that, I am right?
> 
> Is there anyway to accomplish this?
> 
> Thanks for your time,
> 
> Jorrit
> 
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-
> bounces at lists.osgeo.org] On Behalf Of Jörg Thomsen
> Sent: dinsdag 3 juni 2014 14:17
> To: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] How to use ANNOTATION layer in combination
> with RASTER data?
> 
> Hi Jorrit,
> 
> you want to label you raster dataset with what?
> 
> Regards, Jörg
> 
> Am 03.06.2014 14:01, schrieb Jorrit Goddijn:
> > Hi all,
> >
> >
> >
> > I try draw an ANNOTATION type layer based on RASTER type layer.  When
> > doing this based on a shape file I would set the LABEL item on the
> > ANNOTATION layer to be attribute used in the shapefile.
> >
> >
> >
> > What LABELITEM should I use when using RASTER data?
> >
> >
> >
> > I posted the Mapfile I have so far hereunder.
> >
> >
> >
> > Thank you for your help.
> >
> >
> >
> > Bye
> >
> >
> >
> > Jorrit
> >
> >
> >
> > #---------------------------------------------------------------------
> > -------
> >
> > #grib wave direction layer example
> >
> > #---------------------------------------------------------------------
> > -------
> >
> >     LAYER
> >
> >         NAME "grib_data"
> >
> >         TYPE RASTER
> >
> >
> >
> >         DATA
> >
> "/var/www/mapserver/data/grib/routeguard/4nwcurpol99_2013110412.grb2"
> > #Current direction @ Mean sea level
> >
> >         PROCESSING "BANDS=1"
> >
> >         PROCESSING "SCALE=0,360" #scale all degrees
> >
> >
> >
> >         PROJECTION
> >
> >             "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +pm=-360"
> >
> >         END
> >
> >     END
> >
> >
> >
> > #---------------------------------------------------------------------
> > ------
> >
> > # the annotation layer
> >
> > #---------------------------------------------------------------------
> > ------
> >
> >   LAYER
> >
> >     NAME        "grib_label"
> >
> >     DATA        "grib_data"
> >
> >     STATUS      OFF
> >
> >     TYPE        ANNOTATION
> >
> >     CLASSITEM   "CLASS" # do I need it?
> >
> >     LABELITEM   "VAR_10-1-0_L101" #what variable name to use?
> >
> >
> >
> >     CLASS
> >
> >       EXPRESSION [VAR_10-1-0_L101] #gives parse error
> >
> >       STYLE
> >
> >         COLOR      -1 -1 -1
> >
> >       END
> >
> >
> >
> >       LABEL
> >
> >         COLOR 132 31 31
> >
> >         TYPE TRUETYPE
> >
> >         FONT arial-bold
> >
> >         SIZE 12
> >
> >         ANTIALIAS TRUE
> >
> >         POSITION CL
> >
> >         PARTIALS FALSE
> >
> >         MINDISTANCE 300
> >
> >         BUFFER 4
> >
> >       END # end of label
> >
> >     END # end of class
> >
> >   END # annotation layer
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list