PostgreSQL is an open source object-relational database system.

learn more… | top users | synonyms (1)

1
vote
2answers
887 views

How to perform SQL queries and get results from QGIS python console?

I'm writing a python script using QGIS API. I have to get results from postgres database table. The table has geometry field and other non-geometry fields. I want to perform SQL queries on ...
0
votes
0answers
26 views

OSM DataImported in to Postgres: What is the significance of “_gen0” and “_gen1” suffixed tables

Imported .OSM file to postgres/postgis (IMPOSM). Along with the table "osm_new_motorways" I see two more tables "osm_new_motorways_gen0" and "osm_new_motorways_gen1". Same is there for few other ...
-1
votes
1answer
40 views

Qgis 2.0 and conection with Postgres 9.3.2 [closed]

I tried conection with Qgis 2.0 with Postgres 9.3.2 but I was unable to do it. Is there anyone that help me Tks
3
votes
1answer
137 views

User locking postgres/postigs table without privileges

I have a PostgreSQL 8.4.4 database with PostGIS 1.4.2 and I am experiencing a problem where an external GIS system (using embedded CadCorp SIS 7.0) is connecting to the database and taking Access ...
1
vote
0answers
53 views

Reading lines within Bounding box failed

I am developing an application to display OSM data. In my scenario I need to display the data for one entire country. So my approach is that I will load curresponding countries osm data to postGreSQL ...
5
votes
2answers
354 views

How to check which version of GDAL do I have and how many?

I have installed in my computer and running the following software: PosgresSQL 9.3.2.3 PostGIS 2.1.1.1 QGIS 2.0.1 Dufour (this one installed through the OSGeo4w package) QGIS 1.7.0 Wroclaw I am ...
1
vote
0answers
55 views

PostGIS replace view crashes PostgreSQL server from ArcGIS script

I have the following script which when from ArcGIS (and a similar script from a QGIS plugin) will update a view. Every so often (around 1 in 5 times the script is run) it causes the PostgreSQL ...
2
votes
1answer
335 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
1
vote
1answer
124 views

Lost relation when importing from OSM to PostgreSQL with ogr2ogr

I am currently trying to import all administrative boundaries (countries, states, cities, etc) from OSM. I downloaded a small file from Geofabrik (Corsica), in order to run my tests. I understand ...
0
votes
2answers
51 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 ...
3
votes
2answers
179 views

Distance between Paris and San Francisco with PostGis (out of range coordinates?)

