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

learn more… | top users | synonyms

6
votes
1answer
3k 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 ...
4
votes
2answers
736 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?
10
votes
3answers
1k views

How to interpolate GPS Positions in PostGIS

I have a PostGIS table of GPS positions for every five seconds: 2011-01-01 00:00:05, POINT(x1,y1) 2011-01-01 00:00:10, POINT(x2,y2) 2011-01-01 00:00:15, POINT(x3,y3) ... I'm looking for a query ...
5
votes
3answers
9k views

How to convert MultiLinestring to Linestring?

I have a multiline string and want to convert it to a linestring in order to use some functions that only work with linestrings. I used ST_Dump() and got a collection of my geometries. If I merge them ...
5
votes
2answers
2k views

How to get multiple shortest paths with PgRouting in one query?

I want to run shortest path algorithm on multiple source&target pairs at once and get a result as a table and process it then. How do I do this? This query does not work: SELECT a.source, ...
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
2answers
6k 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 ...
8
votes
2answers
400 views

postgis, extrapolate a line

I'm trying to extrapolate from a line segment to find a point on the line but a 3rd of the way 'back', i.e. trying to find point new, given points A and B below: Given a line, I can interpolate it ...
1
vote
2answers
1k views

How to select all points within a circle in PostGIS?

I have set of points in a PostGIS Table (Type Geometry). Now, I need to filter points that lie in a circle with a center (C) and radius (R)! I expect C to be of type Point or Coordinates.. R to be ...
1
vote
1answer
831 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 ...
5
votes
1answer
3k views

Install PostGIS on Ubuntu 12.04

I am trying to install PostGIS on Ubuntu 12.04 and I think everything is installed correctly except for postgresql. I followed this post. I get the following error and nothing I do seems to satisfy ...
4
votes
2answers
4k views

How to display a PostGIS table on Google maps?

I am attempting to take a shape file and display it on a map: I can do something like this: SELECT ST_AsText((ST_Dump(the_geom)).geom) as the_geom FROM shapes; But the problem is I still have to ...
3
votes
2answers
563 views

What is this PostGIS query doing to show great circle connections?

I'm trying to draw a flight map in CartoDB. My starting point is a single lat long point. We'll pretend it is this: ST_GeomFromText('POINT(-71.060316 48.432044)', 4326) And I want draw lines ...
3
votes
1answer
1k views

How to Import ESRI Geodatabase format .gdb into PostGIS

I ran into a problem when loading a ESRI Geodatabase format .gdb into PostGIS. I have data 2.5GB GDB file. I followed some tutorials on the internet, but it seems that doesn't work out. I created a ...
3
votes
2answers
371 views

QGIS DB manager Import layer/file tool won't allow me to choose “Append data to table”

I want to append some data to a layer in my PostGIS DB using a shapefile, but when I use the Import layer/file tool in QGIS, it doesn't allow me to choose the append option. Why is this and how do I ...
1
vote
1answer
162 views

pgrouting unexpected output

Thats my ways.shp file. I loaded this to PostgreSQL DB using PostGIS shape file loader. I ran pgr_anlayzeGraph() on it and found it had a lot of isolated segments. Next I ran pgr_nodeNetwork() to ...
-3
votes
1answer
83 views

Is it possible to access geoserver wfs layer from localhost:8080 in to web application? [closed]

I want to add a WFS layer. I am trying to get WFS layer from localhost:8080 geoserver. but I am getting eoserver DateLineWrap in Openlayers.js file...
30
votes
3answers
10k views

Best GIS system for high performance web application - PostGIS vs MongoDB

I am working on a web/mobile application based on location data. Since i am already familiar with MongoDB, i found the geospatial indexing of mongo is quite suitable for my needs. As i am mainly ...
12
votes
1answer
2k 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 ...
18
votes
3answers
4k 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 ...
15
votes
2answers
7k 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 ...
14
votes
4answers
3k 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
4k views

Which is the best way of working with PostGIS data in R?

I work with R almost all the time, and now I am using it for doing spatial data mining, but I have this question: I have a PostGIS database with (obviously) GIS data, If I want to make statistical ...
10
votes
2answers
2k 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 ...
11
votes
3answers
2k 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
1answer
2k views

One to Many Relationship in QGIS with PostGIS

Does anyone know of any tool that can do a One-to-Many relationship in QGIS. I have my data in a PostGIS database. I would like to be able to query spatial layers that are related to spatial or non ...
19
votes
4answers
6k views

What is the best way to join lots of small polygons to form a larger polygon?

I have the following layer using SRID 27700 in postgis: It's every administrative region in the UK, and (as you can see from the colour grouping) each of them has a text field specifying the county ...
14
votes
7answers
2k views

How to migrate 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 ...
13
votes
5answers
412 views

What in-depth spatial database systems tutorials exist?

