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
9
votes
4 answers

Error when trying to run Create Extension postgis

I have installed PostgreSQL 9.x and PostGIS 1.5/2.0 several times and have never had this problem. I just got a new CentOS 6.3 server up and running and and I have Postgres 9.3 functioning as expected. I have run yum install postgis2_93 and I can…
losthorse
  • 1,530
  • 1
  • 13
  • 33
9
votes
4 answers

PostGIS Homebrew installation referencing an old path?

I upgraded and subsequently reinstalled PostGIS & PostgreSQL on OS X Mountain Lion. When trying to use the PostGIS extensions, I receive the following error: ERROR: could not open extension control file…
paddleman
  • 255
  • 2
  • 11
9
votes
1 answer

Converting lat-long to PostGIS geometry without querying the database

I have a table in postgresql with a PostGIS geometry(point, 4326) column (location, using SRID 4326) and I have a Python application that using SQL Alchemy updates the table (the rest of the columns) without any problem. Now, I need to update the…
Sergio Ayestarán
  • 5,590
  • 4
  • 38
  • 62
9
votes
1 answer

How to create a circle in meters in postgis?

I would like to ask how to create a circle with radius=4km. I have tried the ST_Buffer function but it creates a larger circle. (I see the created circle by inserting its polygon into an new kml file.) This is what i am trying. INSERT INTO…
Mike Vasi
  • 467
  • 2
  • 5
  • 16
9
votes
3 answers

Nearest places from a certain point

I have the following table create table places(lat_lng point, place_name varchar(50)); insert into places values (POINT(-126.4, 45.32), 'Food Bar'); What should be the query to get all places close to particular lat/long? gis is installed.
kapso
  • 11,703
  • 16
  • 58
  • 76
9
votes
3 answers

Differences between PostgreSQL and MySQL for PHP developers

For a project where most queries on the database will include requirements like "within an polygon" I have come to think about choosing PostgreSQL with PostGIS instead of MySQL, which I have previously mainly used. Mainly because PostgreSQL has more…
preyz
  • 3,029
  • 5
  • 29
  • 36
8
votes
4 answers

How can I transform the coordinates of a Shapefile?

I am trying to get neighborhood data into my application, and I'm having problems with the data I am using, which I got from here. This file contains a shapefile that has the neighborhoods of San Francisco. I am running a Ruby on Rails framework,…
Larry
  • 664
  • 6
  • 9
8
votes
2 answers

importing osm file into a postgres/postgis database

Im using the tool osm2pgsql to import an osm file into a postgres database using phppgadmin as the administrative tool. i have only downloaded a small town from osm in xml format and im having trouble importing it using the terminal on mac. Im a bit…
John
  • 619
  • 2
  • 9
  • 24
8
votes
3 answers

Cluster points in PostGIS

I'm building an application that pulls lat/long values from a database and plots them on a Google Map. There could be thousands of data points so I "cluster" points close to each other so the user is not overwhelmed with icons. At the moment I…
Mike Neumegen
  • 2,436
  • 1
  • 24
  • 39
8
votes
1 answer

Error installing PostGIS for PostgreSQL on Mac

I'm trying to install PostgreSQL with its PostGIS extension on Mac. The installation happens in two parts : 1) PostgreSQL and 2) PostGIS through the stack builder. The first phase goes smoothly, but the second phase returns the following error at…
Lucien S.
  • 5,123
  • 10
  • 52
  • 88
8
votes
0 answers

PostGIS & Hibernate can't de-serialize point geometry

I have created a PostGIS table for holding point data in a Springboot project. When I try to de-serialize this data I am getting a can't deserialize error invalid stream header: 30313031. The stacktrace is: java.io.StreamCorruptedException: invalid…
Ray Bond
  • 427
  • 3
  • 11
8
votes
3 answers

Spring boot app fails Method org.postgresql.jdbc4.Jdbc4Connection.createClob() is not yet implemented

I am using spring boot command line runner app, it hangs at PostGIS dialect, the below stack trace contains what's happening. Unable to understand what's going wrong, I have hibernate-spatial queries. 2018-04-06 12:11:08.554 INFO 31495 --- [ …
Pavanraotk
  • 1,097
  • 4
  • 15
  • 33
8
votes
1 answer

Geospatial support in JPA

How would I map point and polygon to java types. If this is not possible, what is a workaround? I would like to use geospatial support in mysql or postgres through JPA.
user308808
8
votes
1 answer

PostGIS - Route matching solution

We are building an application where I am a driver and i travel from point A to point B.On my way i can find passengers who travel in the same route. We are using PostgreSQL with PostGIS extension. After googling a lot i have found out that we can…
sdg
  • 1,306
  • 1
  • 13
  • 26
8
votes
1 answer

Liquibase dropFirst with postgis

I'm trying to add postgis extension to my postgressql database through Liquibase, here's how I've done it : CREATE EXTENSION IF NOT EXISTS postgis; It works fine, problem is when I'm developing I want my database to be reset every time I…
lepak
  • 369
  • 2
  • 9