Version 2.0 of PostGIS brought a heavy set of new extensions for the PostgreSQL object-relational database, adding greater support for spatial objects.

learn more… | top users | synonyms

19
votes
1answer
984 views

Nearest Neighbor problem in Postgis 2.0 using GIST Index (<-> function)

I'm trying to use Postgis 2.0 new function <-> (Geometry Distance Centroid) in order to calculate, for each row of my table (cosn1), the distance to the nearest polygon of the same class. I was ...
18
votes
1answer
2k views

Comparison of geocoding solutions (such as Gisgraphy & PostGIS 2.0)

As I am sure many of you are aware, PostGIS has finally released Version 2.0 and included within this version they have also built a geocoder (see: http://postgis.net/docs/Extras.html). Although I ...
16
votes
1answer
176 views

Can we create views over a raster table in Postgis2.0?

Is it possible to create PostgreSQL views over a table that contains raster data? I have succeeded in creating the view but the entry in raster_columns is not correct (all the raster info is ...
13
votes
1answer
1k views

How to publish PostGIS Rasters in Geoserver?

What is the best solution to publish postgis rasters using Geoserver? I have spent a lot of time trying to create a Raster datasource using Image Mosaic JDBC but with no luck. Steps performed: 1. ...
11
votes
4answers
6k views

Loading a raster into a PostGIS 2.0 database on Windows

I'm trying to figure out how to load a raster into a PostGIS2.0 database (I have asked previous questions on this topic here and here). I am trying to use the raster2pgsql.exe program provided with ...
11
votes
1answer
192 views

Naming conventions PostGIS Database

We are starting to build up a database with PostGIS. The database is supposed to be for a team of about 5-8 researches who work frequently with geodata and statistics. Has anybody experience with ...
9
votes
2answers
2k views

Intersecting a raster with a polygon using PostGIS - artefact error

I'm using PostGIS2.0 to do some raster/polygon intersections. I'm having difficulty understanding which operation I should use, and what the quickest way of performing this is. My problem is as ...
8
votes
2answers
205 views

Moving existing hard drive with PostGIS data directory to a new computer

I have a new computer that is replacing an old machine that has PostGIS installed. The old computer has a 2nd hard drive where the PostGIS data directory is stored. I want to move this drive over to ...
8
votes
1answer
390 views

How to get the length of a line inside a polygon

How can I get the length (brown marked part) of the "Road 7" inside the red polygon? My start: SELECT ST_Length(way) FROM lines WHERE road = "Road 7" AND ST_Intersects(line, polygon)? With that, ...
8
votes
1answer
381 views

Are Zonal Statistics possible in PostGIS2?

Now with postgis2 which supports rasters by default is it possible to do a zonal statistics analysis? I've google it but I haven't found anything solid? Is there a tutorial outthere to get me ...
7
votes
2answers
2k views

Postgis 2.0 upgrade problem with postgres data [SOLVED]

I have a serious problem: on Wednesday, April 2 OpenSUSE 12.1 is updated, and the package was to update the PostGIS-a version 1.5.3 to 2.0.0. After this operation, Postgres does not display records. ...
7
votes
2answers
332 views

How to get distance between one point and all other points in a table?

I have a table in Postgres with lat and long columns. Can I use the ST_Distance_Sphere or ST_Distance_Spheroid methods to get the distance between one point and all other points in the table? Do I ...
7
votes
1answer
437 views

How to set up GeoDjango with PostGIS 2.0?

I would like to run GeoDjango (Django 1.4) with Postgis 2.0. Whenever I try to run syncdb I get the following error for geographic fields: Failed to install index for stores.Store model: operator ...
7
votes
2answers
1k views

How to run two PostGIS versions in parallel on Windows?

I'm trying to understand how to install PostGIS2.0 on Windows7. The PostGIS site has the following suggestions: PostGIS Experimental Binaries PostGIS 2.0.0SVN Binaries with Raster, Topology ...
6
votes
5answers
1k views

How to split OSM roads into individual segments at intersections?

I want to create a road-network for use with pgRouting using OpenStreetMap data. I loaded a shapefile from GeoFabrik into a Postgres table (with PostGIS enabled). However, one problem I had was that ...
6
votes
1answer
145 views

What is the precision of SELECT DISTINCT on PostGIS geometry column?

I wonder what the precision of the SELECT DISTINCT operator is on a PostGIS geometry. On my system, the following query gives me a count of 5, which means that the inserted points are considered equal ...
6
votes
6answers
2k views

Unable to connect Postgis from QGIS 1.8.0

I have installed PostgreSQL and PostGIS on my laptop (Win 7 64 bit OS). I am running QGIS 1.8.0 on my machine . When I am trying to connect Postgis I am getting connection failed error then I tried ...
6
votes
1answer
2k views

PostGIS - 1.5 to 2.0 easy update

I have a PostGIS 1.5 database and want to update to 2.0. I read that because this is major release I have to follow the 'Hard update' procedure. However the spatial data I have is only test data so I ...
6
votes
2answers
759 views

PostGIS SQL query to find a polygon that intersects with a line

I need to build a PostGIS query that would select every polygon inside an area the river is flowing through. I'd better describe with an example below: There is a river (blue line) flowing through ...
5
votes
1answer
3k views

Postgis 2.0 - public.geometry_columns view does not contain correct info for views

We have recently updated our database to Postgis 2.0. In our system we used to create views for tables containing a geometry column. After creating the view we also manually updated the ...
5
votes
1answer
393 views

How to install PostGis on EC2 micro-instance

I tried to install PostGIS on my Amazon EC2 microinstance using sudo yum install postgis2 and got following error message: $ sudo yum install postgis2 Loaded plugins: ...
5
votes
1answer
434 views

How to snap line string start & end vertex to the nearest point?

I have a point layer and a line layer. The points are road junctions, collected using DGPS, while the lines are the connecting roads, collected through Handheld GPS in tracking mode. As a result, the ...
5
votes
1answer
509 views

Speed up pgRouting point_to_id using new <-> operator in PostGIS 2.0.0

The point_to_id function, which assigns a node id to a point based on existing nodes and tolerance, is using a query as follows: SELECT id, the_geom FROM vertices_tmp WHERE ...
5
votes
0answers
66 views

What PostGIS [topology] provided tools may be used for data quality assurance?

I'm learning about techniques to ensure GIS data quality. Googling around, I've found a few papers about theory and best practices (here and here), and a couple of short presentations about the topic ...
4
votes
3answers
310 views

Very poor performance of QGIS and PostGIS2. User error or feature?

I have a large table in Postgis2. It has >500 million polygon, line and point features all happily living in there and the table performs brilliantly in other GIS. I am now trying to just add that ...
4
votes
3answers
343 views

Snapping start- and end nodes of lines to other lines in PostGIS

There are plenty examples that show how to snap lines to points, but I haven't been able to find any (fast!) way of snapping the start- and end nodes of line strings to nodes of other lines. ...
4
votes
1answer
1k views

How to find the nearest point by using PostGIS function?

table A: lat | long | the_geom | code | sign 13.8433095 | 100.6360357 | 0101000020E61.... | ABC | start_point 13.7544738 | 100.5459646 | 0101000020E6..... | ABC | end_point 13.4124215 | 100.6232332 ...
4
votes
1answer
185 views

Update PostGIS after updating GDAL?

I am using PostGIS 2.0 and I want to use the raster functionality through mapserver. It seems as if the latest official GDAL release 1.9.1 has an unstable PostGIS raster driver, as pointed out in a ...
4
votes
2answers
969 views

Force SRID in views in Postgis 2.0

I have a very tricky problem: I have a Postgis 2.0 database, used as datastore for Geoserver 2.1.3 I have a table with a geometry column (named shape), with SRID 4326 I have created a view like ...
4
votes
1answer
940 views

How to design model in Django using GeoDjango?

I am using Postgresql 9.0 and PostGIS 2.0. I am using Django 1.3 and GeoDjango.I have model with id,latitude,longitude and placename. All the places are in USA. My requirement is following - User ...
4
votes
1answer
54 views

Improve speed of PostGIS “nearest neighbor” query?

One of the features of the Python/Django/PostgreSQL web application I'm building is that a user will be able to see the 100 other users who are nearest to them, sorted by distance. I'm using PostGIS ...
4
votes
1answer
2k views

Can POSTGIS 2.0 be install with POSTGRES 9.2 on Ubuntu 12.04 OS at the moment?

This question is more about environment set up. At the current moment, March 4th 2013, can POSTGIS2.0 be install with POSTGRES 9.2? I check their website out and to my understanding it is not ...
4
votes
3answers
2k views

Loading geotiffs into PostGIS using raster2pgsql

I have an issue with loading some Ordnance Survey raster data into PostGIS. I have been using the following raster2pgsql command to load a tif that I have placed in my C:\Program ...
4
votes
1answer
2k views

Loading a raster using QGIS into a PostGIS2.0 enabled database

Following on from my attempt to install a postgresql 9.1 db with postgis 2.0 on windows 7, I am trying to figure out how to load a raster. I have successfully loaded a shapefile, and am trying to do ...
4
votes
1answer
416 views

Are there limitations using a PostGIS out-db raster?

I have been trying to import a large raster into a PostGIS 2.0 database and hit a few stumbling blocks. Initially when I tried to import the raster using raster2pgsql, I would receive the following ...
3
votes
1answer
295 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
3answers
228 views

What does the “service” box in the PostGIS connection dialog stand for?

Can sоmеbody explain me what to write in the "service" box when connecting to the local DB. QGIS Lisboa and Postgres are installed.
3
votes
3answers
91 views

How to create random points in a polygon in PostGIS

I have a polygon layer, and would like to generate random points in each polygon. An initial searching in Google resulted this website which presents a function for this purpose: ...
3
votes
2answers
738 views

PostGIS - incorrect result distance between two points

I am quite confused the way PostGIS is returning the result for this basic query. So I am trying to find the distance between two points 45.2714,71.2087 and 42.3739,66.39 and the distance should be ...
3
votes
1answer
171 views

osm2pgsql: Import data in custom projection

I have osm-file and I want to import it to the postgresql via osm2pgsql with custom projection EPSG:20022. I look to the help and found out any keys like -E EPSG: but when I try to do with it I get ...
3
votes
1answer
236 views

Using PostGIS for a large trajectory dataset

I have a spatial trajectory dataset which basically contains about 10E6 (lat,lon,time)-tuples, grouped together by an identifier so they form trajectories. Currently, SQLite is used to store the raw ...
3
votes
2answers
234 views

How to clip from a point layer using postgis?

I've loaded a LIDAR xyz file into a PostGIS2.0 database and created a 3D point geometry column ("tblCLOUD") from the data. I've also loaded into the database a shapefile that contains six ...
3
votes
1answer
742 views

Error creating a spatial database. ERROR : could not load library “/usr/pgsql-9.1/lib/rtpostgis-2.0.so”

I am running PostgreSQL 9.1 with Postgis 2.0 on Fedora 15. When trying to install the raster support, psql -d mydb -f rtpostgis.sql -v ON_ERROR_STOP=1 I get the following error ...
3
votes
1answer
189 views

Loading Shapefiles into PostGIS using shapefile import/export manager

I am a complete beginner with PostGIS. I've started learning it using the tutorials provided by Boundless. In section 4 of this tutorial where I want to import shapefile in PostGIS, I do not have the ...
3
votes
1answer
71 views

Force a collection of unknown number of points to be a polygon

I am working with point clusters and want to create the rough shape of the cluster in the form of a polygon using ST_ConvexHull(). I'm having problems with single outliers though, as they don't ...
3
votes
1answer
116 views

How can I check if a multipolygon can be represented as a simple polygon?

I have a large (30m+ records) spatial data set I have imported into a PostGIS database. I did not expect to find multipolygons in the data set, but it does have a few of them. I'd like to take a ...
3
votes
1answer
365 views

Transit Routing using pgrouting as core routing engine?

i'm a student and i'm working on a project. the aim is given two sets of coordinates(origin & destination) route through the map to determine the optimum path using public transportation and of ...
3
votes
1answer
344 views

nearest neighbor within table using PostGIS

using PostGIS 2.0 and PostgreSQL 9.1 I have a table of photographic observations, sco_photos. The location column contains a PostGIS geometry point specifying where the observation was made. The table ...
3
votes
1answer
599 views

remove duplicate points based on a specified distance

i have a table of points with each point acquired on a specified date, by a specified source, and having a measured value. i want to consider points as duplicates if they have the same date and if ...
3
votes
1answer
273 views

PostGIS: Merge multiple table with same GID

I just imported some shapefiles with the PostGIS importer. Because several errors and issues I had to split my shapefile in multiple parts. Then I imported them one by one. I thought I can easily ...