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

learn more… | top users | synonyms

9
votes
2answers
951 views

Storing GML surface in PostGIS

I'm using PostGIS 2.0.0 and would like to store a GML Surface in a way that allows calculating intersections between that surface and various points and lines. In my case, the Surface will have one ...
8
votes
1answer
1k views

PostGIS 3D in Action

I was wondering if there is a website that showcases Openlayers and PostGIS 3D in Action
7
votes
1answer
4k views

How to import KML file, with custom data, to Postgres/PostGIS database?

By custom, I don't mean a different structure of KML file, but in <description></description> section, I have data with HTML tags of this kind: <?xml version="1.0" ...
6
votes
1answer
177 views

How to install a patch in PostGIS

Can anybody tell me how to install this patch in PostGIS? http://trac.osgeo.org/postgis/ticket/413 http://trac.osgeo.org/postgis/changeset/7534 I need to use the ST_OffsetCurve function. but it ...
6
votes
2answers
1k views

How to locate PostGIS AMIs on Amazon EC2?

There are nearly 7000 AMIs on EC2, but I'm having a difficult time figuring out which ones have what I'm looking for--in this case PostGIS on Linux. No specific version/configuation--I want to check ...
5
votes
1answer
957 views

How to route over (partial) edges in pgrouting?

I have made a route planning system (based on shortest path using A*) like the Google directions service using pgrouting and google maps. It includes clicking on the map to generate waypoints, ...
3
votes
3answers
1k views

How to add a polygon from PostGIS ST_AsGeoJSON into Leaflet?

