Questions tagged [spatial-index]

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

42 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
0answers
209 views

Defining partial or complete overlap with QgsSpatialIndex

I'm working on adding some functionality to a QGIS plugin. It currently uses a QgsSpatialIndex to efficiently compute whether the features of a vector layer intersect (potentially millions) of ...
6
votes
0answers
73 views

Calculate volume of space defined by multiple overlapping 3D polygons

I have thousands of 3D polygons scattered in space but they mostly overlap with many of their neighbors in big extent. Is there any way how to compute volume they define effectively? I would love ...
4
votes
0answers
262 views

When does a QGIS .qix spatial index of a shapefile need to be re-created?

I understand the basics of spatial indexes but would like to understand when exactly a spatial index would need to be re-created or updated? The reason I ask is because when a folder was moved to a ...
4
votes
0answers
93 views

Speed up identify in QGIS

I have just transferred my Postgis database onto an RDS server, and there is a bit of a performance hit when using the Identify tool in QGIS (3) compared to localhost. I presume this is mostly network ...
4
votes
0answers
774 views

Creating Shapefile spatial index programmatically in .NET?

I am creating a shapefile programmatically using DotSpatial using the following example syntax / pseudo code FeatureSet features = new FeatureSet(DotSpatial.Topology.FeatureType.Polygon); features....
3
votes
1answer
128 views

Getting the largest rectangle in the R-tree index of a PostGIS table?

Is it possible to use SQL or PL/pgsql to get the largest rectangle in the R-tree index (or other types of indices) of a table, so that it can be used as Bounding box for PostGIS table? If possible, ...
3
votes
0answers
196 views

Geoserver ImageMosaic ignores existing datastore.properties (connect to PostGIS) and automatically generates index using shapefile

I am new to Geoserver. I am trying to publish a WMS service for a raster time series using the ImageMosaic plugin in Geoserver. I am using the sample dataset and instructions at this link I want to ...
3
votes
0answers
103 views

Most performant KNN method in postgis (<->, <<->>, st_distance)

My question is about the fastest way to order query results by approximate distance. I've seen conflicting information about this. My data are lat/lng points stored using WGS84 (SRID 4326). The ...
3
votes
0answers
225 views

PyQgis - How to update a spatial index?

I am trying to speed up a QGIS plugin I wrote by adding a spatial index to a vector layer. The aim of my plugin is to simplify a line network by merging some of its features, based on some criteria. ...
3
votes
1answer
123 views

Match housenumbers on buildings (special case of point-in-polygon-test)

Task with example I'm working with geodata (country-size) from openstreetmap. Buildings are often polygons without housenumbers and a single point with the housenumber is placed within the polygon of ...
3
votes
0answers
2k views

How do you view the current spatial index grid size for a file geodatabase feature class?

I am receiving an "The spatial index grid size is invalid." error during a copy/paste of polygon features in ArcMap and I successfully corrected it with AddSpatialIndex. But in an effort to figure out ...
2
votes
0answers
47 views

PostGIS runs out of memory due to the use of spatial index

