Questions tagged [postgis]

Use this tag for PostGIS, which is a spatial database extension for PostgreSQL. Before using this tag, please consider whether your question might be a better fit for the Geographic Information Systems Stack Exchange site (e.g. if it's more about configuration or geodetic principles than about actual programming).

PostGIS is an open source extension for PostgreSQL that adds support for geographic objects. In effect, PostGIS "spatially enables" the PostgreSQL server, allowing it to be used for geographic information systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS follows the OpenGIS "Simple Features Specification for SQL" and has been certified as compliant with the "Types and Functions" profile.

PostGIS questions also on-topic for the Geographic Information Systems Stack Exchange site.

PostGIS has been developed by Refractions Research as a project in open source spatial database technology and is released under the GNU General Public License.

Features

  • Geometry types for points, linestrings, polygons, multipoints, multilinestrings, multipolygons and geometrycollections.
  • Spatial predicates for determining the interactions of geometries using the 3x3 Egenhofer matrix (provided by the GEOS software library).
  • Spatial operators for determining geospatial measurements like area, distance, length and perimeter.
  • Spatial operators for determining geospatial set operations, like union, difference, symmetric difference and buffers (provided by GEOS).
  • R-tree-over-GiST (Generalised Search Tree) spatial indexes for high speed spatial querying.
  • Index selectivity support, to provide high performance query plans for mixed spatial/non-spatial queries.

Tutorials:

4548 questions
2
votes
1 answer

Temporal aggregation in PostGIS

I have a database of climatic data for farms in postgresql/postgis. it contains information about temperature, humidity and ... for farms and it is updated every hour. I need to perform some (spatio-)temporal aggregation on it. the queries would be…
f.ashouri
  • 5,409
  • 13
  • 44
  • 52
2
votes
3 answers

How to calculate distance between points on python side of my application in way that is consistent in what database does

I'm writing an application that makes heavy use of geodjango (on PostGis) and spatial lookups. Distance queries on database side work great, but now I have to calculate distance between two points on python side of application (these points come…
jb.
  • 23,300
  • 18
  • 98
  • 136
2
votes
3 answers

GeoServer won't write to my PostgreSQL updateable view

Following on from this earlier question I'm on PostgreSQL 8.4 and am having trouble with updatable views. I have a view: CREATE VIEW filedata_view AS SELECT num, id, ST_TRANSFORM(the_geom,900913) AS the_geom FROM filedata And want to update it from…
Kliver Max
  • 5,107
  • 22
  • 95
  • 148
2
votes
1 answer

How to update table when view is updated?

I want to update table when her view is updated. I use postgresql/postgis. I create view. CREATE VIEW filedata_view AS SELECT num, id, ST_TRANSFORM(the_geom,900913) FROM filedata And now when its updated i want to update TABLE with this data. But i…
Kliver Max
  • 5,107
  • 22
  • 95
  • 148
2
votes
1 answer

Convert Postgis table to SQL Server 2008

Is there a simple way to do that?
Paul
  • 12,359
  • 20
  • 64
  • 101
2
votes
3 answers

Upgrading Postgre 8.4 to 9.1 on Ubuntu (Turnkey Linux)

I am trying to get Postgre 9.1 to work because I need the features available in the 2.0 version of PostGIS. Turnkey Linux offers a Postgre 8.4 appliance which works great and even has PostGIS built in... but it's only version 1.2. I followed this…
DirtyBirdNJ
  • 574
  • 10
  • 26
2
votes
1 answer

postgis st_geomfromgml, what is wrong with my point?

In PostGIS 2.0 I try: select ST_GeomFromGML( ' 275466.0 565559.0 0.0 '); This gives an error: ********** Error ********** ERROR: invalid GML…
milovanderlinden
  • 1,124
  • 1
  • 12
  • 27
2
votes
2 answers

new row for relation "venues" violates check constraint "enforce_srid_latlon"

I'm getting the following error when I try to create a new venue that is location aware. ActiveRecord::StatementInvalid: PG::Error: ERROR: new row for relation "venues" violates check constraint "enforce_srid_latlon" This is the method I follow to…
codabrink
  • 140
  • 1
  • 7
2
votes
3 answers

linestring output format by lat lon

Is there a way to return linestrings from my postgis database in this type of format? Line: 1, "Road" 35.62200200, -88.98259200 35.62203500, -88.98240800 35.62202700, -88.98231000 35.62180000, -88.98163400 35.62175700, -88.98149000 35.62172500,…
Chris
  • 1,841
  • 2
  • 12
  • 8
2
votes
2 answers

pgRouting Front End/API

I can't find any reliable info about some kind of "human" readable front end or api to pgRouting. I have OSM PostGIS/pgRouting database which I would like to use to calculate paths between points. The problem is that I can't find any software that…
dr4cul4
  • 258
  • 4
  • 14
2
votes
1 answer

Configuring PostGis on Dreamhost

I've installed PostGIS on my Dreamhost hosted VPS and have gotten to the configure section of the process as detailed here: http://postgis.refractions.net/documentation/manual-2.0/postgis_installation.html#installation_configuration In the last line…
user1452440
  • 31
  • 1
  • 3
2
votes
2 answers

Querying a PostGIS database with a KML "shapefile"

I am working on a Google Maps application that doee the following (on a low zoom level): Prints a bunch of polygon overlays onto the map. These polygons are created from KML files that I created with Google Earth. Basically these polygons cover…
priestc
  • 33,060
  • 24
  • 83
  • 117
2
votes
1 answer

Getting an error in my Postgresql database due to an issue with Postgis (Can't find $libdir/postgis-2.0?)

I randomly started getting this error today when I try to select from a column that holds a geometry value ERROR: could not access file "$libdir/postgis-2.0" My selects have been working fine before, but this just started happening today. Any tips…
Irlanco
  • 769
  • 1
  • 8
  • 22
2
votes
1 answer

Spatial gist index in postgis - performance

I have problem with gist index. I have table 'country' with 'geog' (geography,multipolygon) columny. I have also gist index on this column. This simple query with ST_CoveredBy() against table with 2 rows ( each 'geog' about 5MB) takes 13 s (the…
mareks.poland
  • 233
  • 2
  • 6
2
votes
2 answers

How can I get the zone administrive of a city from postgis (nominatim import)?

I retreived europe.osm database with osm2pgsql. And now I try to exploit it. Is there a way to get the state, country, region, from a way like a town hamlet locality or…
Christophe Debove
  • 6,088
  • 20
  • 73
  • 124