<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#333399">
<blockquote cite="mid28de5e310505051337460747f7@mail.gmail.com"
type="cite">
<blockquote type="cite">
<pre wrap=""> 1) Given two point locations, I want to find the two intersecting points of
the two 125km virtual circles that surround each point.
</pre>
</blockquote>
<pre wrap=""><!---->
Hi Mark,
You could do something like:
Making a 125 km buffer around your points: you got polygons (postgis
polygonizes the circle).
Taking the exterior rings of these polygons: these are closed linestring,
Intersects the two linestring to get the result. zero, one, two points.
</pre>
</blockquote>
Ah HA! I didn't understand that buffer() could be used this way. That
helps!<br>
<blockquote cite="mid28de5e310505051337460747f7@mail.gmail.com"
type="cite">
<pre wrap="">In SQL, it would be something like:
select astext(intersection(
(select exteriorRing(buffer(pointFromText('POINT (93 95)'), 125, 50))),
(select exteriorRing(buffer(pointFromText('POINT (280 170)'), 125, 50)))
));
</pre>
</blockquote>
Why use exteriorRing(); isn't that redundant? Also, intersection()
gives me a POLYGON of the overlapping area (assuming the points are
spaced less than 250 km from each other). I want just the POINTS that
intersect (so I can create a line segment representing equidistance
between the points). Lastly, I don't understand the 'select' inside
the intersection(). Aren't they superfluous? Maybe there are
subtleties regarding 'select' and 'exteriorRing()' that you know about
that I don't yet...<br>
<blockquote cite="mid28de5e310505051337460747f7@mail.gmail.com"
type="cite">
<pre wrap="">Just make the intersection of the 2 polygons. If polygons don't touch,
the intersection will be empty, otherwise, the result will depend on
the shape of the 2 input polygons:
select asText(geomUnion(
polygonFromText('POLYGON((1 1, 4 1, 3 5, 1 1))'),
polygonFromText('POLYGON((1 3, 6 3, 1 7, 1 3))')
));
</pre>
</blockquote>
OK, I'll try this, but I thought a geomUnion() returned a polygon with
"holes" if the polygons overlapped, right? Oh! If that's the case,
then I can call exteriorRing() on the result to get just the outside
perimeter of the shape... Thanks for the help!<br>
<br>
Mark<br>
</body>
</html>