0

I am looking for the st_dwithin postgis source code. I want to learn the way postgis determines whether a given geometry is within a given radius to another geometry.

5

One of the best place to search and explore source code for PostGIS is through the GitHub mirror:

https://github.com/postgis/postgis

For instance, search ST_DWithin, where you will then search LWGEOM_dwithin, then lwgeom_mindistance2d_tolerance, then lw_dist2d_comp, then lw_dist2d_recursive, and then different versions of lw_dist2d_distribute* functions ...

You can also explore the Doxygen documents for a high-level view of the liblwgeom library, which is part of PostGIS. E.g. for measures.c, which is used by ST_DWithin:

http://postgis.net/docs/doxygen/2.1/d1/dbf/measures_8c.html measures.c

Here's how lwgeom_mindistance2d_tolerance connects with the other components: lwgeom_mindistance2d_tolerance

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.