Questions tagged [postgresql]
PostgreSQL is an open source object-relational database system.
515
questions
5
votes
3
answers
2k
views
What does the values in column clazz (osm2po) mean?
I have a given table in postgreSQL with OSM data which is used for routing purposes in Java with PGRouting. There exist two columns which I don't understand. They belong to osm2po. They are labeled ...
5
votes
4
answers
10k
views
Take from multilinestring the start and end points
I have to use the A* algorithm and my geometry is in multilinestring and I want to take stratpoint(x1,y1) and endpoint(x2,y2) .
I use this queries but the columns after the execute is still empty
...
4
votes
1
answer
1k
views
ST_LineMerge to simplify road network
I am trying to simplify my road network by finding all segments that touch 2 other lines with a common attribute, join_id and street, then doing a st_linemerge. I do NOT want to merge lines where ...
4
votes
1
answer
474
views
PostGIS - Linestring doesn't contain a Point - Problem
I have a problem to check if a Linestring contains a Point.
I consider the straight line y = 0.1 x , and take by it a segment l='Linestring( 0 0 , 4 0.4 )' and a Point p on segment l, p = 'Point(1.5 ...
4
votes
1
answer
1k
views
Error editing 'editable' view in QGIS
Taking some code from this post, I've been trying to create an 'editable' view in PostGIS.
I'd like to store label placement properties in a separate table, build a view of the data I want to use for ...
4
votes
2
answers
2k
views
Writeogr to PostgreSQL/PostGIS database with R
I'm producing some Spatialpolygondataframes with R that I would like to upload to my PostGIS Database. I've found out that the way to do this is via the writeOGR() function using the PostgreSQL driver....
4
votes
1
answer
943
views
Clip overlapping polygon in equal sharing size
Within single shapefile I am trying to clip overlapping polygons to their boundaries using centre line of overlapped area using Postgis or ogr2ogr.
I tried to use ogr2ogr command to remove slivers
...
3
votes
1
answer
435
views
How to run a moving window function in a conditional statement in PostGIS for buffer artifact removing?
I try to remove the artifacts which occur when running the ST_Buffer function in PostGIS PostGIS 2.5.1 (See picture). For this case I wrote a function that should loop trough every segment (row) and ...
3
votes
2
answers
5k
views
Searching planet_osm_point by longitude and latitude
I used osm2pgsql to import data into my PostgreSQL database and it put gave me the following 4 tables, planet_osm_point, planet_osm_line, planet_osm_polygon and planet_osm_roads.
I have looked at ...
3
votes
1
answer
1k
views
From QGIS 3.4.5 and 3.6 asks password repeadly to connect to PostgreSQL 10 [closed]
Action: At first time when opening project on QGIS 3.4.5 and 3.6 versions needs credentials to connect to PostgreSQL DB.
Problem: But after that when connection is success with correct credentials ...
3
votes
1
answer
1k
views
PostGIS combine ST_DistanceSphere with Nearest Neighbor search
I have two tables both have point geometry with SRID 4326 (WGS84)
I need to find the nearest point in 1 table to every point in another table
PostGIS KNN search is written
t1.geometry <-> t2....
3
votes
1
answer
558
views
Speedup function to calculate distance from centroid of building to river segment in PostgreSQL
I am trying to measure the distance from the centroid of a building to a river segment using the following function.
CREATE OR REPLACE FUNCTION river_foo_mapper () RETURNS trigger LANGUAGE plpgsql AS ...
3
votes
2
answers
7k
views
How to install PostgreSQL 9.2 with PostGIS 2.0 on Ubuntu 11.10 (or higher)?
I have read this question: https://dba.stackexchange.com/questions/25033/install-postgis-v2-for-postgresql-v9-2, but it didn't resolve my problem.
I added the PostgreSQL backports PPA and installed ...
2
votes
1
answer
333
views
ST_Distance does not give nearest node
I am trying to find the nearest point on the road network closest to a given point. I imported the road network into PostGIS from QGIS and am using the SQL window in QGIS DB Manager to query the road ...
2
votes
1
answer
386
views
How to snap points to line
I am having a table lines being MULTILINESTRING (2 Dimensions) and a table points being MULTIPOINT (3 Dimensions). The two are in the same CRS.
Now, I am trying to snap all the points to the closest ...