User Tools

Site Tools


gis:postgresql-postgis-notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gis:postgresql-postgis-notes [2024/01/23 09:38]
Ilias Iliopoulos Assed find points outside polygons
gis:postgresql-postgis-notes [2024/02/02 21:49] (current)
Ilias Iliopoulos
Line 95: Line 95:
 </​code>​ </​code>​
  
-===== Locate ​the points of a Point layer that are outside polygons of a Polygon layer =====+===== Identify ​the points of a Point layer that are outside polygons of a Polygon layer =====
  
 There are multiple queries that you can use to solve this problem. You can find an interesting discussion in [[https://​gis.stackexchange.com/​questions/​376234/​find-polygons-that-has-no-points-in-postgis|Find polygons that has no points in PostGIS]]. For big data sets, I have found that the query that executes in the shortest time is: There are multiple queries that you can use to solve this problem. You can find an interesting discussion in [[https://​gis.stackexchange.com/​questions/​376234/​find-polygons-that-has-no-points-in-postgis|Find polygons that has no points in PostGIS]]. For big data sets, I have found that the query that executes in the shortest time is:
Line 105: Line 105:
  
 For comparison purposes, in a data set with 45.000 points and 45.000 buildings, this query took approximately 4 minutes, while other queries took more than 14 minutes! For comparison purposes, in a data set with 45.000 points and 45.000 buildings, this query took approximately 4 minutes, while other queries took more than 14 minutes!
 +
 +**WARNING:​** You need to pay particular attention on how much is exactly "​outside"​. You may encounter cases where the point is considered to be at exactly the perimeter of the polygon, because it has been "​snapped"​ at the side of the polygon, using the snapping features of your GIS software. Yet, there is always a tolerance in snapping and the point might be geometrically within a few tenths of a millimeter inside or outside the polygon. A very small buffer area should be considered around the point to account for this ambiguity. ​
  
 ===== Import an SHP file manually ===== ===== Import an SHP file manually =====
Line 134: Line 136:
 </​code>​ </​code>​
  
 +
 +~~DISQUS~~
gis/postgresql-postgis-notes.1705995493.txt.gz ยท Last modified: 2024/01/23 09:38 by Ilias Iliopoulos