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

learn more… | top users | synonyms

0
votes
1answer
427 views

Unable to Make PostGIS 2.0 - file not found

I am struggling to get the latest trunk of PostGIS to install on a fresh Mac running Lion. I did install PostGIS 1.5.3-2 for Postgres 9.1 from [KyngChaos Mac OSX Installers][1]. This setup worked ...
4
votes
3answers
471 views

How to efficiently find points within an elliptical area?

Using PostGIS 2.0.0 I need to filter the results of a function, which returns many POINTs, to find the ones that lie within an elliptical area defined by two points and a distance (all parameters ...
1
vote
1answer
128 views

How Do I Debug QuickExport Parameters in the Data Interoperability Extension for ArcGIS 10 to Exporting to Postgres

I tried to configure the QuickExport parameters by examining the log file after I used the QuickExport tool itself. The only things I changed from the log file are the parameters as I want the user to ...
5
votes
1answer
676 views

How to merge linestrings that don't touch based on common name?

I had a table of road line strings that contained duplicate road names with different geoms for different line segments. I extracted the duplicates to another table. I now want to join these segments ...
7
votes
2answers
3k views

Can't import OSM data to PostGIS, permission denied

I use Postgres 9.1 on Xubuntu 11.10. I've created a db 'aus' and user 'aus', granted ALL on the db to the user. Now I try to import the data, and it outputs this error: $ osm2pgsql --create ...
2
votes
1answer
223 views

How to get the Nth LineString from a MultiLineString in PostGIS?

I need a function that gets the Nth LineString from a MultiLineString in PostGIS, somthing like ST_PointN that gets the Nth point from a LineString.
4
votes
1answer
985 views

Split line using line/point in PostGIS 1.5

I have a layer that contains a master line (one big polyline) and a another layer that contains "break lines". I need to be able to split the master line at the intersection of each of these break ...
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 ...
5
votes
1answer
423 views

Efficiently querying a region-partitioned PostGIS table

I have two PostGIS tables: one of streets, and one of regions, which, apart from spanning the same spatial extent, are a priori unrelated. The streets queries I perform can be restricted to a given ...
6
votes
3answers
2k views

Dissolve or unsplit lines on common attributes in PostGIS or GRASS?

I have a road centerline shapefile that has roads split at every intersection. However, I would like to join LINESTRINGs that have a common set of attributes into a single LINESTRING. So long as the ...
10
votes
1answer
444 views

How to efficiently find the closest point over the dateline?

I have a PostgreSQL 9.1 table with hundreds of thousands of PostGIS POINTs. For each of these I'd like to find the closest point in another table of POINTs. The points in the second table represent a ...
1
vote
1answer
294 views

Problems with python postgis polygon

I have a problem with the examples in the book "Python Geospatial Development". I can't write to the PostgreSQL database polygons from TM_WORLD_BORDERS (Chapter 7, page 202 in book). Code: src_file = ...
7
votes
2answers
3k views

PostGIS ST_Buffer Radius Help

I am trying to find all points within a five-mile radius of a given point. I have a query like this: SELECT * FROM table WHERE ST_Contains(ST_Buffer(geomFromText('POINT(0 0)', 4326), ?), latlon) I ...
4
votes
2answers
364 views

Why is osm2pgrouting not importing?

I installed pgrouting successfully and did a little import with a 20Mb file. Works good! Now I'm trying to import a file with the size of a country and it doesn't even start to import. The last 2 ...
6
votes
1answer
542 views

How to sum area of polygons by values occuring in multiple fields?

My data has 2 fields holding landuse types, which both describe what is within the polygon. For example, the polygon may have Type1=Retail, Type2=Leisure Area= 1 but another polygon has Type1=Leisure, ...
5
votes
3answers
1k views

Is there a way to get ST_ClosestPoint for Geography type?

Using PostGIS 2.0.0 I'd like to find the point on a LINESTRING that is closest to a given point. The LINESTRING represents a great circle line (ie. geography type). ST_ClosestPoint appears to do ...
5
votes
1answer
4k views

.NET Entity Framework with PostGIS?

Is it possible to use the .NET Entity Framework with PostGIS? I've reviewed a few options, including hookup it up with Npgsql using ...
17
votes
1answer
1k views

What's the status of Postgis 2.0 topology support in QGIS?

Having followed the Postgis developments over the past 6 months I have noticed a bunch of features which seem to be incredibly cool especially in the area of topologies and associating calculations on ...
6
votes
2answers
1k views

Creating a spatial PostGIS table as a result of a PostGIS query

When I want to store the results of a spatial query as another PostGIS table, what should I do? I am interested in identifying all residential buildings that fall within a set of parcels: CREATE ...
6
votes
2answers
356 views

Memory considerations for cloud based GeoStack

Some time ago I asked about hardware considerations of cloud based GeoStack implementation. As a follow up to this question There are some good pointers in related question already, but they mainly ...
3
votes
4answers
849 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 ...
1
vote
1answer
233 views

How to get all intersecting points to a given area and vice-versa in PostGIS?

I'm developing a project using PostGIS to hold spatial data where I have records that hold geometry point data and records that hold geometry area data. To solve my problem I'm looking for two queries ...
2
votes
0answers
469 views

Arc by center point in PostGIS does not fit the circle

I'd like to store a GML ArcByCenterPoint in PostGIS. I can work out the start, middle and end points required by the CIRCULARSTRING type and all seems to be OK, except that when I visualise the arc it ...
2
votes
1answer
93 views

What's the use of the table extended_geometry_columns in PostGIS

Sometimes my PostGIS database creates a extended_geometry_columns table. After some search i've not found what is the use of this table. I'm using PostgreSQL 8.4 and PostGIS 1.3.3 This is the ...
4
votes
1answer
3k views

What does “Input geometry has unknown (-1) SRID” mean?

I am trying to run the following query to determine the area and number of points of a polygon: Select osm_id, st_npoints(the_geom) as numPoints, st_area(transform(the_geom, 3395))/1000000 as areakm2 ...
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 ...
2
votes
3answers
953 views

ST_MakeLine equivalent for CIRCULARSTRING in PostGIS

I'd like to make a CIRCULARSTRING in PostGIS 2.0.0 out of points that are calculated as part of the query (rather than constants). For a LINESTRING I can do this using ST_MakeLine(). Is there an ...
6
votes
3answers
1k views

Join intersecting lines with PostGIS

This is something that I'm almost ashamed to ask but I can't seem to get it to work for the life of me. I have a road layer with segments, each segment has a Road ID and a segment type. I would like ...
4
votes
1answer
227 views

Migrating Feature Datasets from ArcSDE to postgis

I am currently planning the migration of a database from ArcSDE/ Arcmap to postgis / Qgis. The data is stored in raster catalogues and feature datasets. Is there an equivalent to feature datasets ...
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
2answers
941 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 ...
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 ...
3
votes
1answer
269 views

How to show one to many relationships in GML from GeoServer/Postgis?

I am just figuring out how to use GeoServer and Postgis. I am using the States.shp example that came with GeoServer, and I have uploaded that into a table into the Postgis database. I have created a ...
10
votes
1answer
971 views

Can you query overlapping user-defined polygons at a given point in Google Maps?

I need to find out the limitation of working with the Google Maps API, and the possible solutions for doing semi-complex spatial comparisons. What I'm looking to achieve is a system of comparison ...
3
votes
2answers
308 views

How to recalculate the the length of a geography linestring from nearby geography point in POSTGIS?

I have a geography type linestring *route_geography geography(LineString,4326)*, its a route from point A to point B. Now I have a point C near that line. I want to find the nearest point on that ...
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, ...
10
votes
4answers
1k views

Alternatives to ogr2ogr for loading large GeoJson file(s) to PostGIS

I have a 7GB GeoJson file that I would like to load into a PostGIS database. I have tried using ogr2ogr but it fails because the file is too big for ogr2ogr to load into memory and then process. ...
0
votes
1answer
145 views

How to solve “Error creating GEOS Coordinate Sequence” in Postgis?

When I run this query: TRUNCATE sertaozinho.apps; INSERT INTO sertaozinho.apps (id,tipo,the_geom) VALUES (DEFAULT, 'app' ,( SELECT st_union( CASE WHEN area.cobertura = 'lago' THEN ...
3
votes
2answers
1k views

ST_Distance versus ST_Distance_Spheroid?

As my client software uses lat/lon coordinates when communicating with my (spherical mercator) postgis database i decided to ST_Transform every geometry to WGS-84. However i noticed that ST_Distance ...
0
votes
1answer
94 views

How to query distict row with the same label from different linestring with multiple segment?

I have a multilinestring street table in postgis with two columns: label and prefix. This table has 2 different roads with the same name and each road contains multiple segments. Roads were splitted ...
11
votes
1answer
939 views

Is there a PostGIS function for determining whether a linestring intersects itself?

I've been looking for a function that can tell me if a LineString intersects itself. I've tried calling st_intersects with the same LineString twice, but obviously identical linestrings will ...
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 ...
5
votes
1answer
941 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, ...
1
vote
0answers
670 views

Cannot Display Data From POSTGIS

I try to display the data that I have converted shp into PostGIS database with MapServer and OpenLayers. When I try to show directly shp file is successfully displayed in OpenLayers, but when I try to ...
1
vote
1answer
1k views

Mapserver/PostGIS Query Error

I'm having some difficulty understanding the error I am getting from my mapserver/postgis program. I have the following map file: MAP # start of map file NAME "sample" EXTENT ...
2
votes
1answer
3k views

Basic MapServer query of PostgreSQL/PostGIS database

I've just installed MapServer on a linux server and I am trying to understand how to display a basic map using a PostGIS database. I have displayed a shapefile in the browser, so I know that the ...
11
votes
1answer
571 views

Nearest Neighbor Grouped Selection in QGIS

OK - so I have an interesting problem I am trying to solve. I have a list containing over 100,000 points in lat/long format which I have imported into qgis. Now, what I am trying to do here is group ...
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 ...
2
votes
2answers
408 views

unable to call shp2pgsql using python

I am unable to call shp2pgsql using python as I have to pass various options like (-s -a -i) and I am not getting the required output .. Method I am using is p1 = subprocess.Popen(["cmd", "/C", ...
5
votes
2answers
466 views

PostGIS: Approximating a house number from address range

I'm developing a reverse-geocoder for Canada. So far, given a lat/lng, I can find the nearest street (line segment), which includes line segment direction and address ranges for both sides of the ...