PostGIS is an extension for the PostgreSQL object-relational database that adds support for geographic objects.

learn more… | top users | synonyms

6
votes
3answers
3k views

Bounding box for PostGIS table

Is there an easy way to get the bounding box for an entire table in PostGIS? Thanks
6
votes
2answers
780 views

How do you calculate lat/lons from a PostGIS table which has a projected coordinate system?

I have a PostGIS table in a projected coordinate system (EPSG: 28355 or MGA94 Zone55). In QGIS (with the PostGIS manager plugin) I calculate a coordinate by performing the following SQL "UPDATE ...
5
votes
1answer
377 views

How to findout direction PostGIS

I want to find out the direction from the 2 points from postGIS database. Please see the attached image. I want to find out the direction from the mainPt to any point. But want to get the result as ...
5
votes
3answers
451 views

Adding a GIS feature to existing database entry with QGIS

I've built a database with postgreSQL with tables, which include geometry columns. When I add some data to my non-geometry columns, I can see them in QGIS when I connect to my database using postgis. ...
5
votes
3answers
4k views

How to fix performance problem in PostGIS ST_Intersects?

I'm a newbie in postgis and I have a problem in query performance. This my query: SELECT DISTINCT ON (userid) userid ,ST_AsText(position), timestamp FROM table1 WHERE ST_Intersects ( ...
5
votes
3answers
2k views

When should I use ST_Buffer?

I would like to know what is the sense of using st_buffer operation. In PostGIS reference guide there is only the syntax and a short description of this operation. Could you give some examples to ...
5
votes
1answer
734 views

Split edges at intersections in PostGIS

I'm attempting to do a walking distance analysis using OpenStreetMap data (osm2pgrouting) and PostGIS and following underdark's blog posts, however I need to exclude residential and service roads that ...
5
votes
1answer
484 views

Promotion radius in miles around venues using PostGIS

Bear with me as I'm new to PostGIS and GIS in general. I also don't know the domain well enough to create a good title for this post! Here is what I'm trying to accomplish: I have Venues in my ...
4
votes
2answers
850 views

Postgis 2.1 error after update

After a usual update progress - "apt-get upgrade" - I can not connect with qGIS to my PostGIS DB anymore. Error in the qGIS logfile: Your database has no working PostGIS support. Erroneous query: ...
4
votes
1answer
195 views

Configuring Geoserver to use a specific postgis geometry column as the default

I have a PostGIS table with two geometry columns, both multipolygon but one with SRID 4326, the other 3857. When publishing the table in Geoserver, I realize that Geoserver defaults to using the first ...
4
votes
0answers
1k views

Loading raster from PostGIS DB into QGIS: succeeded yesterday, fails now [closed]

I have a PostgreSQL(v.9.2)/Postgis(v.2.0.3) database which includes raster layers (added through raster2pgsql). To open them in QGIS (v.1.8.0-Lisboa), the "Add Postgis layer" menu will not work; ...
4
votes
3answers
2k views

How to extract POINT from a [LINE|MULTILINE]STRING

I'd like to create a vectorLayer in QGIS to display all the points that form a LINESTRING or a MULTILINESTRING stored in a PostGIS DB. I think that I need to transform all points of LINESTRING (or ...
4
votes
1answer
1k 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 ...
4
votes
3answers
581 views

WFS Caching / Back button

I'm using WFS protocol on Vector layer / GeoServer / PostGIS Currently the map is refreshing and calling new requests whenever i do anything like searching or drawing and when i move back to a part ...
3
votes
1answer
108 views

nearest facility with pgrouting

I have a postgres table of students with lat, lon and geom, , and a table of schools with the same, and a table of roads that has been converted to nodes. I'm trying to find the driving distance to ...
3
votes
1answer
286 views

How to install PostGIS correctly with OpenGeo Suite 4.0 community edition on Windows 7?

