[postgis-users] GIS functions

Paul Ramsey pramsey at refractions.net
Fri May 6 07:26:00 PDT 2005


- Yes, the "selects" are redundant in this case.
- No, exteriorring() is a very clever trick, which turns your polygons 
into the linestrings that represent their outer shells. The 
intersection of a linestring and a linestring is a... point. Which is 
exactly what you want.

You should find the solution provided works pretty darn well, very 
clever stuff.

P

On 6-May-05, at 6:18 AM, Mark Fenbers wrote:

>>>  1) Given two point locations, I want to find the two intersecting 
>>> points of
>>> the two 125km virtual circles that surround each point.
>>>
>> 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.
>>
>>
>
>> 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)))
>> ));
>>
>>
>
>> 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))')
>> ));
>>
>
>
>  Mark
> <Mark.Fenbers.vcf>_______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list