Skip to main content

All Questions

Tagged with
1 vote
1 answer
56 views

Why do I need to use quotation marks ("") to call a table in PostGIS? I remember not to need it in other exercises [closed]

When I try to run the following code I get an error that disappear when I call the tables using quotation marks. I remember having run tables before without it. select cine as INE from "...
user's user avatar
  • 153
3 votes
2 answers
116 views

Update fields in table in PostGIS database by joining attribute by field value from a layer

I have a table in my PostGIS database. Its geometric objects I loaded in to my QGIS project as layer where I can edit them. In this layer (layer A) there are features with null values in some fields. ...
CruiseLee's user avatar
0 votes
0 answers
20 views

How to add multiple shapefile into a single table in PostGIS? [duplicate]

How to add multiple same geometry shapefile (such as polygons) into a single table in PostGIS? For example: test_1 is a shapefile (polygon) test_2 is a shapefile (polygon) test_3 is a shapefile (...
Hasan's user avatar
  • 55
4 votes
2 answers
632 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 ...
Theo F's user avatar
  • 1,839
0 votes
0 answers
21 views

How to read postgres sql Table (No geometry) in PYQGIS? [duplicate]

In my database there is a table without geometry. how to read that from from pyqgis. self.uri = QgsDataSourceUri() self.uri.setConnection(self.Hostname, self.Portid, self.Dbname, self.Username, self....
Velugoti Venkateswarlu's user avatar
1 vote
1 answer
509 views

Table to Distance Between in PostGIS

I am a new user in PostGIS. I need to create a table with the ID_DIR of table A, ID_SQ of table B and have a new column called "Distance" that would be the distance between the ID_DIR and the ID_SQ in ...
Marcelo Esteban Lagos Bustaman's user avatar
1 vote
2 answers
119 views

Breaking lines in PostGIS?

I have a roads table and I want to break the lines in the intersections like the v.clean tool from GRASS (I'm talking about how the break tool in the parameters works). How can I do the same process ...
Cartocarlos's user avatar
1 vote
2 answers
485 views

Optimising a PostGIS table

I've been uploading a huge amount of contour information to a PostGIS / PostGres table. Uploaded using QGIS' db manager to a separate table a chunk at a time, and then using a quick bit of SQL to ...
user25730's user avatar
  • 904
2 votes
2 answers
12k views

Limit the number of rows allowed in a table in PostgreSQL [closed]

I would like to set a maximum number of rows on a PostgreSQL table. I want users to be able to delete and recreate rows if need be; but there should never be more than x rows in my table. Is there a ...
Mefimefi's user avatar
  • 586
2 votes
2 answers
2k views

Selecting points within buffer using PostGIS?

I have approx 73,000 locations. For each location, I need to know which of the other locations is within a 1km radius from it. I would like this result to be in a table (so perhaps using a PostGIS ...
Mitchell's user avatar
1 vote
1 answer
376 views

Convert PostGIS raster table into DTED2

I've the following table in PostGIS -- Table: public.elevation_data -- DROP TABLE public.elevation_data; CREATE TABLE public.elevation_data ( rid integer NOT NULL DEFAULT nextval('...
Jepessen's user avatar
  • 209
5 votes
1 answer
418 views

How to adapt a PostGIS query to modify the input table instead of creating a new table?

I use the following SQL query to create a table that contains dissovled polygons of an existing table: -- Schema: public -- Table: t_union -- Input table: input_table CREATE TABLE public.t_union AS ...
eclipsed_by_the_moon's user avatar
1 vote
0 answers
398 views

ST_Instersects and Join result to new table

I am having two tables, table1 and table2. I want to know which parts of table2 intersect with table1. Having that information, I want to write the attributes from table2 into table1 (where they ...
four-eyes's user avatar
  • 3,398
2 votes
1 answer
526 views

How to set my ESPG to geography POINT in PostGIS?

I'm trying to create a table into my PostGIS 2.3 CREATE TABLE destinations ( id serial PRIMARY KEY, sector integer REFERENCES sectors(id)...
Jordi Nebot's user avatar
2 votes
1 answer
997 views

Nearest Neighbour function

I'm trying to create a function which calculates the nearest neighbors under a certain length in a table s_1 an stores them in an output table. This is what I've got so far: CREATE OR REPLACE ...
K_Man's user avatar
  • 316

15 30 50 per page