[mapserver-users] Labelling
Fawcett, David
David.Fawcett at state.mn.us
Fri Oct 31 12:53:39 PDT 2008
Nelson,
For the inline feature example. If you do it in a layer of type
annotation, you only get the label. See the mapfile example at the end
of this message.
For the second example, let's say that you wanted to label county
polygons, but you didn't like where MapServer was putting them. You
would use some sort of desktop GIS to create points at the locations
where you want to put your labels. In this point data set, you also
include an attribute that contains your label text. You then create a
map file with your polygon layer and also an annotation layer that uses
your point data set as the data source. You build the labels in the
annotation layer. Your polygon geometries will show, and the labels,
not the point geometries from the annotation layer will show up. In
this case, you are not building the points on the fly.
If you are asking if you can set the label position using an attribute
in the table to set the label position of individual features (ll, cc,
ul, etc), not according to the documentation. You can use attribute
binding to set the label color, outlinecolor, angle, or size, but not
apparently position.
http://mapserver.gis.umn.edu/docs/reference/mapfile/label Of course, if
I was creating a point layer to use as label points, I would set the
point position assuming that I was going to center the label on the
point.
David.
__________________________________________
MAP
NAME 'hello_world'
SIZE 500 500
IMAGECOLOR 143 188 143
EXTENT -200 -200 200 200
LAYER
NAME "howdy"
STATUS DEFAULT
TYPE ANNOTATION
FEATURE
POINTS
0 0
END
TEXT 'Hello World'
END
CLASS
LABEL
TYPE BITMAP
COLOR 0 0 0
END
END
END
END # end of map
# URL to call map:
http://localhost/cgi-bin/mapserv.exe?mode=map&map=/ms4w/apps/workshop08/
helloworld.map
-----Original Message-----
From: Nelson Soto [mailto:NSoto at plotplans.com]
Sent: Friday, October 31, 2008 1:57 PM
To: Fawcett, David; Daniel Degasperi
Cc: mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] Labelling
Thanks Dave and Dan,
Pretty much both of you are kind of getting at the same ideas I
had. I guess I asked in an ambiguous way because it doesn't pertain to a
specific situation. The point layer specific for labeling I think it the
way I'll have to go but David did touch on something interesting that I
wasn't sure you could do:
On your first suggestion, are you saying I could create a point
feature and label it using 'TEXT'? If so, can I do this without having
the point be visible? Then you mention I could use an annotation type
layer instead. Does the same apply as far as being able to specify x and
y cords and use a 'TEXT' clock to label? If so then that is an
interesting feature!
________________________________
From: Fawcett, David [mailto:David.Fawcett at state.mn.us]
Sent: Friday, October 31, 2008 1:18 PM
To: Daniel Degasperi; Nelson Soto
Cc: mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] Labelling
It isn't exactly clear to me what you are trying to accomplish
Nelson. I see two possibilities:
a. If you want to create a label that is independent from the
features in your data set, you can create a class with an inline
feature, setting the x and y coords, and using 'text' to specify what
the label text should be. You could even create this labeled feature on
the fly by passing this info in as a URL configuration. If you just
want to show the label, you could do this in an annotation layer instead
of a point/poly/line layer.
b. If you want to specify label points for your a
point/poly/line layer, you could create a point dataset of your label
points and then use that as the basis of an annotation layer
With either of these methods, you could either specify the label
position to a fixed location, like the center, or upper left position,
or you could use auto and let MapServer find the best position for it.
David.
-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Daniel
Degasperi
Sent: Friday, October 31, 2008 11:07 AM
To: Nelson Soto
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Labelling
Hi,
you can't give some coordinates to your label. I solved
the problem by creating a point layer.
Nelson Soto schrieb:
Is it possible to create a label and position it with
given coordinates? If I do not like the positioning of the labels, can I
in any way specify my own?
________________________________
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
--
Daniel Degasperi
Software Developer
daniel.degasperi at r3-gis.com
---------------------------
R3 GIS Srl
Via Johann Kravogl 2
I-39010 Merano - Sinigo (BZ)
Tel. +39 0473 494949
Fax. +39 0473 069902
Web http://www.r3-gis.com
-----------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20081031/5c6a055b/attachment.htm>
More information about the MapServer-users
mailing list