[mapserver-users] Labelling Lines with Center justification not owrking as expected.

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Thu Aug 24 14:47:47 PDT 2017


All,

I’m working on a Parcel Assessment app that will display Parcel edges and which streets they abut.  I’m trying to label each edge of the parcel with it’s Edge length, but the positioning of the labels is not at all what I’m expecting in the output.  Here is a sample image:

https://www.dropbox.com/s/ppp1cihnl4flycf/rc_parcels_assessment.02.png?dl=0

The blue lines represent a connection from the center of each of the parcel edge segments being assigned, to the approriate Street/Alley centerline (not shown).  I can’t seem to get the labels to center them selves on the segments.  There should be one distance label centered on each segment at the start of each of the blue lines where they intersect the red parcel edges.

My next workaround would be to use a centroid of the line as the label point.  I think I’ve tried all available combinations of settings in the Mapfile, but maybe I missed something.

Anyone have any ideas?

Here is the Label layer for the Parcel edges:

LAYER
NAME 'Parcels-Query-Edges'
STATUS ON
TYPE LINE

METADATA
"ows_title" "Parcels-Query-Edges"
"gml_include_items" "all"
END

CONNECTIONTYPE PostGIS
CONNECTION “***REMOVED***”
DATA "geom from (
select
round(length::numeric,2) round_el,
* from assessment.rc_parcel_segments_no_overlaps
WHERE parcelid = '%pin%'
OR parcelid = '%qstring%'
) as subquery using unique segid srid=200068"

PROJECTION
"init=epsg:200068"
END

CLASSITEM "parcelid"
LABELITEM "round_el"

VALIDATION
'pin' '^[0-9]{12}$'
'qstring' '^[0-9]{12}$'
END

CLASS
STYLE
GEOMTRANSFORM "start"
SYMBOL "circle"
COLOR 255 0 0
SIZE 12
END
STYLE
GEOMTRANSFORM "end"
SYMBOL "circle"
COLOR 255 0 0
SIZE 12
END # STYLE
LABEL
FORCE true
COLOR  255 0 0
OUTLINECOLOR 255 255 255
FONT "arial-bold"
TYPE truetype
SIZE 12
ANGLE auto
POSITION auto
END
END # CLASS
TEMPLATE 'TEMPLATES/empty.html'
END # LAYER

Thanks

bobb






"Reality is merely an illusion, albeit a very persistent one."
- Albert Einstein



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170824/11e4fa2e/attachment.html>


More information about the mapserver-users mailing list