Skip to main content
99 votes
Accepted

What is the purpose of PostGIS on PostgreSQL?

If you re-wound the universe to early 2001, and not only let the inventors of PostGIS see the future, but also let the PSC of PgSQL see the future, perhaps PostGIS would be a series of patches on ...
Paul Ramsey's user avatar
  • 19.9k
61 votes
Accepted

Setting up indexes for PostGIS distance queries

There are two keys to getting good geodetic query performance with large tables with geometry columns using WGS 1984 geographic data (SRID 4326): Use the ST_DWithin function, which searches using an ...
Vince's user avatar
  • 20.2k
34 votes

What is the purpose of PostGIS on PostgreSQL?

That's simply not true, PostgreSQL does not support Spatial data types. It supports geometric types. These are perfectly fine for some things, but they're totally separate from real world coordinate ...
Evan Carroll's user avatar
  • 7,111
15 votes
Accepted

Getting field index from input vector layer in PyQGIS

That method has been deprecated, use this instead to get the field index: fields = inEdges.fields() idxEdgeId = fields.indexFromName('fieldName')
artwork21's user avatar
  • 35.2k
8 votes

What is the purpose of PostGIS on PostgreSQL?

PostGIS is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL. SELECT superhero.name FROM ...
whyzar's user avatar
  • 12.1k
6 votes

Getting field index from input vector layer in PyQGIS

fieldNameIndex function was removed in QGIS3: Removed fieldNameIndex(), use fields().lookupField() or fields().indexFromName() instead You can convert your code as follows: inEdges = self....
barteksch's user avatar
  • 685
4 votes
Accepted

Solving the problem with the "Indexing data" window while editing

It's caused by snapping. I guess you could disable that. Upgrading QGIS might be the better option though, I'm quite sure it has been solved in newer versions. Update: Even when they turned off ...
Matthias Kuhn's user avatar
4 votes

Reclassify raster values continuously instead of assigning them to specific groups

I think you're looking for the Raster Calculator tool. It will let you apply an equation to each raster. What that equation is (i.e. what function defines the curved line in each graph above) you'll ...
ycartwhelen's user avatar
  • 2,417
4 votes

Indexing USGS Landsat Collection 2 Level 2 datasets into Open Data Cube

You can now index USGS data into the Open Data Cube using the command line tool STAC API to DC There are some notes on how to achieve indexing USGS Collection 2 data here. A brief howto is as follows: ...
Alex Leith's user avatar
  • 13.5k
3 votes
Accepted

Create shapefile from file.csv using python pyshp module

From the comments, it seems the issue was that the file was being output to an unknown location. To remedy this, modify the code as below to specify the output location. For example, if you want to ...
PhilippNagel's user avatar
  • 1,722
3 votes

Determining best neighbourhood search radius for Topographic Position Index (TPI) for predictive soil mapping?

There really is no expected for this unitless metric. The TPI is the delta of the focal pixel from the mean of the focal window. Obviously, the metric is sensitive to outliers and the larger the focal ...
Jeffrey Evans's user avatar
3 votes
Accepted

Subset raster stack with logical indeces R

Easiest way to do would be to convert the logical vector into which indices of it are true using... which: > s[[which(c(TRUE,TRUE,FALSE))]] class : RasterStack dimensions : 100, 100, 10000,...
Spacedman's user avatar
  • 65.6k
3 votes
Accepted

How to draw and index "trial plots"

Create Grid, point type Rectangles, ovals, diamonds. Create rectangles smaller than the grid spacing Add a field new id field, adjust first two lines and execute this in python console: layername = '...
Bera's user avatar
  • 76.3k
3 votes

GeoServer using read only database

That will be fine, if the indexes are missing it will just be even slower than Oracle usually is.
Ian Turton's user avatar
  • 82.7k
3 votes

Spatial index creation in GeoServer when adding PostGIS store

No, it is not, you have to create the spatial index when you import your data in PostgreSQL/PostGIS. See: http://postgis.net/workshops/postgis-intro/indexing.html
Andrea Aime's user avatar
  • 17.6k