I try to use the following function to add polygons to my Leaflet map. function polygon(geojson) { alert(geojson); // alert for testing layer = L.geoJson(geojson); layer.addTo(map); } ...
3
votes
2answers
1k views

Automating batch load of multiple GPX files into PostGIS

I've got 50+ GPX files that I would like to "batch load" into a PostGIS database. All of the track_points data would be loaded into a "track_points" table (with typical GPS fields like lat, long, ...
3
votes
4answers
872 views

GeoServer Layer from PostGIS not updating

I created a WMS layer from a PostGIS table with a fraction of total polygons in GeoServer. Everything displayed fine. Then, I added the rest of the polygons to the table in postgis. For some reason ...
3
votes
3answers
2k views

Writing a plugin for Qgis using python to access PostGIS and write geometries

Sorry about the strange title didn't really know how to word it. I currently use MapInfo to do most of my GIS work however I have recently installed PostGIS 1.5 and am really liking it so far. A ...
14
votes
1answer
361 views

How to query OSM for all beaches facing west? - QGIS preferred

I want to identify all beaches on this planet (or a given subset of it) that are facing westwards (+/- 20-30 degrees). My idea is to use OSM as the data source. Extracting all polygons that have the ...
13
votes
6answers
7k 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 ...
12
votes
6answers
675 views

PostGIS: Assign ID of point in layer A to closest point in Layer B

This should have been an obvious precursor (that I didn't ask) to my other question: PostGIS function to create spider diagrams? If I do not know the relationship between a point in layer A (stores) ...
11
votes
2answers
364 views

Are there any tricks to using a schema other than public in PostGIS?

I'm currently setting up a fresh install of PostGIS 2.0.2 and PostgreSQL 9.1.6 on Ubuntu. I've recently come across some information indicating that using the public schema to store all data is not a ...
10
votes
2answers
3k views

How to Export Feature GeoJSON from PostGIS

I'd like to do a GeoJSON dump of a PostGIS table, but I want to export features (the geometry and the properties) not just the geometry. I've been digging into the ST_AsGeoJSON function but it looks ...
10
votes
2answers
4k views

Finding the closest Geometry in PostGIS

I've been looking over the PostGIS "API" of functions, and I notice that most of them take two elements to compare. For example, the ST_Distance function takes two geometry/geography elements to find ...
9
votes
3answers
3k views

How to install PostGIS on Windows?

I want to create an application platform based on PostGIS data. I read the documentation where I saw the prerequisite to install GEOS, GDAL and Proj4. The main problem is I am using windows platform. ...
9
votes
1answer
1k views

How to add features to a PostGIS layer using Quantum GIS?

I am using Quantum GIS and the PostGIS dbms. I am able to call the PostGIS layer into QGIS but i am unable to add feature to it. I am using the method of adding features to a Shapefile but still it is ...
9
votes
3answers
2k views

Beginner PostGIS question: getting geometry from multiple tables

I am very new to PostGIS, PostgreSQL, and SQL in general. I have 44 tables in my PostGIS database, and each one represents a different layer of vector data. Each was loaded from a separate shapefile, ...
8
votes
2answers
811 views

How to add vertices to existing linestrings?

If I have Linestring(1 2, 1 5, 1 9) and a Point(1 3) Is there any function that can merge linestring and point preserving the order so output would be: Linestring(1 2, 1 3, 1 5, 1 9)
8
votes
1answer
632 views

How to Simplify a Line Network Preserving Topology?

I have a Shapefile (consisting of European major roads) with about 250.000 Segments which I have to simplify for pgrouting. But I can't seem to find a way to do that properly. This is what it looks ...
8
votes
2answers
969 views

How to preserve topology while editing polygons in OpenLayers?

I’m facing this issue: I have a chloropleth map based on a set of polygons with some data. Using WFS-T (postgis, geoserver, openlayers) I am able to edit the geometry of the polygons. This works fine. ...
7
votes
2answers
369 views

PostGIS Union Between Two Tables, Preserving Attributes

I'm trying to union US State level upper- and lower-level government boundaries in such a way that generates one PostGIS table with both the upper and lower level names for each shape. In my example ...
7
votes
1answer
1k views

Why do simplify polygon results differ between ArcGIS for Desktop and PostGIS?

I am mainly interested in why and how the Simplify Polygons tool in ArcGIS for Desktop handles the simplification process, including preventing and resolving topological errors better than the ...
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
3answers
718 views

Are there open source solutions for travel demand modelling?

I'm looking for open source tools for travel demand modelling (eg The four-step UTMS). Preferably in a GIS environment. That works well with Qgis, Grass and Postgis. My question is not related to ...
6
votes
2answers
1k views

Storing GPS tracks with timestamps in PostGIS

I need to store a series of GPS points with timestamps in the database (traces of various vehicles). I am wondering which of two approaches to choose for storing them in the PostGIS table: 1.) Each ...
6
votes
1answer
1k views

Performance Gain Through GIST Index for Point in Polygon Query

I have two tables: locations(id,region_id,the_geom) and regions(id,the_geom). For each location point I want to determine the region it is located in: UPDATE locations SET region_id = (SELECT id ...
6
votes
1answer
2k views

How to measure length of line accurately?

In postgis 1.5 for the below given query the answer is 1540651.62674101 meters , SELECT ST_Length(ST_GeomFromText('LINESTRING(77.83042478941326 9.98463896136159,78.03469506809812 23.90398909552571 ...
5
votes
2answers
421 views

How to detect duplicates and keep only one?

I've got a table with lots of points (200.000). Some of them are duplicates (not exactly but e.g. a metro station has eight entrances) and I want to keep only one of these metro entrances. I am able ...
5
votes
2answers
643 views

memory issue when trying to buffer/union large dataset using postgis

I am trying to generated a dissolved buffer of a large point dataset (Ideally 29 million points - Address data in Great-Britain, but I receive the data by chunks of 1 million points, so these could be ...
5
votes
1answer
1k views

grib2 to raster? (grib2 -> raster2pgsql -> PostGIS 2.0 -> GeoServer)

I'm looking to implement import of US National Weather Service data for doing various sorts of models (www.soils.wisc.edu/uwex_agwx if you're curious about what we're doing with the data). The ...
4
votes
2answers
1k views

Install PostGIS and TIGER Data in Ubuntu 12.04

Could someone write a brief albeit dumbed down idiot's guide to installing postgis and loading national Tiger data on ubuntu? I've tried a few guides, namely, ...
3
votes
1answer
73 views

Nearest neighbour for every row

I'm relatively new to PostGIS and postgresql . I'm trying to build a simple query containing two relations as follows : I've two relations R1 and R2 both of which contains geometries(Points) . I ...
3
votes
2answers
2k views

Count Points in Polygon with Postgis

I've got a simple problem: I want to count the number of points within a set of polygons. I have a SQL already but it only gives back the gid of the polygone that actually contains points. My ...
2
votes
2answers
652 views

How to create a valid global polygon grid in PostGIS?

I want to create a grid spawning the whole globe. The grid is used to measure a density value by counting the number of certain spatial objects in each grid cell. To create the grid, I have created ...
11
votes
2answers
513 views

How to clean such a bad shapefile for routing ?

I am trying to clean a shapefile to make it usable for routing with pgrouting, postgis, postgresql. Here an intersection, it seems to be connected but when we zoom …. It is not: Same here : ...
10
votes
1answer
919 views

GUI tools for PostgreSQL/PostGIS?

as a cartographer I work with TileMill to visualize geodata. I installed a local PostgreSQL server with PostGIS and osm2pgsql. Everything works fine. Anyhow, I am new to working with servers and the ...
10
votes
2answers
6k views

Creating spatial tables with PostGIS

In the PostGIS documentation it says that there are two steps to creating a spatial table with SQL: Create a normal non-spatial table. Add a spatial column to the table using the OpenGIS ...
10
votes
3answers
2k views

getting dxf files out of PostgreSQL

I've successfully loaded a bunch of shapefiles into a PostGIS database. I would like to be able to retrieve specific geometry and layers as dxf files based on SQL queries. I'm using PostGIS, GDAL, ...
8
votes
1answer
2k views

Postgis - Converting 'geometry_dump' data type to a 'geometry' type

I am working with a dataset of property boundaries that has had ST_Union() run on it, thus all the polygons appear as a multi polygon in one row of a table. I would like to separate these out so I get ...
7
votes
2answers
415 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
327 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?
7
votes
3answers
2k 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
2answers
512 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 ...
6
votes
4answers
2k 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
393 views

Join based on maximum overlap in PostGIS/PostGresQL?

I have two sets of polygons in two tables. The sets overlap each other. For each polygon in set A, I would like to get the ID of the polygon in set B that it overlaps the most. I'm using PostgreSQL ...
6
votes
1answer
376 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
2answers
360 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
637 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 ...