O'Reilly logo

PostGIS Essentials by Angel Marquez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Spatial functions

In this section, we will see a subset of the most useful spatial functions that can be used to extract the information that we need from the databases. These functions will be illustrated through practical examples mentioned earlier. The functions that we will cover are as follows:

  • ST_Distance
  • ST_DWithin
  • ST_Length
  • ST_Intersects
  • ST_Within

The ST_Distance functions (geometry, geometry)

It returns the distance between two geometries in projected units, as we saw in Chapter 3, Inserting GIS Objects, which mentions the measurement units in which the spatial coordinate is given. As an example, the POINT(-1.344165 51.381320) position is given in degrees; another geographic reference system could use a different unit of measurement, such as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required