[postgis-users] polygon of sphere

Paul Ramsey pramsey at opengeo.org
Thu May 26 12:41:53 PDT 2011


Two things:

First, at the application level, if you don't get a result from
ST_Intersects() then you know you want to return your default
information.

Second, performance issue. Given the complexity of county boundaries
and the fact that big countries (russia, I'm looking at you) are going
to pop out of the index condition quite frequently, and the fact that
point-in-polygon in geography is still pretty slow, and the fact that
you can split cross-date-line countries into multiple polygons
relatively easily and the fact that no countries actually surround the
poles (I'm not counting antarctica here), you might find that doing
this in geometry works better. The intersection test is way faster
there, and as long as you aren't calculating distances, the simple
true/false results are going to be (mostly mostly) correct.

P.

On Thu, May 26, 2011 at 12:16 PM, Michael Welter <mike at introspect.com> wrote:
> Thanks, Paul,
>
> I have a database of country borders.  If the point lies within a particular border then the query will return country-specific information.  If the point doesn't lie within a border then I would like to return some default information.
>
> Mike
>
> On May 26, 2011, at 12:42 PM, Paul Ramsey wrote:
>
>> Nope, there isn't. In fact, such a thing will give us the shakes as
>> our code for determining in/out status  of an object depends on first
>> being able to generate one point that is definitively outside the
>> containing area.  Maybe there is some other way to skin your cat, what
>> is the higher level problem you are trying to solve?
>>
>> P.
>>
>> On Thu, May 26, 2011 at 11:05 AM, Michael Welter <mike at introspect.com> wrote:
>>> Hello,
>>>
>>> Using type GEOGRAPHY, is there a polygon such that ST_COVERS(Polygon,Point) returns true for every point?  Something like -180˚ to +180˚ longitude and -90˚ to +90˚ latitude?
>>>
>>> Thanks,
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>
> _______________________________________________
> 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