[mapserver-users] Aligning labels within a polygon

Jan Hartmann j.l.h.hartmann at uva.nl
Tue Feb 21 12:17:49 EST 2012


Going a step further:

st_longestline(st_collect(the_geom),st_collect(the_geom))

gives the longest line segment that can be drawn within the cluster of 
street address points. Works for non-curved streets. I'm still looking 
for a more intelligent way to thin out a polygon to a (multi)line.

Jan

On 02/21/2012 05:27 PM, Fawcett, David (MPCA) wrote:
>
> If you are storing the data in PostGIS, you could possibly take 
> advantage of ST_Azimuth(). http://www.postgis.org/docs/ST_Azimuth.html
>
> It takes two point objects as the args, but you could potentially use 
> the start and end points of your linestring.
>
> David.
>
> *From:*mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] *On Behalf Of *Jan 
> Hartmann
> *Sent:* Tuesday, February 21, 2012 10:23 AM
> *To:* mapserver-users at lists.osgeo.org
> *Subject:* [mapserver-users] Aligning labels within a polygon
>
> Hi,
>
> I'm inputting lots of street address points in PostGIS, and try to 
> generate labels for the streets. The convex hull of the points of a 
> street approximate the course of the street, and I would like to 
> position the streetname in the middle of the convex hull polygon, 
> aligned to its dominant angle (the polygons are generally quite 
> narrow). Is there a way of doing this with MapServer? Perhaps by 
> thinning out the polygon to a line, for then I can use "angle follow".
>
> Jan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120221/5a8c837b/attachment.html


More information about the mapserver-users mailing list