I am running this query on PostgreSQL. CREATE TABLE table3 AS (SELECT t1.id FROM table1 AS t1 CROSS JOIN LATERAL (SELECT t2.geometry AS geom_closest FROM ...
2
votes
0answers
247 views

SP-GiST for geography type in PostGIS

This CREATE INDEX geography_gdx ON schema.table USING GIST (geog); works, but CREATE INDEX geography_gdx ON schema.table USING SPGIST (geog); gives me [42704] ERROR: data type geography has no ...
2
votes
0answers
239 views

Optimizing MySQL query to select all points with in a large polygon using spatial indexes

Re-posting it from stackoverflow as per their suggestion. Link to the thread in stackoverflow https://stackoverflow.com/questions/53182385/optimizing-mysql-query-to-select-all-points-with-in-polygon-...
2
votes
1answer
203 views

QGIS3 Creating spatial index in a standalone script as a part of output vector layer

I am making a buffer analisys in a standalone script. Is it possible to automatically during the analisys add index to the output vector layer (".qix" file)? I tried to add after the analisys like in ...
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
0answers
107 views

Adding Spatial Index for Geometric Network?

I am trying to create Spatial Indexes on all the feature classes in one of my databases. It has worked fine on most feature classes so far, but when I started on feature classes in a feature dataset ...
2
votes
0answers
204 views

display issue in qgis 2.14 : features appear and disappear

I have several virtual layers in my project. One of them contains 6 lines. Depending of the scale, at least one line disappears from the canvas for an unknown reason. I heard that sometimes, creating ...
2
votes
1answer
101 views

In memory spatial index for frequent updating point objects

Is there any in memory spatial index specialized for frequent updating point objects? The dataset will be moving cars, most likely update per second but with millions of them. The project will be ...
2
votes
0answers
771 views

Using a ShapeFile spatial index with ogr2ogr and ogr.DataSource.ExecuteSQL()

I created a spatial index foo.qix for a foo.shp with ogrinfo -sql "CREATE SPATIAL INDEX ON foo" foo.shp However, when I do a query with ogr2ogr and look at it in strace, it doesn't use that index: ...
2
votes
0answers
316 views

Destroying spatial index using PyQGIS?

QGIS 1.9 Is it possible to destroy a spatial index? I am noticing that if I generate a spatial index on a set of polylines (within a plugin), split one of the lines, and then recreate the spatial ...
2
votes
0answers
324 views

GeoDjango and spatial indexes

I have three questions about spatial indexes management in GeoDjango, and I can't find the answers in the documentation. First, I know GeoDjango creates a spatial_index for a geometry field by ...
2
votes
0answers
340 views

Adding multiple layers to Tilemill from a single sqlite DB

This is a repost of a question I had over at the MapBox support board. Since I wasn't having much luck over there, I'm hoping I would have better success here. I'm having trouble adding more than a ...
2
votes
0answers
719 views

Spatialite, to speed performance, when should I create Views, Indexes or additional spatial tables?

I’ve got a large Spatialite database with a table of lines (roads, rail and water). I created a spatial index of the geometry to speed things up. This works amazingly well when I’m zoomed in close....
2
votes
0answers
278 views

How could I make this PostGIS query run faster?

SELECT st_band(rast, 1), st_width(rast), st_height(rast), st_bandpixeltype(rast, 1), st_bandnodatavalue(rast, 1), st_scalex(rast), st_scaley(rast), st_upperleftx(rast), st_upperlefty(rast) FROM public....
1
vote
0answers
67 views

Speed up PostGIS raster query

I have a simple PostGIS table as follows: \d rad; Table "public.rad" Column | Type | Collation | Nullable | Default ...
1
vote
1answer
58 views

Multiprocess Spatial Join with Spatial Index

I'm a newbie in implementing GIS on Python, but the lack of any GIS software at the office has forced me to learn about it. I have a huge grid (a multipolygon) that I'm currently filling out with ...
1
vote
1answer
30 views

Finding Rows Inside other Rows

So I have database with which I want to do the following: Find out which other rows are contained within the geometry of the row in question. To keep it simple, I am finding the envelope/bbox of the ...
1
vote
0answers
45 views

PostGIS: Is it interesting to create an index on geom column and an alpha numeric field?

I would like to know if it's interesting to create an index on an other column than the geom one. In some cases, I would like to do spatial analysis. If not, I would like to analyse only attributes. ...
1
vote
0answers
234 views

QGIS does not seem to make use of spatial index when using GeoPackages

I have a QGIS project with several Geopackage-Layers. The project is quite slow in comparison to a project with shapefile or database layers. I started QGIS together with DebugView to find out what ...
1
vote
1answer
135 views

Distance between point and line layers & spatial index issue

I am trying to compute on QGIS the distance from some clusters (ie points) to their closest road (ie lines); no need for all combinations, just the distance from each cluster to the closest road. To ...
1
vote
0answers
201 views

When I should use Rtree/KdTree vs Morton z-index and s-curves?

I was always confused by those two families (?) of indexing. I feel that the first one goes with the "normal" data, while z-index and s-curves work the best for tiling/grid/uniformly distributed ...
1
vote
0answers
62 views

Spatialite Index not matching

I have a dataset containing GPS points I store in a table with a geometry column. I use the following code to populate my table. CREATE TABLE STOPS_GEO ( stop_id TEXT PRIMARY KEY, stop_desc TEXT, ...
1
vote
0answers
622 views

Using spatial index in spatialite query?

I posted this question originally Using nearest neighbor query in SpatiaLite? Using the answer given I was able to get the query working on some test data. However I am having trouble applying a ...
1
vote
0answers
98 views

Indexing GIS data associated with user with timestamp

I have data for each user in this format user1:(timestamp,lattitude,longitude) user1:(timestamp1,lattitude1,longitude1)..... Here the 1 at the end of timestamp/lat/long is to specify a different ...
0
votes
0answers
6 views

How to get index of specific location in IDL

I am trying to get the index of specific lat and lon in IDL. I know how to do it in python. tmp = tmp.sel(lat=lat_loc,lon=lon_loc,method='nearest') But I can't find a way to do so in IDL. Any ...
0
votes
0answers
30 views

Spatial index not speeding up spatialite query containing Multipoint Geometry Data?

I am querying a sqlite format geodatabase in which there is a label for each geometry shape. Think of data as : label = name of a district in your state geometry: polygon which specify the ...
0
votes
0answers
81 views

Spatial index for a raster column in a table in PostGIS

I have a raster table in PostGIS. When I run ST_SetValue(rast, geom , value) on it to change the pixel value at a point, it works very slowly. Do you know how can I create spatial index for a raster ...
0
votes
0answers
45 views

Transfer indexed Oracle geoloc table to PostgreSQL using ogr2ogr

I am copying tables using ogr2ogr from Oracle to PostGIS using ogr2ogr -f "PostgreSQL" PG:"host=<host> port=5432 user=<user> dbname=<dbname> password=<pwd>" OCI:<USERNAME&...
0
votes
1answer
52 views

Export NDVI values from chart as JSON in Google Earth Engine

After filter OLI8 for a small area var collectionFilter = ee.ImageCollection('LANDSAT/LC08/C01/T1_RT_TOA') .filterBounds(geometry) .filterMetadata('CLOUD_COVER','less_than',4) .map(app); print(...
0
votes
0answers
168 views

Storing a Spatial Index in Sqlite

I would like to store an r-tree or quadtree index in a sqlite database using python. Does anyone know if there is any code to do this? A bit of background: The dataset cannot be moved to another ...
0
votes
0answers
34 views

How to Drop Indexes on a Table in ArcCatalog

I am using an Oracle 11g database . The code below doesnt allow me to drop indexes on a table. import arcpy # Remove indexes and statistics for gis feature class delta tables COND=r'E:/...