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

learn more… | top users | synonyms

20
votes
6answers
8k views

Shapefile PRJ to PostGIS SRID lookup table?

I was wondering if there is such a thing as an shapefile PRJ to PostGIS SRID lookup table? Something that can translate the most standard shapefile PRJ definitions into the likely SRID. When using ...
23
votes
10answers
5k views

Alternatives to pgRouting

I was wondering if there are any alternatives to pgRouting tools. Thinking about it for a bit, I think the only alternative is to use R or RPY to do the analysis. Basically I'm trying to solve ...
21
votes
4answers
3k views

Bulk load multiple shapefiles into PostGIS

I've got over a hundred data layers in shapefile format that I want to upload into a PostGIS database. They are all in the same projection, but represent different data layers so they do not have the ...
26
votes
2answers
5k views

How to create a regular polygon grid in PostGIS?

How to create, on the shape of a polygon, a regular grid of polygons/squares of an given size, in postgis? I have thought about a function like Create regular point grid in Postgis only for squares, ...
30
votes
6answers
9k views

How to use PostgreSQL/PostGIS with ArcGIS for Desktop?

Has anyone successfully used PostgreSQL with PostGIS successfully? I am a semi-experienced ArcGIS user and want to build out a database and connect it to ArcCatalog. I've scoured the internet for ...
28
votes
4answers
4k views

Curved point-to-point “route maps”

I have recently been looking at airlines web pages that display their routes departing a certain city to all other cities they service. I would like to be able to create similar curved routes between ...
8
votes
3answers
2k views

How to emulate Google Maps driving directions using pgRouting?

Would like to emulate google maps' driving directions functionality but use pgRouting instead. google's data over the project area & scale is quite a bit off so we want to use our own transport ...
42
votes
4answers
12k views

Spatial clustering with PostGIS

I'm looking for spatial clustering algorithm for using it within PostGIS-enabled database for point features. I'm going to write plpgsql function that takes distance between points within the same ...
18
votes
4answers
6k views

Separate polygons based on intersection using PostGIS

I have a PostGIS table of polygons where some intersect with one another. This is what I'm trying to do: For a given polygon selected by id, give me all of the polygons that intersect. Basically, ...
4
votes
2answers
844 views

Is Shooting Star broken in PGRouting 1.05?

I'm using pgrouting DLL 1.05 with postgresql 9.1. All required function installed. Astar and Dijkstra work fine with sample data but "SHOOTING STAR" is not considering "reverse_cost". Also if i try ...
37
votes
7answers
4k views

Best practices for PostGIS production environments?

What PostGIS documentation have you come across that has been helpful when tuning PostGIS for a production environment? I would like to get together with my DBA to setup a Postgresql/PostGIS ...
21
votes
2answers
8k views

How to change the SRID of exisisting data in PostGIS?

While importing my shapefile data to PostGIS, I did not select the proper Projection. How do I now change the SRID of the data, without transforming the Coordinates?
21
votes
5answers
3k views

How to create regular point grid inside a polygon in Postgis?

How to create, inside a polygon, a regular grid of point spaced x,y in postgis? Like the example:
33
votes
2answers
4k views

Acquiring ArcGIS-like speed in Postgis

I have been using Postgis 2.0 for 3/4 of a year now and while I really enjoy using it, excessive query processing time has rendered it basically unusable for my use case. I tend to do heavy ...
25
votes
9answers
13k views

How to connect to PostGIS database from ArcMap?

How can I connect to a PostGIS database from ArcMap? Solutions for ArcGIS 9.3, 10.0 and later are acceptable. Ideally, I would like to be able to perform spatially enabled queries and receive the ...
19
votes
7answers
6k views

Nearest neighbor between a point layer and a line layer

I've asked this question several times on stackoverflow and irc between #qgis and #postgis and I also tried to code it or implement it my self in postgis with no real answer. Using programming (most ...
26
votes
3answers
8k views

How to make a spatial view in PostGIS and add it as a layer in QGIS?

In PostGIS 2.0, what is the most efficient way to create a spatially enabled view that is viewable in QGIS? I followed the context of Part 2 of @Mike Toews answer to this question, and the view ...
10
votes
2answers
1k views

