PostgreSQL is an open source object-relational database system.

learn more… | top users | synonyms (1)

2
votes
1answer
55 views

Inserting union of two tables into another table Postgresql

I am working on a research project. I have two tables, one of a polygon that represents a severe weather risk area, one that represents the US. I want to merge them into one output polygon. I am stuck ...
1
vote
1answer
41 views

PostgreSQL : question about SELECT .. WHERE .. = max()

If you have, for example; SELECT * FROM data WHERE line = min( (SELECT length FROM lines) ) AND number < 500; (It's just an example, not a real code) How does PostgreSQL react when the ...
2
votes
2answers
53 views

Change from polygon to multipolygon in postgres

can somebody describe please how to do the transformation from polygon to multipolygon in the postgres DB, is not possible for me to save my edited data. All data loaded just need to do some editing ...
1
vote
1answer
28 views

Does the psql prompt have a working directory in the file system?

I am learning postgis. This tutorial says "Navigate to where you downloaded the shapefile." Does that mean navigate to this location in the #psql prompt or navigate to this location with the $propmt? ...
4
votes
2answers
141 views

How to speed up a query for nearest linestring to point data

I have processed a Strahler stream order layer with a lot of river linestrings (type: Multilinestring) and their corresponding strahler number (see information here). Besides I have a point layer. I ...
2
votes
0answers
31 views

PostgreSQL : Question about dropping tables inside funtions

I am writing a PostgreSQL code where I have a function wich is used multiple times in a single query with different input values. Inside the function I create some tables and use them. What is the ...
0
votes
0answers
109 views

Problems moving POSTGIS database from postgresql 8.3 to 9.3 using Navicat

I am using Navicat 11 to move a POSTGIS database from 8.3 to 9.3 on Mac OS X 10.9. I have installed PostgreSQL 9.3 and PostGIS with homebrew (brew install postgresql postgis) and everything looks ok. ...
0
votes
0answers
32 views

PostGIS : check if 2 lines are at contrary sides of third line

I am looking for a workflow to select a line on the condition that it is located on the contrary side of a middle line. So there are 3 lines (2 are given, 1 I want to select). I don't need you guys ...
1
vote
1answer
76 views

CartoDb - Aggregate and Infowindow

I'd like to use CartoDb to map historic addresses of a city (link to demo). Individual addresses are mapped as points on the map. Detailed information for each address point should be displayed in the ...
1
vote
0answers
48 views

Do ArcGIS clients that direct-connect to postgresql/postgis databases override configuration settings?

I went in to modify some settings on a Postgresql database via the PGAdmin config editor and some of the settings don't have their default values and they are higher because they've been overridden ...
2
votes
1answer
95 views

PostGIS : I want to use ST_OffsetCurve with MultiLineStrings

I need to use the function ST_OffsetCurve for a multilinestring, but PostgreSQL gives me the error that the function is only for Linestrings. Is there a way arround? I want to use the function ...
2
votes
1answer
65 views

Length of a line within a surface

I need to find out the lengt of each line within a surface. I have approx. 20'000 diferent lines and around 10'000 different surfaces. what kind of SQL-sentences do I need to use? I've tried things ...
0
votes
2answers
150 views

GeoServer create layer from PostGIS (data type point)

(Several days ago a user on gis stackexchange suggest that I should use OpenGeo (I was using geojson before). I succeed at what I was doing at that time, but now I have a different problem.) I was ...
1
vote
2answers
66 views

Is it possible to run a spatial query in QGIS 2.0 across multiple layers using a user-specified radius from a point?

I would like to be able to click on a point on a map to select all vector features (from multiple layers) within a specified radius of the point. Can anyone point me in the direction of how to do this ...
1
vote
1answer
74 views

Update postgres/postgis point data attribute from another enclosed polygon shapefile in QGIS

I have a placename point table in postgis with 'district' column. a districts polygon shapefile with district name in 'Name' column. See the image below. I would like to update the 'district' ...
5
votes
2answers
2k views

PostGIS ERROR: could not load library “/usr/lib/postgresql91/lib64/postgis-2.0.so”

OS is openSUSE 12.1, PostgreSQL - 9.1, PostGIS - 2.0. Postgre/PostGIS are installed from Application:Geo repository. After recent updates when I try to connect to my database I get the following ...
1
vote
0answers
40 views

How to define Z dimension on table with PostGIS for import in TileMill?

I'm trying to reproduce the idea behind this blogpost from Mapbox, but with other data, for example the ne_10m_populated_places_simple dataset from Natural Earth. By adding a z-dimension to the data ...
2
votes
1answer
42 views

ST_ZMax() does not exist in PostGIS

I'm trying to follow this example on Mapbox blog, about using 3D shapes in PostGIS. The database-query is this: DROP TABLE tilemill_buildings; CREATE TABLE tilemill_buildings AS SELECT ogc_fid, ...
1
vote
0answers
203 views

QGIS loads PostGIS layers but DBManager can't connect

DB Manager can't connect to PostgreSQL, but "Add PostGIS Layer" can. My eventual goal is to save created layers to PostGIS. I assume I can do this using the DBManager Tool. I can alternatively use ...
2
votes
1answer
82 views

PostgreSQL : total length of roads in polygon

I have 2 tables : wgo (lines) and wbn (polygons) With this code, I can display the length of each road inside a polygon. If I have a polygon with 2 roads in it, as a result I get 2 rows with the 2 ...
2
votes
1answer
162 views

PostgreSQL : finding all lines intersecting with a polygon

I am totally new in the world of GIS but as a student surveyor I am working on a project using postgreSQL and PostGIS. I have one database with all the roads of my country (lines), and one database ...
2
votes
2answers
175 views

Postgres Log Error

I am using Geoserver + GeoWebCache + Postgres for an application. On the application side there is no bugs but on postgres I am getting this log. Please explain and help me to solve this ...
1
vote
1answer
65 views

Scaling CartoDB to multiple machines

I'm interested to scale CartoDB installation to multiple machines to distribute computational resources. We start using torque with some big tables (more than 5 to 10M points) and the processing for ...
0
votes
0answers
57 views

pgrouting shortestpathfromAtoB multiple pairs

I've got to solve a shortest path problem between multiple location pairs. E.g.: A to B C to D E to F etc. These pairs are stored in a table routing_basis like hkey; A; a.lat; a.lon; B; b.lat; b.lon ...
1
vote
0answers
114 views

How do I catch PostGIS/PostgreSQL RAISE messages in QGIS?

I have a trigger set up in PostGIS/PostgreSQL which will show a RAISE WARNING when an inserted or updated polygon is within a certain distance of some predefined planning constraints. I want this ...
0
votes
2answers
46 views

How to set the tolerance value in pgr_createTopolgy function of pgrouting?

I am making a map based on the floor plan of a building. I made the shapefile and added it to the postgresql database. I created the topology for the map using the following code: SELECT ...
2
votes
1answer
198 views

Postgresql table won't display in QGIS 2.2

I just downloaded QGIS 2.2 to check it out and now one (just the one) of the tables from one of my PostgreSQL database won't display. It loads just fine in 2.0. The records are all there (there's ...
1
vote
2answers
301 views

Stuck in loading raster to PostGIS

I am running running Mac OS X (10.7.5), PostgreSQL (9.2) and PostGIS (2.0.2) (installed via Postgres.app). The PostGIS extension seems to work perfectly with vector and raster layers. Once I enable ...
1
vote
1answer
73 views

PostGIS ST_Within returns zero data

I am using PostgreSQL 9.3.3 & PostGIS 2.1.1 and I have a table Entries which has a column called "latlng" of geographic type (this column stores entry's latitude and longitude coordinates). I am ...
0
votes
1answer
140 views

Solving flagrant shared object errors when compiling postgis 2.1SVN from source on Ubuntu 12.04

I have spent the past few days of my life trying to figure out how to get postgis to function properly with a non-standard directory installation of postgres 9.3, but have been unable to resolve the ...
2
votes
2answers
79 views

how to Find n nearest lines for the given points from a collection of lines?

I have two tables, points and lines. For each point in point table, I want to find out nearest 3 points in the nearest 3 cables. I almost developed a query, but it is best suitable for single point, ...
13
votes
6answers
6k views

How to use ST_Intersection?

Here's a quick summary about what I'm trying to do: I have 3 tables in Postgres, 'a' and 'b', each have a Polygon column, and 'c' has a Point column. What I'm trying to do here is to get the ...
0
votes
0answers
40 views

Speed drastically reduced when including geometry, is there a way to improve?

-- EDIT: Issue is that the shape files being used are at too small of a precision and way too large, output was 488M total, looking for different source -- I'm having some speed issues with a complex ...
5
votes
1answer
272 views

Performance in calculating raster statistics in PostGIS

I'm trying to calculate raster statistics (min, max, mean) for each polygon in a vector layer using PostgreSQL/PostGIS. This GIS.SE answer describes how to do this, by calculating the intersection ...
7
votes
1answer
150 views

Replacing a corporate GIS [closed]

I'm looking at replacing our corporate GIS, this is the first time that I have had the responsibility of such a task despite my years of experience with the software as an end user. We will be ...
1
vote
1answer
84 views

Monitoring Geoserver for Production Environment

Is there any opensource server monitoring is available for Geoserver ? Like watchdog and nagios? Suppose if geoserver is stopped working whether mapmeter will automatically start it..Like the ...
2
votes
2answers
58 views

self intersecting polygon SQl

I am trying to write a sql to query one land parcel for intersections between itself. I can do this fairly easy in QGIS using topology checker but i don’t know why this does not produce the correct ...
3
votes
3answers
138 views

Open Street Map: converting to country -> administrative unit -> city database

To moderators: If you think this question is too broad, please point me into right direction before closing, I'm desperately looking for help. I'm stuck on my task and I don't know what to do. The ...
0
votes
2answers
49 views

how to specify -t critical dowloading raster with raster2pgsql

I'm trying to download a raster into postgres/postgis. So far I wrote: raster2pgsql -s 3006 -I -C -M -R filename.tif -F -t 463.313x463.313 schema.rastername | psql -h localhost -U postgres -d db ...
4
votes
2answers
639 views

Import large CSV file into PostGIS

I am trying to import CSV files into PostGIS. Following this post, I have created tables before. I found other suggestions saying that I can run the copy command. If I run this command: COPY table ...
0
votes
0answers
18 views

Postgres self self intersecting polygons and error

I have a land parcel which has self intersecting polygons and I am trying to create a view to select all the distinct polygons but sql query does not generate correct results. The polygon has 500 ...
1
vote
1answer
55 views

How to make osm2pgsql import a tag?

I loaded OSM data into PostgeSQL with Osmosis&Osm2PgSQL, and see many tags are missing. I need to make it import lanes tag. How can I make it save this tag too? edit: my solution was to copy ...
1
vote
1answer
58 views

Problem with runing a loop in a query in PostGIS

I am new to PostGIS and I have a question which can't solve. I have a table of buildings each having a value for number of people living in it. I would like to calculate the total value (sum of number ...
1
vote
1answer
98 views

Problem with nested query in PhP and PostGIS

I have a simple problem regarding a nested query. I would like to select all buildings in a given circular buffer and create a kml file of those selected objects. The following query does the job very ...
2
votes
3answers
123 views

Problem with result of query in PostGIS

I run the following query and irrelevant of the point coordinates and radius I always recieve all the records of the table I'm querying. Can anyone point out what the problem could be with this query? ...
0
votes
2answers
99 views

Installing QGis such that it will work with the Postgres.app implementation of PostgreSQL on Mac (Lion) (open to alternative implementations)

I just got a new mac and am getting everything installed on it (postgres, postgis, qgis, grass, gdal, brew, ruby, etc) and am about to install QGis. QGis is a great tool for me, except for that with ...
1
vote
1answer
126 views

ST_Transform not converting from utm to lat/lon

This line: ST_AsText(ST_Transform(the_geom, 4326)) Returns the "coordinates" as utm coordinates. Although, I thought ST_Transform was supposed to convert the coordinates from utm to lat/lon. I ...
-3
votes
2answers
61 views

How can i create the spatial queries in QGIS? [closed]

please, Help me. i'll really appreciate your answers.
19
votes
1answer
6k views

How to change the SRID of exisisting data in PostGIS?

While importing my shapefile data to PostGIS, I did not select the proper Projection. How do I now change the SRID of the data, without transforming the Coordinates?
2
votes
1answer
111 views

How to write a new layer to PostgreSQL from QGIS plugin

The PyQGIS cookbook states that QgsVectorFileWriter can write vector layers to any format supported by OGR: https://www.qgis.org/en/docs/pyqgis_developer_cookbook/vector.html#writing-vector-layers ...