Skip to main content

Questions tagged [postgresql]

PostgreSQL is an open source object-relational database system.

19 votes
2 answers
20k views

Finding the closest Geometry in PostGIS

I've been looking over the PostGIS "API" of functions, and I notice that most of them take two elements to compare. For example, the ST_Distance function takes two geometry/geography elements to find ...
Jmoney38's user avatar
  • 628
19 votes
1 answer
11k views

What is difference between ST_DWithin and ST_Distance for proximity search in PostGIS?

I have records stored in a table with latitude/longitude coordinates stored in a geometry field. I want to find all records nearby a user supplied reference point. Note "nearby" probably means less ...
User's user avatar
  • 1,233
15 votes
2 answers
20k views

Multipoint vs point PostGIS

Is it normal to use the geometry type 'multipoint' instead of 'point' knowing that I use it to store only one point? How can I convert from multipoint to point?
Youssef's user avatar
  • 375
13 votes
1 answer
5k views

How to perform a spatial join of point and polygon layers in PostGIS?

I have a point dataset representing households that I want to associate with a parcel layer (i.e. assign its parcel_id). With ArcMap, I could spatially join the polygons to the points and specify that ...
ako's user avatar
  • 1,974
11 votes
1 answer
4k views

ST_Union fails with TopologyException despite valid polygons and using ST_SnapToGrid

I am working with Postgres 9.6 and PostGIS 2.2.2. These are my tables: Table "public.allparcels" Column | Type | ...
Richard's user avatar
  • 3,299
10 votes
1 answer
5k views

How to create linestrings with a definite angle and length, that are fixed to a point

I want to create linestrings with a definite angle (e.g. 160°) and length (e.g. 2m) that are fixed to a number of points of another linestring. So, I want to use the ST_DumpPoints function to find the ...
Stefan's user avatar
  • 4,434
9 votes
10 answers
16k views

PostgreSQL Shapefile import failed

I am very new to PostGIS/PostgreSQL. In fact, I downloaded it because of the answers I got to this question: Distance between centroid and farthest point of polygon I installed both PostgreSQL and ...
Divya's user avatar
  • 285
9 votes
2 answers
13k views

What Spatial Reference System do I store Google Map's Lat/Lng in

I am new to PostGIS, Spatial Reference Systems and projections and want to store lat/lng coordinates retrieved from Google Maps and Openstreetmap and its services like the Geocoder/Nominatim. I'm ...
Nyxynyx's user avatar
  • 1,687
9 votes
4 answers
11k views

Querying points inside and outside of polygons?

In PostGIS I have two tables: Table that contains polygons: table a.provinces gid | geom | name | ------------------------------ 1 | 010604 ... | Champagne | Table that contains ...
vayacondios2015's user avatar
8 votes
1 answer
1k views

Loading QGIS project from database using PyQGIS

I am trying to open a QGIS project that is saved to the database (Project -> Save to -> PostgreSQL) by means of Python script. I find a similar way to open project which is saved to the desktop ...
Madhu's user avatar
  • 111
6 votes
1 answer
3k views

ArcMap error drawing postgis layer - The number of points is less than required for feature

I have one big polygon called huc and a multilinestring called streams, I am running an intersection on between the two layers to clip the streams to the huc. here is what I have so far drop table ...
ziggy's user avatar
  • 4,536
6 votes
3 answers
1k views

Prevent export to shapefile from PostGIS table in QGIS

I have created a centralized database using PostgreSQL and created multiple users assigned with different roles i.e. SELECT, UPDATE, MODIFY and DELETE etc. Example: CREATE USER hasan WITH PASSWORD '...
Shahzad Bacha's user avatar
6 votes
3 answers
6k views

Using ST_split to split a line feature using nearby points

I have a line shapefile and a point shapefile, and the line has just one segment and its attribute table, the point shapefile has points near the line above, not on it and the close look, I want ...
Heinz's user avatar
  • 1,555
5 votes
1 answer
2k views

Editing PostgreSQL geodatabase table using ArcPy?

I'm trying to update a table using a python script and it's not working. The table resides in a postgres geodatabase and is versioned. I have also verified my user permissions (I'm the admin). The ...
ShaunLangley's user avatar
5 votes
1 answer
3k views

QgsDataSourceuRI and left outer join

I'm trying to load data from different tables using left outer joins into a QgsVectorLayer. The approach I'm following so far is the one from the developers cookbook here. The underlying database is ...
werkuh's user avatar
  • 327

15 30 50 per page
1 2 3
4
5
35