Questions tagged [st-dwithin]

A PostGIS function to determine if geometries are within a specified distance of one another.

Filter by
Sorted by
Tagged with
1
vote
2answers
49 views

Using table joins with ST_DWithin to optimise process?

I am trying to select all segments (among millions of them) that are less than X metres from a few thousands polygons obtained from a raster dataset (meaning they've got quite a complex geometry - ...
1
vote
1answer
65 views

Ways to speed up ST_DWithin between millions of segments and thousands of polygons?

I have 3 PostgreSQL tables with the following data: tab1 => It contains about 5.7 millions of segments (straight lines) tab2 => It contains 6673 polygons tab3 => It contains 19620 polygons ...
0
votes
1answer
50 views

Improve Performance of ST_DWithin - H2GIS

I have a table seg_point, that I create like this: CREATE TABLE seg_point (id INT AUTO_INCREMENT PRIMARY KEY, segmentid TEXT, geom GEOMETRY); And I'm trying to improve the performance of this query ...
1
vote
1answer
52 views

PostGIS: Running multiple intersections within a single SQL query?

PostgreSQL 11 + PostGIS, on Windows 10. I'm working with a PostGIS-enabled database. I want to UPDATE a large polygon table (100,000+ rows) WHERE the geometry of that host table intersects the ...
1
vote
1answer
76 views

PostgreSQL: Spatial join points to polygon, listing point attributes where multiple are joined

I have a large polygon table and a large point table in a postgis enabled PostgreSQL database. Each point has a unique reference number (double type). I want to spatial join the points to the polygons,...
2
votes
0answers
314 views

Improve the speed for ST_DWithin

I need to get the outer polygon of the LSOAs within 10 miles of each postcode centroid. There are 180k LSOA polygons in table1 and 2.6 million postcode centroid points in table2. I have created 2 ...
2
votes
1answer
172 views

How to use use_spheroid=false in ST_DWithin?

I have created 2 geography columns and indexed them using GIST. I am looking to use ST_DWithin for a larger dataset and to make it faster trying to use the use_spheroid=false. SELECT pois.objectid, ...
2
votes
0answers
120 views

PostGis st_dwithin super slow when inserting

I am trying to insert the newly obtained data from st_dwithin into a new table. However, it has been running since 1 day and I still can't get any data into the new table. Can i know what is the ...
0
votes
2answers
77 views

How to find all the geometries in a table which are at a particular distance from a given point in postgis?

I have a table called cartlocations:- Now I have point geometry of latitude and longitude value, say 23.4877191,86.6927571, I want to find all the geometries which are within a distance of 1000 ...
6
votes
1answer
179 views

ST_DWithin in PostGIS: Implicit index call

In PostGIS, the function ST_DWithin automatically includes a bounding box comparison that will make use of any indexes that are available on the geometries. This is done using the mechanism of ...
9
votes
1answer
210 views

Finding closest line given 2 points using PostGIS?

I have a table t that contains a column line_positions which is of type line. Given 2 points I want to find the closest line that is close enough (less than 10km) and that does not pass too close to a ...
2
votes
1answer
922 views

Postgis KNN vs ST_DWithin for nearest neighbour search with a radius

We are trying to get nearest neighbors within a user given radius. As far as I understand ST_DWithin degrades as distances are increased. The problem with using KNN is that it keeps on searching even ...
4
votes
1answer
157 views

Postgis can't find the optimum way, seems to be always using Btree index rather than spatial index

I am using the Postgis ST_DWithin function like this: SELECT *, ST_X(geometry) as longitude, ST_Y(geometry) as latitude, ST_Distance_Sphere( ST_SetSRID( ST_MakePoint(-...
4
votes
1answer
1k views

Does the performance of Postgis function ST_DWithin degrade with larger distances?

I am using the Postgis ST_DWithin function like this: SELECT *, ST_X(geometry) as longitude, ST_Y(geometry) as latitude, ST_Distance_Sphere( ST_SetSRID( ST_MakePoint(-...
9
votes
1answer
3k views

ST_DWithin Calc Meters - transform or cast?

I want to use ST_DWithin on data which is stored in SRID geometry of 4326 and use meters as the distance parameter. Is it more efficient to do a cast (e.g. data.geom::geography) or a transform to an ...
1
vote
1answer
462 views

ST_DWithin Optimization Postgis

I've got two datasets - 1) a set of buildings in LA and 2) fiber optic cable maps from a company called Zayo which covers the whole of the US. I'd like to find the buildings within a certain distance ...
2
votes
2answers
2k views

How can I optimize this ST_Distance query?

I am using ST_Distance in postgis to get the closest point in a table to each polygon in another table. This query is taking a long time to run (2 hours with 18,000 records in the polygon table and 7,...
2
votes
2answers
522 views

How many query points fall within distance X to a set of LineString

I have a set of 10 query points and I want to know how many of them are with distance within at most 4 meters of any LineString in a given table. Note that if a point is within 4 meter distance to ...
2
votes
1answer
2k views

Improve performance on a st_dwithin query (in PostGIS)

At the momenent I am working on a query, as described in an earlier question. I have the two tables testme (tracked GPS-profile with Point Geometry) and roads (geometry roads shapefile) Besides ...
2
votes
1answer
2k views

How to use ST_DWithin to query features from one table within a distance of a specific feature or features in another table

I'm pretty new with PostGIS. I have a parcel layer and a census block layer in a postgres database, and I would like to be able to query out all census blocks within a specified distance of a specific ...
10
votes
2answers
3k views

ST_Distance doesn't use index for spatial query

I can't get PostGIS 2.1 running on PostgreSQL 9.3.5 to use a spatial index even for the simplest queries. The whole dataset is 8 million points (population count grid from here). The table is created ...