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

learn more… | top users | synonyms

17
votes
6answers
7k 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 ...
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 ...
23
votes
10answers
4k 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 ...
24
votes
2answers
4k 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, ...
25
votes
4answers
3k 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 ...
29
votes
6answers
8k 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 ...
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 ...
40
votes
3answers
10k 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 ...
4
votes
2answers
837 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 ...
19
votes
1answer
6k 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?
17
votes
4answers
5k 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, ...
18
votes
5answers
2k 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:
36
votes
7answers
3k 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 ...
29
votes
2answers
3k 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 ...
24
votes
9answers
12k 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 ...
18
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 ...
20
votes
3answers
7k 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 ...
9
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
966 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, ...
31
votes
4answers
5k 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 ...
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 ...
9
votes
2answers
1k 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 ...
17
votes
4answers
8k 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 ...
22
votes
5answers
8k 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 ...
20
votes
3answers
3k 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
3k 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 ...
10
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
2k 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
184 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 ...
5
votes
2answers
2k 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 ...
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 ...
43
votes
8answers
7k 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 ...
52
votes
8answers
3k 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 ...
19
votes
7answers
7k 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 ...
19
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 ...
13
votes
3answers
8k 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 ...
12
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 ...
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
2k 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 ...
13
votes
2answers
21k 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 ...
9
votes
2answers
4k 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
4answers
4k 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.
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 ...
6
votes
1answer
2k views

How do I get a route between two points using PgRouting with TIGER2010 Data

A little background: I've got PostGIS 2.0 and all the TIGER2010 data loaded for a U.S. State California. I've got a table with points stored as data type geometry. I've learned enough to get the ...
3
votes
2answers
594 views

How to perform SIA or Bezier line smoothing in PostGIS?

Can anyone provide an example SQL for smoothing linestrings from postgis table using Bezier curves or Iterative Averaging (SIA) algorithm?
4
votes
2answers
1k views

I want to edit corresponding postgresql data of a vector from openlayers- how to do it?

I want to edit the corresponding text/numeric data type columns of a vector through openlayres, when a user click/mouse over a vector. like, http://dev4.mapgears.com/bdga/bdgaWFS-T.html# any ...
3
votes
1answer
5k views

How to install PostgreSQL 9.2 with PostGIS 2.0 on Ubuntu 11.10 (or higher)?

I have read this question: Install PostGIS v2 for PostgreSQL v9.2, but it didn't resolve my problem. I added the PostgreSQL backports PPA and installed the postgresql-9.2 package, but there is no ...