[postgis-users] Getting dimensions of polygon sides

Bruce Rindahl rindahl at lrcwe.com
Thu Jun 12 10:03:55 PDT 2008


Obe, Regina wrote:
> Anyrate my new problem:  This whole exercise just made me realize they
> must have put these polygons together with the constituent linework of
> the edges.  Because if I look at the abutting parcels those extra dims
> represent sides of those smaller parcels.  My simplify solution works
> great if you are just looking at one parcel, but when you look at
> abutters - it shall we say, looks crowded.  So my thought is to put the
> position of my length annotation inside each parcel it represents.
>
> I'm lost how to do that.  So basically jimmy the ST_Centroid(the_geom)
> of my above such that it always sits inside the parcel boundary.
>
> Thanks,
> Regina
>   
I am not sure how you are placing the annotation, but this could be 
interesting....

Looking at the aftersimplify.png, you have the length of each line 
segment (and the segment itself).  The center point of each segment is 
easy.  Now you need to define a line segment offset by the text height 
of your annotation and translate it INSIDE the polygon.  The you draw 
(label?, annotate? ....) the text along that line.  If you first update 
the polygon with forceRHR() then INSIDE is always to the right of the 
line segment.  You can easily get the azmith of the linesegment from the 
start and end points, add 90 degrees and compute the x and y values for 
the translate() function.  This should be basic high school trig - ;-) .

Is this what you are thinking of?

Bruce



More information about the postgis-users mailing list