[SCM] postgis.net branch website updated. clarity-final-89-g260de2c
git at osgeo.org
git at osgeo.org
Tue Mar 19 15:03:48 PDT 2024
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "postgis.net".
The branch, website has been updated
via 260de2cdce7b9427b9be301401470fffb3d5bbf9 (commit)
from a87b7e2533c73b4fe434f478dd3e2e8bfc59ee0f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 260de2cdce7b9427b9be301401470fffb3d5bbf9
Author: mdavis <mtnclimb at gmail.com>
Date: Tue Mar 19 15:03:43 2024 -0700
Update content/documentation/tips/st-dwithin.md
diff --git a/content/documentation/tips/st-dwithin.md b/content/documentation/tips/st-dwithin.md
index 274ca5d..778eb96 100644
--- a/content/documentation/tips/st-dwithin.md
+++ b/content/documentation/tips/st-dwithin.md
@@ -1,5 +1,5 @@
---
-title: "Use ST_DWithin not ST_Distance for radius queries"
+title: "Use ST_DWithin for radius queries"
layout: post
category: tips
tags: [newbie, geometry, geography, ST_DWithin]
@@ -11,20 +11,20 @@ geekdocHiddenTocTree: false
weight: 10
---
-If you have a problem that involves finding the things within X distance of other things or finding what things "have nothing within X distance" do not use `ST_Distance` for filtering and also do not try to use [ST_Intersects](/docs/ST_Intersects.html) with [ST_Buffer](/docs/ST_Buffer.html).
+For queries that involve finding "things within distance X of other things" or "what things have nothing within distance X", use [ST_DWithin](/docs/ST_DWithin.html) for filtering. Do not use [ST_Distance](/docs/ST_Distance.html) or [ST_Intersects](/docs/ST_Intersects.html) with [ST_Buffer](/docs/ST_Buffer.html).
-Use [ST_DWithin](/docs/manual-dev/ST_DWithin.html) instead. Why?
+Why?
-1. `ST_DWithin` can use an index and `ST_Distance` can not
-2. ` ST_Buffer` is just an approximation of a buffer and not an exact buffer
+1. `ST_DWithin` uses an spatial index (if available). `ST_Distance` does not
+2. `ST_DWithin` is more accurate than using `ST_Buffer`, which is only approximation of a true buffer outline. It is also amost always faster.
-Also note that `ST_DWithin` is supported for both geometry and geography.
+Note that `ST_DWithin` is supported for both `geometry` and `geography` types.
## Examples
-We show examples using geography. Note that geometry would use much the same except units are in the spatial reference units.
+We show examples using `geography`. Queries using `geometry` are similar, but the distance must be in the spatial reference units.
-### Finding closest things within 1609 meters (~1 mile)
+### Finding things within 1609 meters (~1 mile)
```postgres
SELECT roads.road_name, pois.poi_name
-----------------------------------------------------------------------
Summary of changes:
content/documentation/tips/st-dwithin.md | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
hooks/post-receive
--
postgis.net
More information about the postgis-tickets
mailing list