Is there a good tutorial that explains in depth the internals of a GIS and a spatial database system such as PostGIS with examples and without any background assumption? I'm specifically looking for ...
13
votes
6answers
12k views

How can I enable Shapefile GUI Loader in pgadmin3?

I have installed PostgreSQL 9.1 with PostGIS 1.5.3 on Ubuntu 11.10. I also installed pgadmin3 1.14.0-beta1, following this instructions. If I remember correctly, when I installed PostGIS on Windows ...
8
votes
3answers
4k views

How to insert a GeoJSON polygon into a PostGIS table?

I need to insert a polygon from GeoJSON to my PostGIS table. This is how the SQL query looks like. INSERT INTO tablename (name, polygon) VALUES ( 'Name', ST_GeomFromGeoJSON ( { ...
30
votes
2answers
1k views

What coordinate system should be used to store geography data for celestial coordinates?

I am doing an astronomy project. I want to have the information about our images stored in a spatially enabled database. This, I would think, should be a very easy special case for GIS functions ...
20
votes
3answers
3k views

Meaning of Simplify's tolerance parameter

The standard parameters of Douglas-Peucker's simplify algorithm are geometry and tolerance (e.g ST_Simplify in PostGIS). What's the meaning of the tolerance parameter? I know that the bigger the ...
15
votes
4answers
4k views

How to create a circle in PostGIS?

I'm using PostGIS 1.5.2, with geometries in SRID:900913. I need create a circles using a list of points as centre, with a radius of 600 kilometers. I'm using this query: INSERT INTO circles (geom) ( ...
9
votes
2answers
8k views

Adding shapefiles to PostGIS database

I was able to create a Postgresql database and then I executed, createlang plpgsql geospecies psql -d geospecies -f postgis.sql psql -d geospecies -f spatial_ref_sys.sql So now can I directly ...
8
votes
1answer
4k views

How to create a table 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: ...
6
votes
1answer
289 views

How to use ST_DelaunayTriangles to construct a Voronoi diagram?

With PostGIS 2.1+ we can use ST_DelaunayTriangles() to generate a Delaunay triangulation, that is a dual graph of its Voronoi diagram, and, in theory, they have an exact and reversible conversion. ...
6
votes
1answer
485 views

calculate slope for a road network

I am working on a road network for routing operations using postgis and QGIS. I am new to both of these tools and need to calculate the slope for each edge (by retrieving the Z value for the start ...
6
votes
1answer
545 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) ...
6
votes
4answers
2k 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 ...
5
votes
2answers
2k views

Using OpenLayers (with OpenStreetMaps) and PostGis for rendering data acquired from GPS tracking device?

I'm researching and planing to acquire data from GPS device and store them in postGIS database, then use geodjango to process/work them out and finally chart them on a map with OpenLayers. Will these ...
18
votes
6answers
4k views

How do you best deal with data that spreads across UTM Zones?

I have data that spreads across two UTM Zones GDA/MGA94 UTM Zone 55 and 56. I have layers such as a cadastre, roads, pipelines etc where I want to store measurements like lengths and areas in metres ...
9
votes
1answer
259 views

Can PostGIS and QGIS provide dependable multi-user editing?

After considering a few options, I'm trying to give my 15-20 QGIS 2.2 users the ability to concurrently view/edit one or two basic point PostGIS layers, largest one has just 16,000 records. I've ...
7
votes
3answers
425 views

Is there a paid service for accessing a PostGIS/OSM DB

I want to render a world map with mapnik and postgis, but do not want to set up my own DB, because the needed hardware and processing time for the OSM import make it nearly impossible for me. I just ...
6
votes
1answer
764 views

What is a “non-noded intersection”?

Can someone provide a precise definition of what a "non-noded intersection" is? There are various GIS platforms and toolkits that have errors with this text, and Google search results for this tend to ...
6
votes
1answer
4k 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 * ...
9
votes
1answer
2k views

Merge Multiple Tables into a New Table in PostGIS

I am looking to merge a number of individual tables into a new table in PostGIS. This is an easy task when working with Shapefile data, but I am unsure how to do this in PostGIS. Any help would be ...
7
votes
4answers
339 views

Is there a way to identify and remove similar GPS tracks in PostGIS or ArcGIS?

I have a large number of GPS tracks from a number of different users. I'd like to identify tracks that take the same route and remove those duplicates. For example, a user takes the same streets from ...
6
votes
6answers
2k views

How to calculate the maximum distance within a polygon in x-direction (east-west direction) in PostGIS?

I am interested in the maximum width of a polygon, e.g. a lake, in the east-west direction. Bounding boxes will help only in simple polygons but not in complex concave polygons.
6
votes
3answers
812 views

Retrieve polygon smallest MBR

I have a postgis table containing polygons. I want to transform my polygons to 4 points polygons : retrieve the smallest MBR. Here comes an illustration of what I want : My original polygon is ...