PostgreSQL is an open source object-relational database system.

learn more… | top users | synonyms (1)

0
votes
0answers
11 views

How to create a table with data from other tables in Postgis

How to create a table that can extract data from 6 other tables that have the same fields? Also how to add new fields? The output that I'm looking for is something like X coordinate | Y coordinate | ...
1
vote
0answers
9 views

Import a shapefile to postgis with ogr2ogr gives: Unable to open datasource

I want to use ogr2ogr in order to import a shapefile in a postgis database. I have successfully installed ogr2ogr and I run from the pgsql the following command: ogr2ogr -f "PostgreSQL" ...
0
votes
1answer
14 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 ...
3
votes
2answers
54 views

PostGIS crosstab on multiple point tables

I have several point tabels, lets say 3. Tables are alike with two columns: a integer value and a geometry like: table sand1 (value int, geom geometry) table sand2 (value int, geom geometry) table ...
0
votes
0answers
16 views

run shp2pgsql command in c# application

I worked for a month on this command but in vain ; really if someone already tried to help me find the error , because when I load the application displays the message to me as the shapefile was ...
1
vote
1answer
37 views

Where to use the shp2pgsql commands?

I need to upload some very large tables (over 10Gb) into Postgis so I actually found this link What is the best hack for importing large datasets into PostGIS? The DB manager is far too slow and only ...
0
votes
1answer
26 views

How to edit a table in order to count the number of points in the same location?

Using QGIS, I have a point shapefile that has multiple points with same coordinates across different locations. I need a count of those points. For example there are 15 features that have the exact ...
0
votes
2answers
26 views

QGIS error in merging large point shapefiles

While trying to merge 2 large point shapefiles using the merge shapefiles tool under the data management. These point files have over 20Gb and have the same coordinate system. Problem is, that the ...
1
vote
0answers
20 views

How to add fields to postgis layer loaded in qgis using python

I have loaded a layer from Postgis in qgis and I am adding the fields to the layer using the follo code snippet: canvas = qgis.utils.iface.mapCanvas() aLayer = canvas.currentLayer() field_name = ...
1
vote
1answer
46 views

Creating shapes/lines from geo coordinates in postgis

Following the suggestion from this topic I'm posting my question here. I have a table in postgres/postgis with geo data and I want to show them on map via qgis. Here is the table: city | street ...
1
vote
2answers
40 views

Show results of ST_Union in QGIS

Currently, I am working on SQL in PostgreSQL and I execute query of vector data by "ST_Union" function for the spatial data. Now, I want to access the result of query in QGIS 2.14, but I can't. Is ...
1
vote
0answers
11 views

I am using an example fracnsites to make a similar map but I don't under stand the ajax code?

I am using an example fracnsites to make a similar map but I don't under stand the ajax code? The example has js code: var map, fields = ["gid", "createdby", "featname", "feattype", "status", ...
1
vote
0answers
16 views

QGIS not loading default layer style from PostgreSQL database on startup