2 votes

Solving the problem with the "Indexing data" window while editing

Just to confirm that in QGIS 3.14, this still persists (from a snapping-indexing perspective at least anyways).
nr_aus's user avatar
  • 3,596
2 votes

Solving the problem with the "Indexing data" window while editing

It can also be caused by Show Feature Count in the Layers Panel. Uncheck it, if it is checked.
Steven's user avatar
  • 190
2 votes

Determining best neighbourhood search radius for Topographic Position Index (TPI) for predictive soil mapping?

I would think that there are a number of factors to consider: Point Data Density Size of area to be mapped Intervening feature size to be ignored Available computing power vs available time Degree of ...
Steve Barnes's user avatar
2 votes

How would I determine my search radius when conducting a Topographic Position Index in SAGA GIS?

It is good you started to work with TPI on SAGA, since it is rare software which cares TPI's scale-dependent nature. In the poster linked below you will find answers. Andrew D. Weiss Topographic ...
Kazuhito's user avatar
  • 31.1k
2 votes
Accepted

Build a polygon raster as indexing grid with SQL

There are some posts around that mention functions for so-called fishnets. For instance: How to create a regular polygon grid in PostGIS? With that function you could do something like: SELECT name, ...
tilt's user avatar
  • 3,279
2 votes

indexes to optimize ST_Contains and ST_Overlaps for geoms in two tables

The issue was that a SEQuential search was being done through child, I added a subquery to trigger an index search instead of sequential search and now the query is 0.6s on average. Wow! My advice to ...
SPillai's user avatar
  • 131
2 votes

Changing The coverage Atlas layer

The scale of your map items is controlled by the size of your coverage polygons. Figure out what size polygon will give the desired scale on the size page you'll be printing. You can find this by ...
csk's user avatar
  • 25k
2 votes

Rebuilding indexes in file geodatabase using ArcPy

That method cannot be used on a file geodatabase, from the tool help document, see usage statement below: Data must be from a database or an enterprise, workgroup, or desktop geodatabase. This ...
artwork21's user avatar
  • 35.2k
2 votes

Reclassify raster values continuously instead of assigning them to specific groups

I didn't find how to put conditions with equations in the qgis raster calculator, so I wrote a tutorial to help you in ArcGIS. ArcGIS has free 21-day trial, he just needs your sign up (ArcGIS trial). ...
kvratto's user avatar
  • 41
2 votes

How to draw and index "trial plots"

The solution You can use a QGIS expression to number the polygons from 1 to N with a simple (well - a single, even if scary looking, but rather easy) expression that creates a new attribute with field ...
Babel's user avatar
  • 73.9k
2 votes
Accepted

Indexing Multi-Band images in OpenDataCube

This was not supported yet, as none of our own datasets came with multiple bands. I've added it in eodatasets>=0.23. An index param is now available for reading measurements: p.write_measurement(&...
jeremyh's user avatar
  • 246
2 votes
Accepted

Indexing Copernicus Global Land Service data into ODC

You may use the eodatasets3 library to index data hosted remotely, I've done it by indexing official Copernicus Global Land Cover data you can find in this S3 bucket (data access is documented here). ...
giob12's user avatar
  • 108
2 votes
Accepted

Extract the raster values for geometry using Python

I think the error is probably due to the fact you are using coordinates as indices. You need to calculate the correct indices using origin and pixel size. It is easier to use rasterstats: import ...
Bera's user avatar
  • 76.3k
2 votes
Accepted

GeoPandas geodataframe.cx() coordinate indexing not working for multipolygon

.cx doesnt clip the input geometry, it selects all rows/geometries that intersects the limits. So if one small polygon part of a multipolygon intersects, the entire multipolygon will be selected. You ...
Bera's user avatar
  • 76.3k
1 vote
Accepted

R: Annual composite based on the median: How to get the index of the original layer for each pixel?

In a median, if the number of cases in consideration is even, then the result is the mean of two middle results. As such, your which() will always return two values, hence you get two layers, one with ...
GreatEmerald's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible