PostGIS is an extension for the PostgreSQL object-relational database that adds support for geographic objects.
16
votes
5answers
2k 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 ...
18
votes
8answers
3k 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 ...
4
votes
2answers
759 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 ...
18
votes
2answers
2k 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, ...
13
votes
6answers
4k 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
5answers
5k views
ArcGIS and PostGIS
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 ...
16
votes
4answers
3k 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, ...
8
votes
3answers
1k 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 ...
22
votes
9answers
9k views
How can I connect to a PostGIS database from ArcMap 9.3 and 10.0?
How can I connect to a PostGIS database from ArcMap 9.3 or 10.0?
Ideally, I would like to be able to perform spatially enabled queries and receive the results back (e.g. spatial and non-spatial ...
19
votes
4answers
1k 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 ...
6
votes
1answer
714 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, ...
30
votes
3answers
5k 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 ...
17
votes
2answers
1k 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 ...
16
votes
3answers
2k 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 ...
22
votes
4answers
2k views
PostGIS: What are the pros and cons of 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 ...
13
votes
6answers
4k 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 ...
10
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 ...
16
votes
4answers
1k 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:
8
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 ...
8
votes
2answers
655 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 ...
4
votes
4answers
1k 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 ...
1
vote
1answer
669 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 ...
19
votes
7answers
6k 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 ...
13
votes
2answers
3k 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 ...
12
votes
3answers
2k 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 ...
16
votes
4answers
831 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 ...
15
votes
3answers
3k 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 ...
8
votes
2answers
630 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 ...
6
votes
1answer
1k 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 ...
7
votes
2answers
7k 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 ...
6
votes
1answer
828 views
Postgresql for Qgis and Arcgis - What to do/What not to do
Is it possible to use postgresql with QGIS and ArcGIS? 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 that I ...
4
votes
1answer
1k 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
2answers
930 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
0answers
174 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 ...
1
vote
1answer
743 views
psycopg2 error with QGIS 1.5
So I just installed QGIS 1.5 using the windows installer not the osgeo4w one and now any plugins that need access to PostgreSQL databases don't seem to work, they all throw a:
"Couldn't import Python ...
29
votes
7answers
2k 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 ...
12
votes
1answer
978 views
Open-source GIS implementation of the Huff model
This might be a stretch, but I was wondering if anyone implemented gravity modeling tools or scripts for Retail Market Analysis (like the Huff Model), to analyze spatial data for customer-store ...
13
votes
3answers
2k views
In PostGIS is it possible to create a View with a unique ID?
When I create a view in PostGIS is there any way to add a unique ID to that view? Just like the "gid" field in any other PostGIS table?
Edit: Sorry I should have included this in the original post. I ...
12
votes
7answers
1k views
How to batch synchronize data from ArcSDE to PostGIS?
Its been suggested that i ask this question again, but perhaps worded differently than how to Bulk load multiple shapefiles into PostGIS.
I'm new to postgis and sql but i want to use postgis as a ...
11
votes
4answers
2k views
Simplifying adjacent polygons
I encountered a problem simplifying set of polygons that are adjacent. If I simplify each polygon separately with the Douglas–Peucker algorithm (which is used by many open source tools), the resulting ...
10
votes
3answers
1k views
Optimizing a nearest neighbor calculation using PostGIS
I'm using PostGIS to calculate the nearest neighbors of polygons. What I want to calculate is the minimum distance from each polygon, to the nearest polygon.
Thus far I have got great help from Mike ...
8
votes
2answers
1k views
How do you display related records in QGIS?
Coming from an esri background I have always used relationship classes in a gdb to display records related to a feature. Eg. Relate 1 survey point to many documents, photos etc.
Does any one know how ...
13
votes
2answers
1k 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 ...
11
votes
2answers
2k views
How to change the geometry type from Point to Multipoint within an existing table in PostGIS?
Is there a PostGIS function that can change geometry type for an existing table?
We need to change from POINT to MULTIPOINT.
The table will be empty when we change the geometry type and we cannot ...
6
votes
1answer
314 views
Filling a polygon with lines using Postgis
i need to calculate a specific distance in an area. The distance is calculated from parallel lines in a polygon, And i need to find out how many parallel lines (with x meters distance to each other) ...
5
votes
1answer
2k views
How to create a tables from existing tables (applying new schemas) in postgis DB?
I have a table that is geospatially enabled; that contain world borders. I want to break it down to different schemas (global, europe etc..) . My thought is to use use something that looks like this:
...
7
votes
2answers
3k 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
4answers
995 views
Point in polygon algorithm for multiple polygons
I've a Google map with bunch of polygons on it.
Here is a problem I'm interested in: Given a lat,lng point, what's the best way to determine all the polygons that this point lies in?
The obvious way ...
6
votes
3answers
3k 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 ...
4
votes
1answer
2k views
How to import a raster into PostGIS?
I'm trying to follow the instructions here to load a raster into a PostGIS database:
python raster2pgsql.py -s 4269 -I -r *.tif -F myschema.demelevation -o elev.sql
I understand that I replace * ...




