[postgis-users] PostGIS and Section lines
Bruce Rindahl
rindahl at lrcwe.com
Fri Jan 26 09:06:43 PST 2007
-----Original Message-----
From: Bill Thoen [mailto:bthoen at gisnet.com]
Sent: Friday, January 26, 2007 9:59 AM
To: rindahl at lrcwe.com; PostGIS Users Discussion
Subject: Re: [postgis-users] PostGIS and Section lines
>In the easy cases, you'll be able to find the closest point to corner of
>the minimum bounding rectangle (which you get from envelope() I guess)
>by testing each point's distance to the four points of the enclosing
>rectangle. But as you probably know, there are "triangular" sections and
>other pathological oddities (especially near rivers and at the survey
>borders). So you'll have to make sure you have four DIFFERENT corner
>points when you identify your section corners.
I am aware of these problems and will have to handle these separately. I
was looking for help on the looping routine to fine the easy cases.
>I think you've got the right algorithm... do you just need to know how
>to create a line by copying points from a subset of your section polygon
>(while also translating each point's X-coordinate by -500 ft in the case
>of the east line)?
I think I have a handle on this. If I know the NE point and the SE point
then the east line is:
line_substring(....,line_locate_point(....,NE),line_locate_point(....,SE))
where .... is ExteriorRing(GeometryN(the_geom,1)). The translate function
takes care of moving all the points to the east.
This is really clean but I don't know yet how it will handle polygons coded
in the wrong direction and how I will handle when the first vertex and the
last vertex are the same corner.
Thanks for the ideas. When this is accomplished I will document it as I
think others will use it.
Bruce
More information about the postgis-users
mailing list