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

learn more… | top users | synonyms

8
votes
3answers
376 views

Why doesn't pgRouting return the best path?

Let the next portion of a graph: When I use the function shortest_path between the points A and B, I got the blue path. Why does this happen?
8
votes
2answers
653 views

How to catch PostgreSQL/PostGIS errors in GDAL/OGR Python bindings?

Is it possible to catch PostgreSQL output error messages in OGR after a query has failed? For example conn.ExecuteSQL('SELECT * FROM non_existing_table;') In Postgres this returns an error ...
7
votes
2answers
851 views

Using ArcGIS and QGIS together in multi-user editing environment?

We have a GIS staff of 7, and another group of about 14 who "use GIS" from time to time. We really, really want multi-user editing. Mostly of a large point file, and we're almost never in the same ...
7
votes
3answers
3k views

How do I get the area of a WGS84 polygon in square meters?

The following gives me the area of the polygon in square degrees: SELECT ST_Area(ST_GeomFromText('POLYGON((871325.790874952 6105405.3261047,871418.748307692 6105359.72944624,871346.22022442 ...
7
votes
3answers
5k 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
296 views

How to replicate ArcGIS Intersect in PostGIS

I'm trying to replicate this ArcGIS process in PostGIS: http://blogs.esri.com/esri/arcgis/2012/11/13/spaghetti_and_meatballs/. This describes how to break buffered points down into polygons based on ...
6
votes
6answers
6k views

Open Source equivalent to Collector for ArcGIS to use with QGIS/PostGIS?

From my reading of the Esri web pages the Collector for ArcGIS is tightly tied to that platform. I would be delighted to learn that I am wrong about this. I have a strong interest in generic mobile ...
6
votes
1answer
1k views

Setting geometry types importing to PostGIS with OGR

I'm using ogr2ogr to import data into a PostGIS database. Each dataset I need to import has (theoretically) the same exact data structure, but it appears that they are not the same geometry types. ...
6
votes
1answer
452 views

Clarification of Logical Operators in a PostGIS Database

The following query returns this result: select count(*) from a , b where a.geom && b.geom; count ------- 66514 On a postgis 2 database. What does the logical operator AND ...
6
votes
1answer
1k views

Raster data on PostGIS

I need to publish raster and vector data through GeoServer WMS service and I have already chosen PostGIS as datasource to keep vector data. Now I would like to know what is the best practice to work ...
6
votes
2answers
425 views

Do large vertex counts cause performance issues?

I have a table of several thousand tuples - each tuple has a geometry column. The problem is, these geometries have a large vertex count. The max vertex count is 400, while the average is 200. ...
6
votes
1answer
741 views

Data visualization and maintenance tool

Background Looking to leverage an existing GIS system for exploring organizational data. Architecture The following figure represents a high-level overview of the system's desired features: The ...
6
votes
5answers
6k views

How to load Shapefiles into a remote PostGIS db using command line?

Can we import a Shapefile from a system which doesn't have PostgreSQL installed (client machine) into a system having PostGIS installed? I am getting problem with 'shp2pgsql' and 'psql' since both ...
6
votes
3answers
3k 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 ...
6
votes
2answers
863 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
3answers
615 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 ...
5
votes
0answers
2k 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; ...
5
votes
1answer
553 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
776 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
3k 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 ...
5
votes
2answers
1k views

Rasterize a vector layer in PostGIS

Related to this question asked here on gis.se and this thread on postgis-user, has anyone worked out a good solution for in-database rasterization of a vector layer using PostGIS? It sounds like the ...
5
votes
3answers
5k 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
1answer
877 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
569 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
1answer
1k views

SQL query to have a complete geojson feature from PostGIS

I would like to get a geojson feature with properties from PostGIS. I have found an example to have a feature collection but I can't make it works for just a feature. so far I tryed to modify the ...
4
votes
2answers
2k 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
376 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
3answers
3k 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 ...
4
votes
1answer
707 views

How to determine on what side of a line is a point is?

I want this in order to generate house numbers, odd or even depending on wether a feature is on one side of a street line or not . Thanks EDIT: In the end i think the most portable way is to use ...
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
2answers
870 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 ...
4
votes
3answers
711 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
33 views

Adding vertices to polygon in PostGIS?

For example I have rectangular polygon (4 vertices). I want to add mid-point on each line of the polygon, so in total now I have 8 vertices. And from them I want to build new polygon who will have ...
3
votes
1answer
354 views

How to edit a PostGIS database using ArcGIS for Desktop Add-In/Extension? (no ArcSDE)

I need to improve an existing solution to be able to do multiuser editing within a PostGIS database from ArcMap. Available for the solution is ArcGIS for Desktop 10.3 [Basic]. (No non-free Extensions ...
3
votes
1answer
331 views

PROJ4 / PostGIS transformations between WGS84 and NAD83 transformations in Alaska

I'm trying to implement the recommended WGS84 - NAD83 transformation for Alaska using PostGIS. This post: Geographic Transformations in Alaska Between NAD83 and WGS84 indicates the proper ...
3
votes
1answer
692 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 ...
3
votes
1answer
452 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
202 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
2answers
5k 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.
3
votes
2answers
392 views

Extract PostGIS line features to GPX

I have a request to provide GPX files of certain trails (around 100) that are present in OpenStreetMap. Given a local PostGIS install with OSM data, I think the process would be something like: ...
3
votes
1answer
280 views

st_clip and gdal_translate: “Error browsing database for PostGIS Raster properties” - Why?

Im using shell-script, postgis2.0 and gdal for trying to clip raster apart, using an overlapping raster and a the_geom-object. At first I create a view to clip the overlapping part of the raster. It ...
3
votes
1answer
3k 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
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
2answers
118 views

Merging linestrings in QGIS using PostgreSQL and PostGIS

I've to merge all linestrings from a PostgreSQL table "river" where not more than two start-/endpoints are overlapping. In the illustration below I use a "M" to mark all linestrings that needs to be ...
2
votes
2answers
2k views

How to add Geoserver WFS to Leaflet JS Application

I have a PostGIS database and have successfully consumed a table into GeoServer and published a WFS. Are there REST endpoints available for these WFS' akin to ESRI's feature services? How are ...
2
votes
1answer
116 views

Get points along a line at defined distance

I was reading a lot of similar questions here but no one ask about postgis (or I didn't find it). I have a line in postgis and I want to get the point along the line at defined distance. It is ...
2
votes
0answers
251 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
180 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' ...
2
votes
0answers
303 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 ...
2
votes
1answer
152 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 ...