[Mapserver-users] shpxy

Steve Lime steve.lime at dnr.state.mn.us
Wed Mar 10 14:45:54 EST 2004


Hi Paul: There's a [shpmid] tag (and maybe shpmidx/shpmidy tags) that
will give you a psuedo centroid. It's not a true centroid, but rather
the center of the bounding box. It was added originally as a means of
creating maps centered on a feature.

Out of curiousity why aren't polygons working for you? I assume the tag
works ok it's just not what you need to position an element.

We/I should extend the shpxy tag to simply replace the other [shp...]
tags. We could have different representations of a feature (default
full, bbox, center, centroid), plus support projections and feature
processing (e.g. line thinning).

Steve

>>> pagameba at magma.ca 3/9/2004 2:37:11 PM >>>
Hi,

I'm using the [shpxy xf="," transform] in a template to create
imagemaps 
... the imagemap  onmouseover/onmouseout dynamically positions a dhtml

div element over the feature in the map.  This works exceptionally well

for points but it doesn't work for polygons.

Is there anything I can use in a template to get a centroid value for a

polygon (rather than all the points)?

Also, has anyone tried to do this for lines?  I'm using mapscript and 
generating the template dynamically based the type of a selected layer.

  Right now my approach is to get the points that make up lines and
then 
create polygons by buffering the lines ... this is obviously quite a
lot 
of work in php :)

Cheers,

Paul
-- 
  -----------------------------------------------------------------
|Paul Spencer                           spencer at dmsolutions.ca    |
|-----------------------------------------------------------------|
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/| 
  -----------------------------------------------------------------

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu 
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list