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

learn more… | top users | synonyms

3
votes
3answers
376 views

Best choice for building static maps: PostGIS, SpatiaLite or Shapefile?

I usually build static topographic maps, which are mostly printed. I'm often using OSM and rasterfiles (mainly different DEMs). The areas I'm mapping seldom exceeds 20.000 km². I'm using exclusively ...
3
votes
3answers
484 views

Create a point x meters from origin using st_translate in postgis

How do I create a point 1000 meters away from a reference point? The ST_Translate only supports geometry type. I also tried using ST_GeomFromText but that returns a unit and not in meters. Here is ...
3
votes
1answer
749 views

How to save a newly created shapefile in PostGIS?

I am creating shapefile using shapefile.py and my database has records more that 65k which is the limit of the shapefile. How can I create shapefiles then? Is it possible that somehow I am able to ...
3
votes
1answer
3k views

How to filter features in a layer?

I am trying to display certain features in a shapefile-based layer using QGIS. I have found the subset function in the properties panel, which does exactly what i want, but is too tedious given that I ...
3
votes
1answer
2k views

How to get the coordinate system from a PostGIS database?

My question is probably amazinlgy stupid, but I can't find the answer myself. I would like to extract from a database the latitude and longitude of points. For now, I'm getting x(the_geom) and ...
2
votes
1answer
65 views

PostGIS - How do I create a line that directly connects two earth points without travelling over a geodesic?

In PostGIS 2.1.1, I've noticed that if I create two distant earth points with equal altitude and then create a line connecting them, as I gather interpolated Z coordinate data along the line my Z ...
2
votes
1answer
77 views

How to calculate the shortest distance for multiple source and targets using PgRouting?

I have a table with points and a road network which includes driveways (where you enter the highway). I want to find the point which is closest to a driveway. So I was thinking I can calculate the ...
2
votes
1answer
78 views

nearest facility with pgrouting

I have a postgres table of students with lat, lon and geom, , and a table of schools with the same, and a table of roads that has been converted to nodes. I'm trying to find the driving distance to ...
2
votes
1answer
78 views

How to generate pgrouting source and target with OSM?

Is there anyone here can explain me more details for pgrouting's source and target? I'm wondering how to generate with the given lonlat in OSM PostGIS entities. In pgrouting's website, they are ...
2
votes
1answer
131 views

Empty geometries in GEOMETRYCOLLECTION

I just noticed some strange behavior in PostGIS, with respect to WKT parsing. A GeometryCollection containing 1 or more empty geometries postgis_test=# SELECT ...
2
votes
0answers
114 views

qgis-2.2.0 database tab missing

I have recently installed QGIS-2.2.0 but the Database tab in the top-menu bar is missing. It looks the main reason is missing libgdal1h library. But when I am installing it, it's removing ...
2
votes
1answer
108 views

Using PostGIS functions in ArcGIS Desktop for Layer Definition Query?

I am connecting ArcGIS Desktop 10.2 to Postgis 2.0.3 with PostgreSQL 9.2.4. No SDE. I can load data with no problems and access the data in ArcMap. However I can't seem to use PostGIS functions within ...
2
votes
1answer
233 views

PostgreSQL : finding all lines intersecting with a polygon

I am totally new in the world of GIS but as a student surveyor I am working on a project using postgreSQL and PostGIS. I have one database with all the roads of my country (lines), and one database ...
2
votes
1answer
80 views

When would a PostGIS geometry compare using ~= return true when ST_Equals returns false?

I have a couple of featureclasses in a 10.2 geodatabase/PostgreSQL 9.2.2 database and I've been struggling with the FeatureCompare tool--it is telling me geometries are different on some features ...
2
votes
1answer
58 views

PostGIS: How to understand ST_RasterToWorldCoord() right? (PostGIS 2.0)