SELECT ST_Distance(gg1, gg2) As spheroid_dist, ST_Distance(gg1, gg2, false) As sphere_dist FROM (SELECT ST_GeographyFromText('SRID=4326;POINT(37 -122)') As gg1, ...
0
votes
0answers
52 views

Publish rasters stored in PostGreSQL with GeoServer [duplicate]

we are trying to publish some raster images stored in our Postgres database. First, they were generated from satellite images (spectral indexes). Then we uploaded them with raster2psql as tables. So ...
4
votes
2answers
356 views

clustering points in postgresql to create contour map

UPDATE: To try to make this a little more simple, is it possible to create a query which selects a group of points such that each point in the group is at most X units away from at least one other ...
0
votes
1answer
102 views

Can't create view in postgresql

I have a PostgreSQL table containing some point of interest data. I have a second table with overlapping continent polygons. The following code splits the POI into the continents, but instead of ...
-1
votes
1answer
176 views

Shortest Path Dijkstra

I would like to calculate the shortest path with dijkstra algorithm. sample query SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra(' SELECT gid AS id, ...
0
votes
1answer
95 views

How to cut/split multipolygon with blade (linestring) into two pieces using PostGIS? [closed]

I struggle to do split operation in postgis I tried to build a query but Im always fail. Id like to cut a multipoligon with a blade (a linestring) into two pieces. These two objects have specific ...
3
votes
1answer
276 views

Importing multiple shapefiles into single PostGIS table

I have a folder full of shapefiles that I want to import into a single PostGIS table. This table should have the following columns: id, filename, multipolygon I can bulk import all shapefiles using ...
3
votes
1answer
487 views

PostGIS intersection function

I have a problem with intersection function. I built my query following http://manual.linfiniti.com/en/postgis/geometry.html, 5.7 section. I made my clip object, a red linestring frame: But after ...
1
vote
1answer
171 views

Error: Coordinate values are out of range [-180 -90, 180 90] for GEOGRAHY type on Postgis?

when I run a query on Postgis select st_astext(ST_SetSRID(f.geom,4326) ),st_astext(st_centroid(ST_Transform(b.wkb_geometry,4326))) from a,b where ST_Distance_Sphere( ...
0
votes
2answers
1k views

PostgreSQL function does not exist

I have PostgreSQL 9.2 with Pgrouting extension, but when I want to call a function(pgrouting) does not work. Id like to compute the shortest path between two point. SELECT gid, AsText(the_geom) AS ...
1
vote
0answers
287 views

pgrouting php problem “pg_fetch_result(): Unable to jump to row 0 on PostgreSQL result index 3”

I'm trying to build a simple routing web-app using pgrouting, followed some tutorial and the latest workshop. Because I'm using PostgreSQL 9.3(x64), Postgis 2.1.1, and pgrouting 2.0 so I did some ...
2
votes
1answer
184 views

Case insensitive CQL-OpenLayers filter?

I have the following filter in OpenLayers 2.13 var filter_c = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.LIKE, property: 'p_name', value: ...
0
votes
0answers
44 views

How to force dropping a table/Index

I was working to import CSV Files into PostGres. CREATE TABLE NY(Name varchar,Latitude float,Longitude float); COPY NY FROM 'data/NY.csv' DELIMITERS ',' CSV; ALTER TABLE NY ADD COLUMN gid serial ...
3
votes
1answer
133 views

how to snap two line vertex in two different layers used in QGIS

I want to snap between two poly-lines from 2 different layers (Layer1 in Brown and Layer 2(postGIS layer) in Pink color- ), but my snap option don't work. I have changed the tolerance to different ...
0
votes
0answers
425 views

Indoor mapping with floor plans and item(s) to track

Warning: GIS noob here. Essentially I want to be able to create a floor plan for a given room. Consider the following image of a floor plan in image format: I would have the measurements of every ...
0
votes
1answer
56 views

Unsure what to do after running osm2pgsql

I must admit that I'm a noob when it comes to database administration, but I'm a little confused at the process of my getting my .osm.pbf file into tilemill. I've run the osm2pgsql process on a ...
1
vote
5answers
559 views

Problem installing PostGIS on Ubuntu Server 13.10

I've installed PostgreSQL 9.1 and postgis on Ubuntu Server 13.10 as follows: sudo add-apt-repository-ppa:ubuntugis/ubuntugis-unstable apt-get update apt-get install postgresql-9.1-postgis then I ...
0
votes
1answer
114 views

Does ora2pg support the SDO_GEOMETRY spatial type?

I've been searching the net up and down for days now and can't find a definite answer to this question, neither on google nor on the official page (http://ora2pg.darold.net/). Does ora2pg support ...
4
votes
2answers
576 views

SQL Syntax to extract (convert) Strings with Degrees Minutes to Decimal Degrees

I have a PostgreSQL/PostGIS database with a two string fields containing Lat and Long coordinates in degrees and decimal minutes, like this 45° 24.5' N 3° 43.01' E. How can I convert them into ...
0
votes
1answer
106 views

How to display data from multiple layers in OpenLayers? [closed]

I am new to using openlayers and Geoserver. I currently have a few shapefiles of a place with a background map of that place. I have imported both shapefiles into postgresql and geoserver. After ...
4
votes
1answer
226 views

POSTGIS SQL - How do I remove (defined) sliver polygons

I would like assistance in writing SQL (for POSTGIS in postgresql) to remove sliver polygons (including long narrow slivers and some small irregular polygons that were erroneous 'gaps' in the original ...
5
votes
1answer
225 views

Spatial database containing coordinates for stars in the sky?

My goal is to map the Skydome ( stars in the sky projected in earth surface ) using GIS. Has anyone done this before? I can't find any project close to this. What I just need to know is if there is ...
1
vote
1answer
82 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 ...
4
votes
1answer
918 views

Copy a spatial table from one PostGIS database to another PostGIS database

I have two PostGIS databases on two different servers. The first server is PostGIS 2.0 and the second server is PostGIS 1.5. On the PostGIS 2.0 I have a table "lakes" with MULTIPOLYGON geometry ...
3
votes
1answer
155 views

Computing radius of gyration in PostGIS

The radius of gyration is a measure of the standard deviation of distances between points (and their center of mass), i.e., how frequently and how far points are moving. A formal definition is: I ...
2
votes
0answers
130 views

How to best intersect vector data with raster data?

I have Open Street Map [OSM] data imported so that I can access the geometry of buildings. I have also loaded SRTM digital height data from NASA from a GeoTIFF raster. I have projected the raster into ...
0
votes
2answers
156 views

PostGIS - Select points from a table that exist in a custom polygon

We have a property search site where the user draws a polygon on a map and then the app displays all properties that fall within the polygon. We have properties stored within a Postgres table that ...
6
votes
2answers
350 views

How to check if points are within a circular sector using PostGIS?

I want to get the stars within the black region as shown above. To find this I have the centre of circle (lat, long), radius and the angle of region (45 degree). I am new to postgres. I worked on ...
0
votes
1answer
239 views

Why does reading shapefile from PostgreSQL database give Error reading OID from table …?

I'm using arcgis 10.1 and i have a connection to a PostgreSQL 9.3 database. When i try to load a shapefile using the add query layer I get an error when opening the attribute table. The error says ...
2
votes
3answers
261 views

Why are some points in my PostGIS layer not displayed?

I have PostGIS table with some points and various attributes. Yesterday I added some more points to the table and now weird things are happening when I try and display layers built from these points. ...
3
votes
2answers
165 views

How to handle PostgreSql 1:m relationship data by using “Data-Driven Input Mask” QGIS plugin?

I have 1:m relationship tables in my PostgreSql. I like to show the main table attributes as well as the relational table attributes (like grid rows) in QGIS attribute-edit-form. What are the entries ...
0
votes
2answers
62 views

Osmosis, Save to different schema

Does anyone know how to use osmosis to save to a different schema? I used the pgsnapshot_schema_0.6.sql to create a blank data table, but it always creates it in the public schema. I need to create ...
2
votes
2answers
356 views

Can I achieve one-to-many relationship in QGIS custom forms?

My PostgreSQL database has ElectricLine geometry table which has one-to-many relationship with ElectricLineMaterial non-geometry (attribute only) table. This PostgreSQL table added as layer in QGIS ...
4
votes
2answers
224 views

How to optimize a ST_Within query to count lightning occurrences inside a country?

I just started learning PostGIS, and right now i'm trying to count the number of lightning strikes in my country (Brazil in this case). I have the following tables: earth_feed --> This holds the ...
0
votes
2answers
124 views

How to add other column into pgrouting query result in pgAdmin output pane?

I'm working on my final research project now and I'm a new user in pgrouting. Is there any chances to add another column name to display in the output pane? I'd like to add road name column so that I ...
0
votes
1answer
246 views

Problems while installing Postgres [closed]

I was trying to install Postgres several times, but it didn't work out. I am using Mac and I tried to install Postgress.app, I got problems with database connection. I decided to install Postgress ...
2
votes
2answers
274 views

How to find the row that has a shape file containing a lat long point in my PostGIS geometry column

I am fairly new to PostGis and I'm trying to return a row in my table that has the shape file containing a lat long point I pass in via st_contains. Below is a query I wrote myself that brings back 0 ...
0
votes
2answers
178 views

Problem Importing shapefile into postgresql with simple geometries

I have a Line Type shapefiles to be imported to postgis database on my postgresql, I'm using the SHP loader, I checked the "Generate simple geometries instead of MULTI Geometries" options so that the ...
0
votes
1answer
74 views

pg_escape_string() equivalent?

A client is hosting one of my maps on a server that does NOT have a postgres module installed, and will not install it (nor anything else... ) . We have been told also by the site owner that we can't ...
1
vote
0answers
39 views

Create a single line from a resultset of line segments

How can I create a single line using the line segments geometry found in each row in resultset? I followed this tutorial: http://anitagraser.com/2013/07/06/pgrouting-2-0-for-windows-quick-guide/ I ...