I have saved a vector layer style to my PostgreSQL database source. I then amended the layer_styles table record for the relevant layer by editing the styleqml field (just changed the outline_width ...
1
vote
0answers
41 views

Creating simple spatial database for loading GPX files? [on hold]

As an absolute beginner in this topic, I am trying to create a spatial database, and then import GPX files. I need it in order to parse those GPX files, and have tables such as "locations" or "stays" ...
0
votes
0answers
25 views

Problem with loop for pgr_Dijkstra

I try to use pgr_Dijkstra through Postgis and Pgadmin to find the shortest path in a network between a lot of nodes. So I thought I could to "automate" the process with a PLSQL query. Here is a query ...
0
votes
1answer
30 views

ST_Union or ST_Collect on PostgreSQL union result?

Newbie to PostGIS/Postgres. I have the follow query which returns me 2 GEOMETRYCOLLECTIONS. Is there a way within my current query to return one polygon? SELECT ...
0
votes
1answer
43 views

Geocoding addresses based on own reference data

I have a historical addresses dataset in form: |Name |Description | Where "Name" is a single field with house number, street name, city and country. I have digitised two georeferenced ...
1
vote
1answer
49 views

Lines from points in postgresql postgis

I have this table (all row aren't in order): time, id, latitude, longitude time is character varying and the format is: dd/mm/year hh:mm id, latitude and longitude are numeric I would create lines ...
0
votes
1answer
34 views

select neighbour polygons in sql

I have a database of few milion records (all houses in my country). Now I want to select all records who have a neighbouring record (a house next to it) and give this a status 'T'. Each record has a ...
2
votes
1answer
56 views

Displaying data from a partitioned PostgreSQL / PostGIS table is unacceptably slow in QGIS

I have two very similar datasets of 27 million polygons stored in PostgreSQL / PostGIS. One is loaded as a single table, with spatial indexes and regular indexes on key fields. The other is ...
1
vote
1answer
36 views

PostGIS with clause not using spatial index

This query uses the spatial index and it's quite fast: explain select a.the_geom from chicago_major_streets a, stormevents_locations_2014 b where ...
0
votes
0answers
19 views

PostGIS - raster coodinates - no result for negative values of GPS

I have data in raster and try to run this query WITH ref As ( SELECT (ST_SetSRID(ST_Point(-20.12, 51.50), 4326)) AS pt ) SELECT ST_Value(raw_data, 1, ref.pt) AS val_0 FROM model_data The problem ...
1
vote
1answer
37 views

Loading GML data into Postgres with ogr2ogr

I'm working with a new OS dataset, Highways Network, trying to get it loaded into Postgres and set up in some kind of usable state. I've loaded all the data already, but it seems some elements of ...
0
votes
0answers
17 views

Maximum likelihood Between 2 linestrings in Postgre?

I created a lot of linestring datasets and loaded them all in PostgreSQL, I want to compare said linestrings 2 by 2 using a maximum likelihood Query which would give me a coefficient proportional to ...
0
votes
0answers
15 views

Postgis load raster to DB running on AWS RDS with raster2pgsql

I want to perform very common task: I have Postgresql + Postgis running on Amazon Web Service cloud, using RDS service. I have there some vector layers and can execute SQL (Postgis) commands via ...
3
votes
1answer
54 views

How to use a polygon as a reverse cookie cutter on features in a Postgresql database

I want to be able to use a polygon in a database to remove all features and parts of features that falls within the polygon. Not as part of a query transferring the database to another database. I ...
1
vote
0answers
46 views

One way Replica deleted feature not synchronizing when I synchronize

I have created one-way replicas from 50 geodatabases to one geodatabase (Arcsde. With PostgSQL 9.2) After that, I update my feature class in parent geodatabase, but when I synchronize the replica the ...
1
vote
1answer
54 views

Postgres/PostGIS calculate area of Polygon in Square Miles

Polygon in Postgres/PostGIS database. It has the spatial reference 4269 which is in degrees. I know there is a ST_Area() to calculate it. this is my query to select the areas in the SRID units. ...
1
vote
1answer
39 views

Postgres st_intersection points/polygon

I am trying to use the ST_Intersection function to intersect points by county and find the counts by county, but I am having no luck. SELECT counties.name, FROM counties INNER JOIN routes ON ...
1
vote
1answer
23 views

Postgres/postgis st_makepoint

I am looping through a csv, taking latlng values and trying to add there geometry to postgis enabled postgres table. xy values are int's conn = psycopg2.connect("connected") cur = conn.cursor() ...
1
vote
1answer
50 views

Making selections from two tables based on the reference table in PostgreSQL/Postgis

Based on the address locations ad for the region of interest (as a reference), I am trying to make selections from two street layers street1 and street2. What I have tried is shown by the code below: ...
0
votes
1answer
40 views

Python to Postgres insert Geometry syntax

Having trouble creating geom columns and inserting geometry lat lng values into postgres table Is my syntax correct in creating the point geometry fields? st_makepoint is the point constructor. ...
1
vote
0answers
23 views

Missing vector features when import from .sqlite to postgis?

I imported vector data from a .sqlite file to PostGIS but not all of my vector features imported. I haven't been able to determine a reason for most of the loss of features between the databases ...
-1
votes
0answers
18 views

Create a trigger for postgresql to populate a state field

We have a Postgresql SDE database that we would like to automatically populate certain fields in the attribute table when a new feature is added like State (based on location), user info and time. I ...
0
votes
0answers
18 views

Not able to edit PostGIS SDE featureclass in ArcGIS Standard

I have created an Enterprise geodatabase in PostgreSQL and now uploading OS MasterMap data using QGIS OS Translator Tool. The feature classes created are not editable, however if I create a blank ...
0
votes
1answer
25 views

lwgeom_to_geojson: 'PolyhedralSurface' geometry type not supported

I am using PostGIS (PostGIS 2.2.0 with SFCGAL extension) and I have data in postgres which is loaded using citygml2psql tool and it contains polyhedralSurface geometry. But when i run query : ...
3
votes
1answer
68 views

How to loop in PostGIS to add the next lat long to a route

I want to loop over the results of a query and then pass row(n)'s longitude, latitude and row(n+1)'s longitude and latitude to another function. I have a query which returns a set of coordinates from ...
0
votes
2answers
31 views

Proper handling in PostgreSQL/PostGIS only after many queries?

I am trying to analyze GPS data of a parade on a fixed route with a certain variance due to the urban surrounding (canyoning). I'd like to project the GPS waypoints to the nearest points on the route ...
1
vote
0answers
17 views

Swapping start and end points of line (i.e. direction) of LineString in PostGIS?

I know that postgis has the function to find the start and end point of a line. Is there a function that can swap the start point and end point? (Note: I do not mean literally changing the ...
0
votes
0answers
22 views

Problem to input a .osm file in a Postgres database with Osmosis

I have a problem with import a *.osm file to postgres/postgis database. I hope someone can help me? Ich have done the following things. install Postgresql/Postgis and pgAdmin III -> works fine ...
1
vote
0answers
46 views

importing shapefile in postgres

I am trying to import a shapefile to my database in postgres but there is no shapefile loader appearing in the plugin menu in PgAdmin. Postgis is definitely installed as I have added it as an ...
0
votes
3answers
64 views

How can i use WFS in Openlayers 3 with mapserver and PostGis?

I didn't find a documentation to display features ( vectors ) combining MapServer ( mapfile ) and PostgreSQL/PostGIS and OpenLayers 3 ?
3
votes
1answer
61 views

Are calculated fields available in any database that Qgis can use

I'm trying to find a data storage method that can handle up-datable calculated fields (such as population density=population/area). I want to be able to alter the population as the data changes (like ...
1
vote
1answer
46 views

How can rewrite this query for using with commonly used lat-long values

I have this query to get the nearest road vertices from a bus stop point. Ho can a re-write this query to pass commonly used lat-long values like in google maps instead of 715127 957625 SELECT * ...
3
votes
1answer
87 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
1answer
59 views

Why QGIS WFS doesn't update PostGIS line and polygon layers?

I installed PostgreSQL and PostGIS and created PostGIS layers in GeoServer. But when i want to change geometry in QGIS via WFS it drops an error: ": Error performing insert: java.lang.String cannot ...
1
vote
1answer
23 views

How to get the geometry of all tables in a postgresql database?

How can I return all tables geom?
1
vote
1answer
48 views

PostGIS ST_Difference function returns wrong geometry in result

I have a strange st_difference behaviour. I’ve got two overlapping lines (each one has two points), but st_difference result is complete geometry of the first line. The code to reproduce is here: ...
0
votes
1answer
22 views

Draw Map using JTS API And PostgreSQL database

I use PostgreSQL for storing data. I want to create map based on it using JTS. I want to create geometry object from list of rows. Such geometry object to used as draw polygon,point etc.
1
vote
1answer
19 views

GeoServer - layer is read only (it already has a primary key)

I created a simple table in my Postgres\PostGIS DB. I then created the GeoServer layer with the SQL: select * from tablename I'm trying a WFS Transaction, like I usually do (and it works on similar ...