Questions tagged [spatial-index]

In a database, a mechanism for optimizing access to data based on the spatial column(s) of a data table.

Filter by
Sorted by
Tagged with
1 vote
0 answers
61 views
+50

Get map to use ST_GEOMETRY function-based spatial index

SDE.ST_GEOMETRY — Oracle 18c — ArcMap/EGDB 10.7.1: I have a view that returns the startpoint of lines as an ST_GEOMETRY column: create or replace view bc_atn_startpoint_vw as ( select objectid, ...
user avatar
  • 716
2 votes
0 answers
49 views

GeoPandas spatial index - passing RTree parameters to index

I am quite familiar how to work with the Toblerity RTree library: import fiona import rtree with fiona.open(input_path,'r') as source: p = rtree.index.Property() p.filename = "index....
user avatar
  • 854
0 votes
0 answers
45 views

Spatial indexes with RTree for polygons

I am trying to understand about how R-tree works for polygon data. In other words, polygon is a list of vertices (points), however, I am wondering how spatial index can recognize the order of points ...
user avatar
3 votes
0 answers
38 views

Set a spatial index on a set of rows (without table) in PostGIS

I got a giant geometry that I retrieve from an API and I break it into smaller pieces with ST_Subdivide. Right after, I'm inserting it into a temporary table (which is indexed and only contains a ...
user avatar
  • 31
0 votes
1 answer
21 views

Producing Shadow Indexes in Google Earth Engine using maximum values from a ImageCollection

I'm trying to generate a Shadow Index using the maximum values from a image composite (ImageCollection). Here is the link with the code: https://code.earthengine.google.com/...
user avatar
6 votes
1 answer
114 views

Actual PostGIS query execution time MUCH slower than expected

I've run into a performance problem from which I'm not sure how to move forward. I have a table with ~150M rows. And I have a query that in EXPLAIN has a cost of just cost=0.55..209.36, but in EXPLAIN ...
user avatar
  • 101
0 votes
0 answers
12 views

The spatial index algorithm for vectors does not run - QGIS 3.22

I try to set a spatial index to my vector layers after getting an error on a mask I did but the algorithm does not run. Anyone did experience that? Does it have an impact on clipping if I don't step a ...
user avatar
  • 399
1 vote
1 answer
91 views

Getting index of special pixel (x and y position) or transform lat/lon of pixel to index in Google Earth Engine

I am trying to find the index (x and y pixel position in an image) of a pixel (ex: the pixel with max DN value). however, it has been challenging for me. My code is: var geometry3 = ee.Geometry....
user avatar
  • 11
1 vote
1 answer
135 views

How to speed up PyQGIS code for finding intersection of features in the same layer

I an deleting one of the intersecting polygons from a vector layer using PyQGIS code mentioned below. It is too slow as I have many features in the layer. Is there a way to speed it up? index= ...
user avatar
0 votes
1 answer
92 views

Adding multiple Image using Google Earth Engine

I want to make NDBI indices to a certain location. But when I run the code it can only show part of it //####################### Import SHP ####################### var countries = Indonesia //Import ...
user avatar
3 votes
0 answers
76 views

How do I use spatial index to speed up a model?

I want to process data with a model in QGIS. It works fine, but the bigger the datasets get, the longer it takes. The reason is, I use GeoJSON layers and they don't have a spatial index. That is why I ...
user avatar
  • 1,903
1 vote
0 answers
60 views

Optimized query to find nearby locations

I am working with the GeoNames database which has around 10 million rows of locations including longitude and latitude. I have tested around 6 various nearby location queries including spatial indexes....
user avatar
  • 119
4 votes
1 answer
165 views

Parallelization of rtree index

Is it possible to share rtree index in memory with multiple processes? I have succeeded to use rtree in multiprocessing environment with joblib, but the problem is that each process has its own copy ...
user avatar
4 votes
1 answer
91 views

Choosing appropriate index for PostGIS data

I have been reading this blog by Paul Ramsey, and considering my own data. https://blog.crunchydata.com/blog/the-many-spatial-indexes-of-postgis I have a regular grid covering an area of the world. ...
user avatar
1 vote
0 answers
101 views

Understanding Rasterio index coordinates

So I read in a .tif image with rasterio and what I get out when printing dataset.read(1) is what I understood a coordinate system in the "red" band of the image. The coordinate system is in ...
user avatar
  • 195
0 votes
2 answers
89 views

Index‐Based Built‐up Index (IBI) no in the specified range

I'm trying to calculate Index‐Based Built‐up Index (IBI). This index has been mentioned in A new index for delineating built‐up land features in satellite imagery. As mentioned in the paper, the range ...
user avatar
  • 193
5 votes
0 answers
95 views

(QGIS 3.20) Adding features while spatial index is created makes them disappear

I am encountering a weird behaviour in QGIS 3.20 on Windows. Steps to reproduce: Create an empty project Create a SHP layer. Add a few features. Save the changes to disk At this point everything is ...
user avatar
  • 51
5 votes
1 answer
65 views

Is a spatial index on a ST_Transformed geometry simply ignored when the transformation has the same target CRS than CRS of the geometry?

I have such vanilla index on a PostGIS table: CREATE INDEX polygons_gix ON public.polygons USING gist (geom); Because of this: If using more than one transformation, it is useful to have a ...
user avatar
  • 6,698
7 votes
3 answers
398 views

Optimizing an intersection between a single massive multipolygon (WKT) and many features from PostGIS

Context I have a massive MultiPolygon (~90'000 vertices, super complex, spreading over 60km², with lots of holes and parts) resulting of some Python computation. This MultiPolygon is coming as a WKT ...
user avatar
  • 6,698
2 votes
1 answer
146 views

How to use spatial indexes in SQL queries made on geopackages

I'm trying to learn how to write geopackage SQL queries so that the r tree index is used, but I can't seem to find any good information. I'm just trying to write a simple query in the qgis db manager ...
user avatar
  • 187
3 votes
1 answer
377 views

PostGIS: Does re-creating a spatial index after inserts or updates affect performance?

Creating a spatial index on a geometry field is very important. The docs also state that you should perform a VACUUM ANALYZE after large update operations. But is it ever necessary to drop an existing ...
user avatar
  • 2,761
1 vote
1 answer
250 views

GEE- Calculating Burned Area Index for Sentinel 2 (Filipponi et al. 2018) but getting binary result than index range

I am trying to calculate BAIS2 index for sentinel-2 collection over a study area in Google Earth Engine. I tried to create a function using expression but end result is binary image rather than index ...
user avatar
  • 77
2 votes
1 answer
55 views

Grab/Index the raster bands before and after a unique band for each pixel (depth-wise) in a raster stack

I'm working with a time series stack of 28 raster bands. Each band is an image for a specific date, spanning all of the year 2020, and they are stacked in order. The stack (change_point_raster) is in ...
user avatar
3 votes
0 answers
114 views

BRIN Index on PostGIS Geography

I have about 1.5 billion points in a geography column which represent topography. I'll be retrieving all the points that are within a certain distance of a given long/lat. I was able to create a GIST ...
user avatar
4 votes
1 answer
163 views

Selecting features that intersect features of another polygon with spatial index

Based on the answer of @mgri here: https://gis.stackexchange.com/a/224954/164953 I tried to select the features of a multilines layer intersecting less or more than 2 features of a multipoints layer. ...
user avatar
  • 269
2 votes
1 answer
82 views

PostgreSQL/PostGIS KNN query using <-> operator in ORDER BY clause not using index

I am trying to set up a KNN query using the <-> operator in the ORDER BY clause and the query planner does not appear to be using the spatial index as expected. I am not using bleeding edge ...
user avatar
2 votes
1 answer
227 views

Creating indexes with PostGIS using all CPU cores

I have to run a whole bunch of GIST index creation, on some tables containing lots of records (scale of many countries, OSM data): CREATE INDEX CONCURRENTLY IF NOT EXISTS osm_footways_gist ON ...
user avatar
  • 6,698
0 votes
0 answers
36 views

Creating Quadtree/Space Filling Curve Index atop GeoTiFF

I'm a complete beginner in GeoTiFF manipulation. I'd like to get some help in possible Java/Python/Scala project which performs spatial indexing (Quadtree, Space Filling Curves) atop given image(s). I ...
user avatar
  • 1
4 votes
2 answers
215 views

PostGIS- slow spatial UPDATE queries on 50mil rows

PostgreSQL 11.8, AWS hosted RDS instance, SSD, 8GB RAM, 3.0 GHz Intel Scalable Processor. Plenty of storage space. I'm finding running updates on a large table using spatial queries is taking a very ...
user avatar
  • 1,365
1 vote
1 answer
103 views

Optimising PostGIS ST_DWithin across many tables for existence only

I have 13 tables containing MultiPolygons in the same projection (27700). I am trying to write an efficient query to get back a Boolean for: Is one polygon in table A within X meters of any polygon in ...
user avatar
0 votes
1 answer
99 views

Can the QGIS spatial index be used to evaluate points contained in multiple polygons of shapefile layers using PyQGis?

I want to use the spatial index of QGIS to improve the performance in the spatial query of multiple points in multiple polygons, both are shapefiles, but has not given me good results in execution ...
user avatar
  • 1,344
1 vote
0 answers
191 views

Using spatial indexes on point to polygon intersection query in SQL Server

I have a table (tab_point) with about 5 million points and another table with a few thousand polygons (tab_polyg). I need to find what points intersect with what polygon (to establish a count of ...
user avatar
0 votes
1 answer
80 views

ST_GEOMETRY: spatial column must appear immediately after spatial relationship function for spatial index to be used

The docs for SDE.ST_GEOMETRY have a blurb that says the following: When are spatial indexes used with ST_Geometry? ...the spatial column must appear immediately after the spatial relationship ...
user avatar
  • 716
0 votes
1 answer
85 views

What is name of dataset in GEE to estimate level of urbanization for each county (district) in a country /region?

I am epidemiologist, not remote sensing expert. I am interested to find association between disease incidence /reported cases with urbanization (hypothesis " more bigger cities , more incidence&...
user avatar
0 votes
0 answers
26 views

Postgresql POSTGIS not using index field while having GIST index on geometry field [duplicate]

I have around 2M rows on my PostgreSQL table with GIST index on geo_point field but while I try to use ST_Distance or ST_DWithin it is not using the index instead it is doing Parallel Seq Indexed ...
user avatar
1 vote
0 answers
188 views

PostGIS: Speed up intersect by filtering first

I have a table with 20 million polygons where queries take some time (with an gist index on the geometries). I thought I could speed up the queries by first filtering on an additional id (selectivity: ...
user avatar
  • 111
2 votes
1 answer
130 views

Function-based spatial index: Use sdo_geometry() constructor instead of custom function?

I have an Oracle 18c table that has XY columns, but not a SHAPE column. I've created a query on the table that dynamically generates an sdo_geometry SHAPE column. sdo_geometry(2001, 26917, ...
user avatar
  • 716
0 votes
1 answer
42 views

Determining area size of grid (reference grid) in ArcMap [closed]

How do I determine the area size (square kilometres) of a customised reference grid in ArcMap 10.7? I have tried Data Driven Pages and it is not working for me. The idea is to know the area size of ...
user avatar
14 votes
2 answers
328 views

When not to create spatial index?

As I realized once again connected with this answer to Joining attributes by location using QGIS, creating a spatial index can result in huge performance improvements. However, I was wondering why ...
user avatar
  • 40.1k
0 votes
0 answers
132 views

Spatial indexing of GeoTIFF images (Java Library)

I have a requirement to spatially index each pixel of GeoTIFF images and store them in a scalable database. I intend to perform this in the following manner. Divide each GeoTIFF into smaller tile ...
user avatar
  • 149
0 votes
0 answers
413 views

Spatial Index warning from Spatial Query

I'm trying a spatial query using QGIS version 3.10 using a buffer layer and a set of species records. I wish to know how many species records fall within the buffer. When I perform the spatial query ...
user avatar
1 vote
1 answer
102 views

Improving PyQGIS distance matrix efficiency

I have written a custom processing tool, which I use within a large graphical model in QGIS. I am looking for a way to speed it up. First step of this processing tool is to connect every point of one ...
user avatar
4 votes
1 answer
268 views

PostGIS speed up query on 9 million row polygon table

Table bl_data 9 million+ polygon rows with GIST index and the index is clustered create index ii3 on bl_data using gist(geom); CLUSTER ii3 ON bl_data; I have a query that finds records with the same ...
user avatar
  • 4,075
8 votes
1 answer
3k views

When to use GiST and when to use SP-GiST index?

I'm aware of the documentation for both of the indexes, but can't decide which one to use. PostGIS documentation on these indexes Example: Let's say we have table data with the POINT attribute that ...
user avatar
  • 243
0 votes
1 answer
115 views

Implement Rtree index to custom objects list

I'm trying to improve a spatial calculation, and I think the most efficient way is to add a spatial index, but I'm not sure how to do it. In one hand I have a list of custom objects, with a geom ...
user avatar
  • 1,033
1 vote
0 answers
208 views

Why does PSQL ignore spatial index in "where NOT ST_Contains", but uses in "where ST_Contains"?

I'm creating a new table of trips in my PostgreSQL/PostGIS database, where trips are comprised of a series of individually identified points, based on where the points within each trip are. The idea ...
user avatar
10 votes
1 answer
674 views

Determining which QGIS layer has spatial index

I would like to loop over all layers within a QGIS project and determine which layer don't have a spatial index and cause QGIS to slow down. I tried the method hasSpatialIndex() but this always ...
user avatar
1 vote
0 answers
94 views

PostGIS query to retrieve geometry that intersects both a bbox intersects and also matches other columns

I am relatively new to GIS, so have been searching around to try find a similar case to the one I am facing but have come up short. Specifically I want to store multiple sets of geometry features in ...
user avatar
  • 111
-2 votes
1 answer
2k views

SQL Server how to create spatial index? ( spatial query )

I know how to do spatial query, Shape is my geometry type column. bbox is well know text format of a bounding box srid = 2229, you must specify this srid in where intersect clause ...
user avatar
  • 1,422
2 votes
1 answer
212 views

Query Geopackage using spatial index in QGIS DB manager

I would like to do spatial join in QGIS DB manager on geopackage database. The query should look like this select * from Soil_C_cadaster a, (select * from Soil_C_cadaster where forest_c is null) b ...
user avatar

1
2 3 4 5