I have installed the OpenGeo Suite community edition, version 3, onto Windows 7 multiple times in the past, with virtually no problems. With the latest version of OpenGeo Suite (4.0.1) (which ...
3
votes
1answer
142 views

How can I move along a line (or path)?

Given a line (street, railroad, river...) I want to simulate a moviment inside this line. Example: See this picture: Say I'm in "Nagqu" and want to move to "Kunlunqial". In a time (t=0) I'm in ...
3
votes
3answers
929 views

How to speed up Postgis raster layer display in QGIS?

i've been importing some digital orthophoto geotif files into postgis 2.0.1 via raster2pgsql tool (i also made 3 levels of an overview table - pyramid). Then i tried to import the layer into qgis via ...
3
votes
1answer
2k views

convert list of points to line or polygon

I have a list of Points in a PostGIS table. The rows can be grouped by a date something like: myTable id INT date DATE lat NUMBER lng NUMBER geom GEOMETRY(POINT) now I need a table where all ...
3
votes
2answers
732 views

Merging polygons that intersect by more than a specified amount

I am working with a dataset that contains a subset of property boundaries in a local government area, thus my dataset is made up of several thousand properties but not all are touching. Since it is a ...
3
votes
1answer
2k views

PostGIS Error: type “geography” does not exist

I just upgraded my development machine to Windows 7 and am therefore reinstalling PostgreSQL and PostGIS. I used the Postgres Plus installer, as recommended on the Postgres website, and followed this ...
2
votes
1answer
338 views

Mapnik + OpenStreetMap + Shapefile with Raster Images + Mod Tile + PostGIS

I am new to GIS. I have a Shapefile (.shp, .shx and .pbf). The .pbf file contains path to PNG files located on my machine only. I was able to save the Shp data to PostGis via Shape2Gis tool. Now ...
2
votes
0answers
170 views

TileMill Exports Failing

I'm having trouble exporting my map in TileMill (v0.10.1). I'm using OSM Bright with a PostGIS database connection to import OpenStreetMap data. When exporting an SVG or PDF through the user interface ...
2
votes
1answer
106 views

PostGIS Raster: Outputting raster into GDAL supported file?

I have import a raster into my postGIS database via raster2pgsql. My raster tiled to 100x100. Now I'm trying to export (output) the raster to GDAL supported file (for example: PNG). Following the ...
2
votes
3answers
810 views

What's the fastest way to do a bounding box query in PostGIS

I have a Postgres table, with almost 2 million rows, with a long-lat coordinates field in the form POINT(-73.4938 33.2405). Supposing there's a geospatial index on that field, what's the most ...
2
votes
1answer
107 views

How to split polygons with another polygon and inheritage data?

Let's say that we have two tables with polygons representing areas. Table A and Table B. Geometries from table A represents both the valid and invalid areas. And the geometries in table B represents ...
2
votes
2answers
3k views

Exporting shapefile to PostGIS database in QGIS

How do I export a vector shapefile to PostGIS database? I am asking what format I have to export it.
2
votes
1answer
57 views

Compare features in PostGIS with updating attributes

I have two polygonal layers: "existing" and "modified". Attribute table of "existing" and "modified" layers have same column "feature_id" - number of feature. Please help me create query which write ...
2
votes
1answer
338 views

How to merge connected lines with same direction (PostGis)

I am looking for a way to join all lines that are connected, have the same direction, i.e. start point of one is end point of the other, and share some common attributes. In fact, I want to connect ...
2
votes
1answer
431 views

Get the lines between all points of a polygon in PostGis : avoid nested loop?

I am trying to get all the lines between the points of a polygon, by writing PostGreSQL functions. I have written the two following functions that do the job fine : the first function to get all the ...
2
votes
2answers
1k views

What Spatial Reference System do I store Google Map's Lat/Lng in

I am new to PostGIS, Spatial Reference Systems and projections and want to store lat/lng coordinates retrieved from Google Maps and Openstreetmap and its services like the Geocoder/Nominatim. I'm ...
2
votes
2answers
562 views

Create CMS system using Cartaro

The main objective for our project is to create a portal website in Drupal. On this website, people must be able to upload their geographical datasets (mostly shape files, but also xml files that ...
2
votes
2answers
448 views

How fill length and feature count in PostGIS table for each polygons

I'am new to PostGIS/PostgreSql. I have a database which containts two shape-files : polygonal layer towns and linear layer of roads To calculate the length and feature count of 'Streets' inside ...
2
votes
1answer
624 views

How to debug 'Layer is not valid error' from Python plugin?

I'm trying to understand what goes wrong with a QGIS python plugin. Basically I'm trying to render a series of POINT. The query works fine, at least giving it by hand from inside PostGIS DB: "SELECT ...
2
votes
1answer
777 views

Access PostGIS Raster layer through mapserver

I am trying to use a cgi script calling mapserver to display a raster layer that is stored in a PostGIS database. However, only a blank white image is returned and I don't know where the problem is. ...
2
votes
1answer
545 views

How can I get the corners of a polygon in latitude and longitude?

How can I get the corners of a polygon -a square/rectangle, to be precise- in latitude-longitude format by using its geom value -or some other way, perhaps-? Thanks.
2
votes
1answer
422 views

PostGIS: ST_Transform function conversion problem

I'm inserting map data from a GML file with srid EPSG:27700 into a PostGIS database table with srid EPSG:4326. I'm using the ST_Transform function as in this snippet: ...
2
votes
1answer
880 views

geoserver wfs insert error

I keep getting an insert error from geoserver when trying to save a point, poly etc etc to my postgis table. any ideas, my code is below var Projection = new OpenLayers.Projection("EPSG:4326"); ...
2
votes
1answer
635 views

Routing Application in Windows

I am making an routing web application similar to Google Maps 'Get Direction' feature. But because of the limited control and data on GMaps, I decided to use OpenStreetMap instead. This also made me ...
1
vote
1answer
96 views

Configuring SFCGAL to PostGIS Db

I was using PostgreSQL with PostGIS and Pgrouting. Recently I needed to install SFCGAL for some extra functions for my PostGIS db. After installing SFCGAL, now I don't know how to update my PostGIS db ...
1
vote
1answer
159 views

Get a single cluster from cloud of points with specified maximum diameter in postgis

I have on the order of 2M Geometry Collections with N (median: 2, stddev: 6.6, 75th: 6, 95th: 21) Point objects (repeated points allowed and important) in a PostGIS table. I want to identify clusters ...
1
vote
1answer
126 views

Problem with using a circle as polygon for querying PostGIS

I'm trying to query PostGIS and find some object features that intersect with a circular buffer created by the user using OpenLayers, JavaScript and PHP. I use the following code for creating the ...
1
vote
2answers
1k views

Attempting to use ST_DWithin to locate objects within a given distance of meters using SRID 4326

I'm a Rails developer with minimal GIS experience, working with PostGIS and the RGeo gem. I'd like to find all of the cows within 500 meters of my current location. So, I'll create a model for my ...
1
vote
1answer
636 views

How to improve poor performance times for PostGIS 2.1 Tiger Geocoder?

I've recently upgraded my PostGIS DB from 2.0 to 2.1. I initially followed the instructions from Waiting for PostGIS 2.1 - Install PostGIS Tiger Geocoder as an Extension and 2.7. Installing, ...
1
vote
1answer
960 views

PostGIS, create line from points

I have a PostGIS table with position data of numerous vehicles and want to create lines from these points. Data can be selected by vehicle id and ordered by timestamp but how to create lines from the ...
1
vote
1answer
289 views

Polygon to fill gap

Using postgis I want to fill a gap between other polygons. Can you help with some directions what functions to use ? Thank you and sorry if the question is rather noobish. Image to explain from ...
1
vote
5answers
2k views

Unable to install the PostGIS extension to PostgreSQL on Ubuntu 12.04 LTS

I just installed Linux Ubuntu 12.04 LTS (on a virtual machine). I then successfully installed the PostgreSQL 8.4 database management system. I am now trying to install PostGIS, which is an extension ...
1
vote
1answer
522 views

From a trajectory of GPS points to a multiline segment

Given a trajectory as a sequence of GPS points I would like to create a smooth linestring representing a path where a car drove. The data is stored in postgresql: the input trajectory in a table, ...
1
vote
2answers
2k views

mulitlinestring to linestring

I am using postgres with postgis and I have a set of points which I would like to interpolate with a set of lines. Now my problem is that the set of lines are of type multilinestring. Is there a ...
1
vote
1answer
257 views

Howto setup osm2psql

I'm following these instructions to setup osm2psql . I need it to import osm data file inside a PostGIS DB. The following steps worked fine: createdb -E UTF8 -O user mydb createlang plpgsql mydb I ...