How can I convert geomagnetic coordinates to geographic coordinates without doing the math myself?

I have some data which are in geomagnetic coordinates; that is, they are latitude and longitude, but in reference to the magnetic north pole in Canada rather than the geographic north pole. As you ...
6
votes
1answer
1k views

Nearest Neighbor calculation in PostGIS

I'm learning how to use PostGIS and spatial databases for analysis. What I am trying to do is perform a calculation to get the distance for the nearest polygon in a file, using the edge calculation, ...
34
votes
4answers
6k views

What are the pros and cons of PostGIS geography and geometry types?

My company uses geometry (the_geom) data type for storing geospatial data. I've recently been acquainted to the concept of geography (the_geog) data type which, as I understand it, stores the SRID ...
11
votes
2answers
2k views

Which function for creating a POINT in PostGIS?

When defining a Point in PostGIS, when do you decide to use which of the following? ST_SetSRID(ST_MakePoint(lon,lat),4326) ST_SetSRID(ST_Point(long,lat),4326) ST_SetSRID(ST_GeomFromText('POINT(lon ...
7
votes
1answer
2k views

Using PostgreSQL with QGIS and ArcGIS?

Is it possible to use PostgreSQL with QGIS and ArcGIS? i.e. one database for different clients. Is it anything that I have worry or any problems to use the DBMS from two different software? I know ...
18
votes
4answers
9k views

How to get the nearest point on a linestring to a given point?

I've been using PostGIS in a long time now but never had to use the LINESTRING geometry ... yet! :) Here's what I would like to do : I have a table of linestrings (representing streets of a given ...
26
votes
5answers
9k views

How to migrate GDB data into PostGIS without ESRI apps?

Can you tell me how I can load geodatabase data into PostGIS without having to install ESRI apps? The solution I found online talked about using ArcGIS to convert GDB to SHP and then importing SHP to ...
19
votes
7answers
8k views

Options for displaying PostGIS vectors in OpenLayers

I am very new to web-mapping, so this question may be a little misguided. I want to have a very simple web interface using OpenLayers (or even Google Maps if that will be easier) which can display a ...
20
votes
3answers
4k views

How can I calculate the average width of a polygon?

I'm interested in examining the average width of a polygon that represents the road surface. I also have the road centerline as a vector (which is sometimes not exactly in the center). In this example ...
11
votes
4answers
2k views

Simplifying polygons to linestring

I would like to simplify some polygons that represent rivers into linestrings. I assume that holes in polygons can be omitted. Anybody has some good idea how to simply do it? It would be nice, if it ...
10
votes
2answers
4k views

Selecting by bounding box with PostGIS

I have a large dataset in a PostGIS database. I am viewing it via a web interface that loads the data as GeoJSON. There is too much data to give the client all at once (10s of MBs worth...) so I would ...
13
votes
2answers
26k views

How to insert a point into postgis?

I have created one table in my Postgis. But I can not insert point. I do not know what's wrong with my query? CREATE TABLE app ( p_id INTEGER PRIMARY KEY ); SELECT ...
13
votes
4answers
3k views

How to create one-sided buffers or parallel lines in PostGIS?

I'm looking for a way to create so-called one-sided buffers or parallel lines in PostGIS. Example: 1. buffer, 2. one-side, 3. both-sides I've found some discussion on the mailing list from 2009 and ...
15
votes
4answers
5k views

How to reproject all geometries in a PostGIS table?

I created a spatial table with SRID:4326. Now I want to change total projection to SRID:32644 into a new table. The old table should remain unchanged.
12
votes
3answers
6k views

Is there a dissolve function in PostGIS other than st_union?

I'm looking for a function to dissolve shared boundaries between polygon features in a table. ST_UNION() almost does what I'm looking for, but it creates a multipolygon from all polygons in the layer ...
5
votes
1answer
2k views

Calculate distances between series of points in postgis

I have a postgres/postgis table containing a series of sequential points. I want to add a new column to the table which contains the distance between each point and the first one, and so forth until ...
4
votes
4answers
3k views

Calculate distance of point from an arc/polyline

Using Postgres/PostGIS, I am trying to query the database for the closest arc to a particular GPS point. Each Arc is made up of two nodes that are GPS points on a map. Is there a way I could query ...
3
votes
0answers
187 views

How to estimate the average width of a sidewalk? [duplicate]

I have a table with two polygons representing urban block with and without the sidewalk: geomBlock and geomBlockWithSidewalk. On my city we can approximate the polygons of geomBlockWithSidewalk to a ...
6
votes
1answer
2k views

How to import GeoTIFF via postGIS into GeoServer?

As a simple test case, I'm trying to configure the software stack of OpenGeo such that I can display a GeoTIFF as an overlay to a normal map like OSM. So I perform the following steps: Create a ...
5
votes
2answers
3k views

How to convert PostGIS table to Shapefile in Python?

I want to convert a PostGIS table into a shapefile (without using pgsql2shp). In order to create a geometry in the shapefile I have to give the Xmin,Ymin and Xmax,Ymax, and the geometry which I have ...
4
votes
2answers
6k views

How to connect OpenLayers to PostGIS data?

I have read in OpenLayers how to load KML, GeoJSON etc. vector files in OpenLayers. But how can I connect to PostGIS data. If not, why should I upload my data to PostGIS then instead of directly ...
2
votes
2answers
714 views

Postgis, get the points that are x meters near another point, in meters

I'm trying to find the points within a certain distance, in meters, from another point. I'm using the function ST_Buffer, but I don't get how to express the distance in meters. I'm trying with ...
1
vote
1answer
1k views

How to verify a PostGIS installation on OS X?

I am trying to set up GeoDjango and installing PostGIS on my mac and when I am trying to ./configure I am getting this error checking PostgreSQL version... PostgreSQL 8.4.9 checking libpq-fe.h ...
44
votes
8answers
8k views

How to create Vector Polygons at the same amazing speeds GISCloud is able to render them?

EDIT (outlining new bounty added): I have added the largest bounty possible to this question in hope of getting a very detailed answer. Your solution should outline a step-by-step guide utilizing open ...
54
votes
8answers
4k views

How do I get started with PostGis

I have been reading a lot about it, but I am struggling to find a good beginner's guide. Which tutorials/books do you recommend? My past experience involves python and arcgis. But I have never worked ...
20
votes
2answers
5k views

Looking for fastest solution for Point in Polygon analysis of 200 million points

Apologies for asking a question that has been asked before -- I've read through answers, and I'm left wondering how to implement the recommendations. I've never used SQL, Python, C, and have only ...
15
votes
4answers
10k views

Select bounding box using postgis

I want to create a query to select all ways and their nodes that exist within a bounding box using postGIS. The bounding box shall includes all details as osmosis "--bounding-box" command will ...
18
votes
4answers
2k views

Generalisation Strategies for Building Outlines

I have a dataset of building footprints vectorised from a raster dataset. The dataset is currently just a vector representation of the raster data. I would like a polygon dataset that only has ...
14
votes
2answers
3k views

Identifying road intersections using PostGIS

I'm trying to identify where roads intersect each other, and to make a point at this intersection, with the number of roads that form the intersection listed. I was wondering if there was some way ...
9
votes
2answers
1k views

What are the implications of invalid geometries

I've imported some data in a Postgis database and some of the geometries are reported invalid (ST_IsValidReason reports self-intersection or ring self-intersection). The queries I am performing don't ...
10
votes
2answers
5k views

How can I get a shapefile from a postgis query?

My data is in a PostGIS database. I would like to generate a shapefile from a query. How can I do that?
10
votes
1answer
487 views

How to render a table with mixed geometry types in QGIS?

I created a table with geometry type "GEOMETRY" AND inserted data of point, line and polygon type. My question is how to show this spatial data Qgis not supporting for geometry type "GEOMETRY".
7
votes
2answers
4k views

Search functionality in Openlayers/Geoserver

I am using Openlayers,Geoserver & Postgis.... My postgis tables are having columns as id, name, POINT/POLYGON/LINE. Each table corresponds to a layer that I am showing in layerswitcher in OL. I ...