osmcode / osmcoastline

Extracts coastline data from OpenStreetMap planet file.
https://osmcode.org/osmcoastline/
GNU General Public License v3.0
109 stars 14 forks source link

Small optimization on intersects #14

Closed vpicavet closed 9 years ago

vpicavet commented 9 years ago

Since a && comparison is done beforehand, we can directly call the _ST_Intersects method, which will be a bit faster than the ST_Intersects one.

joto commented 9 years ago

I can't find that function in the documentation. Is this an officially supported interface or some internal function?

vpicavet commented 9 years ago

It is a semi-official function. It is fully supported, since it is actually the underlying method for st_intersects. It is not in the documentation, but it has been mentionned in various presentations, and won't move anytime soon.

As an alternative, you could remove the && test (already included in st_intersects). It will be a little slower though ( one function call, a few %).

Vincent

On 03/08/2015 10:24, Jochen Topf wrote:

I can't find that function in the documentation. Is this an officially supported interface or some internal function?

— Reply to this email directly or view it on GitHub https://github.com/osmcode/osmcoastline/pull/14#issuecomment-127162233.

joto commented 9 years ago

I don't like using an undocumented function. I am removing the && test instead. Thanks for bringing this up.