After putting raster in to postGIS by this Thank @Sorin for helping me out! Now, I want to output raster tile, then view it on QGIS. But the problem is the output of ST_RasterToWorldCoord(raster ...
2
votes
2answers
451 views

What's the fastest way to do a bounding box query in PostGIS

I have a Postgres table, with almost 2 million rows, with a long-lat coordinates field in the form POINT(-73.4938 33.2405). Supposing there's a geospatial index on that field, what's the most ...
2
votes
1answer
95 views

How to change table name of command raster2pgsql

I am completely newbie with GIS and PostGIS as well I'm trying to load raster into postgreSQL with raster2pgsql. It runs well. However, the table name of the raster is generated automatically. For ...
2
votes
2answers
3k views

Installing postgis on postgresql 9.1 not working

I'm trying to install Postgis 2.0 on a perfectly functionig postgresql 9.1.10 database. I installed the package via: richard@srv1:/$ sudo apt-get install postgresql-9.1-postgis postgis Reading ...
2
votes
1answer
246 views

GeoWebCache seed task dies immediately after being submitted

The data comes from Geofabrik's Brazil slice: http://download.geofabrik.de/south-america/brazil.html Imported into a PostGIS DB with osm2pgsql. GeoServer is 2.4.0, running on latest Tomcat 7.0.x, on ...
2
votes
1answer
671 views

GeoTools and PostGIS with ESPG:3857

I'm trying to use both PostGIS and GeoTools with the same ESPG:3857 projection, however, it looks like the projections in PostGIS and GeoTools differ. This is what I have in PostGIS: PROJCS["WGS 84 ...
2
votes
1answer
793 views

PostGIS Dissolve/Union close polygons

I have approximately 1 million polygons that have been split by lines. However, this has caused one half of a polygon to be separated by approximately 50cm from its other half. After doing a lot of ...
2
votes
2answers
315 views

Can Geoserver return the raster value of a lat/lon point

I have a GeoTIFF published by Geoserver 2.2 and being used by Leaflet via WMS. How can I get Geoserver to return the raster value at a lat/long point? I'm guessing it has to do with using WCS, but ...
2
votes
1answer
197 views

st_clip and gdal_translate: “Error browsing database for PostGIS Raster properties” - Why?

Im using shell-script, postgis2.0 and gdal for trying to clip raster apart, using an overlapping raster and a the_geom-object. At first I create a view to clip the overlapping part of the raster. It ...
2
votes
2answers
1k views

KML from EPSG:4326 to EPSG:900913

im trying to create KML files manually (XML format) by extracting data from a postGIS database with "geography" values in a column. But i belive i need to transform the projection of each row in the ...
2
votes
1answer
762 views

How can I fix QGIS PostGIS Manager error 'shp2pgsql' is not recognized?

I have QGIS 1.8.0 installed via OSGeo Installer and work on win 7. All I need is to upload the shapefile to the database via this plugin. Unfortunately I am receiving an error: Something's wrong: ...
2
votes
0answers
234 views

From pgRouting shortest_path back to osm node id

I'm successfully performing path finding queries like shortest_path on data imported with osm2pgrouting. The tables I have inside my pgrouting DB are the following: List of relations ...
2
votes
1answer
390 views

Querying PostGIS Raster with MultiPoint

For one of my projects using PostGIS 2 I have a table with GPS tracks (igc_files). It holds records including a MULTIPOINT() column that has about 1,000 points for each record and a column that has an ...
2
votes
1answer
895 views

How to find polygons inside polygon with PostGIS 2.0

I have a relation representing all the counties in my country and the other one containing all the districts - e. g. each and every county is composed of several districts. How do I select them with ...
2
votes
3answers
840 views

adding non spatial attributes using geoserver

I am using Openlayers + geoext to perform transaction operations in postgis database using geoserver . i can insert spatial data into postgis but cannot insert other data like road name, road type in ...
2
votes
1answer
427 views

accessing postgis raster data using Query layer in ArcGIS

I tried to load raster file (jpg) into post gis using the syntax provided here "C:\Program Files (x86)\PostgreSQL\9.1\bin>raster2pgsql -I -C -e -Y -F -s 102003 -t 300x300 ras_test.tif ras_test1 | psql ...
2
votes
0answers
382 views

PostGIS: ST_Transform function conversion problem

I'm inserting map data from a GML file with srid EPSG:27700 into a PostGIS database table with srid EPSG:4326. I'm using the ST_Transform function as in this snippet: ...
2
votes
2answers
958 views

Select Duplicate Points PostGIS

I have a table made of merged point datasets in PostGIS. I want to select all of the features where two or more points have identical geom values. At present I just want to select so I can review ...
2
votes
2answers
2k views

Problem when calculating longitude and latitude for points

I have a PostGIS database with SRID=900913 (Google Mercator) and I would like to know the latitude and longitude of points. I use this command: ST_X(ST_TRANSFORM(the_geom,4283)) Following what is ...
2
votes
1answer
449 views

The minimum bounding circle of geometry that crosses the 180th meridian

Background: I've been given a task where I have to calculate the minimum bounding circle of Alaska (for the purpose of running a Roeck test). I'm using the Census' state level geometries available ...
2
votes
1answer
2k 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 ...
2
votes
2answers
389 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", ...
2
votes
1answer
824 views

GeoServer converting PostGIS timestamp with time zone

In a PostGIS view i have a field of data type "timestamp with time zone". In GeoServer this field is show with datatype "Timestamp" My problem is that i want the Timestamp to be show in my ...
2
votes
5answers
4k views

Error importing Shapefile to PostGIS using Importer GUI

I'm trying to import a shapefile into a PostGIS database using the graphical importer. I just installed POSTGRESQL, and PostGIS. The GUI looks like this: After testing that my database worked, I ...
1
vote
0answers
28 views

Rebuilding a Polygon from the points within it, in PostGIS

This question is an update on the problem formulated here. I wanted to redefine the border of a set of polygons, in order to "smooth it". My first approach (described in the former question) was to ...
1
vote
1answer
18 views

Configuring SFCGAL to PostGIS Db

I was using PostgreSQL with PostGIS and Pgrouting. Recently I needed to install SFCGAL for some extra functions for my PostGIS db. After installing SFCGAL, now I don't know how to update my PostGIS db ...
1
vote
1answer
60 views

Is the Azimuth on the equator equal to the one not on the equator?

I am trying to fully understand the concept of Azimuth and I am encountering some inconsistencies (or maybe it is my error). I show you some examples that do not match, hoping somebody can explain me ...
1
vote
1answer
48 views

GeographyFromText and ST_SetSRID+ST_MakePoint different results?

Why am I getting different results? SELECT ST_DISTANCE( ST_GeographyFromText('SRID=4326;POINT(13.401111 52.383343)'), --berlin ST_GeographyFromText('SRID=4326;POINT(9.997559 53.533778)') ...
1
vote
1answer
108 views

Converting file geodatabase with coded domains to PostgreSQL / PostGIS?

We have several file gdb's and would like to convert these to Postgres / PostGIS. We've used ogr2ogr to transfer these files; however, some of the fields are stored as coded domains and the fields are ...
1
vote
0answers
116 views

Why does QGIS crash when my PostGIS table has a primary key?

Configuration: PostGIS Library: 2.0.3 GEOS: 3.3.8-CAPI-1.7.8 Proj: Rel. 4.8.0, 6 March 2012 PostgreSQL 9.2.2, compiled by VC++ build 1600, 64 bit, running on Win2012 server 64 bit QGIS 2.2.0 - 32 ...
1
vote
1answer
97 views

PostGIS convert GeoJSON to geography

While there are functions to convert geography to GeoJSON: text ST_AsGeoJSON(geography geog, integer maxdecimaldigits=15, integer options=0); I do not see any way to go the opposite direction ...
1
vote
0answers
168 views

How to create a regular polygon grid in Openlayers?

I am trying to create a grid in my map and do some calculations. I seen the following links:- Create regular polygon grid using postgis Create regular polygon grid inside a polygon using postgis ...
1
vote
1answer
486 views

Error while installing PostGIS on ubuntu 12.04

This is my first practice on Ubuntu machine. Here i am trying to install PostGIS 2.1 on postgresql server 9.3.2. When i am following the procedure mentioned here Help I am getting the following ...
1
vote
1answer
575 views

Having trouble connecting QGIS with postgres database with postgis extension

I am working on Ubuntu Precise with postgresql version 9.3 and postgis 2.0. After initially starting my postgres database and eventually getting permission errors that would prevent postgres from ...
1
vote
0answers
40 views

How to load or query data directly to R from a PostGIS database using RPostgreSQL and rgdal [duplicate]

Is it possible to load/query a shapefile to R, which is stored in a postgres/postgis database? I've built up a connection to my postgres database via DBI, RPostgreSQL and I want to make some ...
1
vote
3answers
564 views

Why can't I open postgis layers in QGIS?

I've set up a table in PostGIS using OSM data (converted using osm2pgsql). I know this database is good, because I'm able to import it and work with it in TileMill, but whenever I try to interact with ...