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

learn more… | top users | synonyms

1
vote
0answers
533 views

How to add ECW support to GDAL bundled with PostGIS Windows

I'm currently trying the new raster functionalities of PostGIS 2.0 and I successfully imported some GeoTIFF file into PostGIS (although it only find one band so it's all black and white for some ...
0
votes
1answer
111 views

How to union polygons and add attribute values of combined output features

I have a layer containing 10 polygons all overlapping at various locations. Each polygon has a value of '1' in a column called "value" How do I Union the polygons (rows) together such that the ...
9
votes
2answers
1k views

PostGIS raster value of a lat/lon point

I have a tiff raster in my PostGIS 2.0 database. I want to get the value of the raster at a specified lat/lon point. I have: postgresql-9.1 postgis-2.0-svn with raster support a raster imported ...
6
votes
2answers
1k views

GeoServer: Shapefile or PostGIS?

I'm going to build a web application, which will render around ten maps using GeoServer. I will be also changing the attribute data in the application for some layers. So, what is the recommended ...
6
votes
5answers
5k views

How to load Shapefiles into a remote PostGIS db using command line?

Can we import a Shapefile from a system which doesn't have PostgreSQL installed (client machine) into a system having PostGIS installed? I am getting problem with 'shp2pgsql' and 'psql' since both ...
6
votes
2answers
352 views

Clarification of the “25D” option in ogr2ogr

[EDIT: In my original post, I had received an error that was based on a typo, so I scrapped that part of the question, but left the questions that still apply.] In the ogr2ogr docs it says: -nlt ...
6
votes
1answer
903 views

QGIS WKT Raster Plugin error, what does this mean?

I have been playing with the WKT Raster plugin. I have installed the WKT Raster experimental binaries in PostGIS successfully and followed the instructions in the read me to the letter. When i am in ...
5
votes
2answers
142 views

How to replicate ArcGIS Intersect in PostGIS

I'm trying to replicate this ArcGIS process in PostGIS: http://blogs.esri.com/esri/arcgis/2012/11/13/spaghetti_and_meatballs/. This describes how to break buffered points down into polygons based on ...
5
votes
1answer
233 views

How to achieve equivalent to Dissolve from ArcGIS for Desktop using ST_Union?

I am trying to achieve an equivalent to the Dissolve tool from ArcGIS for Desktop using ST_Union from PostGIS but it seems I am not getting expected result. I have one table which has certain ...
5
votes
4answers
3k views

How to convert multipoint layer to point

I have a Spatialite layer which is multipoint (following a QGIS Save As from shapefile). I need it to be PostGIS and POINT. I have tried ogr2ogr -nlt POINT and got 'new row for relation "xxx" violates ...
5
votes
1answer
427 views

How to interpolate polyline or line from points?

We have a lot of points, but with no timestamps to create ways. For now, I've created a sample of the way the points traverse. It's in here, this way can be compared with a Google one. I haven't ...
5
votes
1answer
985 views

Why do TIF loaded into PostGIS lose their colormap?

I have successfully loaded a TIF image (using raster2pgsql) into my PostGIS 2.0.1 database. I can load the raster image into QGIS and it displays in the correct space. However, it has lost all colour ...
5
votes
1answer
907 views

Raster data on PostGIS

I need to publish raster and vector data through GeoServer WMS service and I have already chosen PostGIS as datasource to keep vector data. Now I would like to know what is the best practice to work ...
5
votes
4answers
2k views

OSM To Postgis & WGS84 problems

I’m trying to import OpenStreetMap (OSM) data into postGIS it doesn’t appear to be working in that features do not appear to be in the correct place.. Using the QGIS OSM add in and a coastal shape ...
5
votes
1answer
359 views

How to filter points based on proximity while inserting into PostGIS?

I have a large amount of locations that need to be inserted to a PostGIS database. However, I'd like to aggregate these points so that if there's already a location, say nearer than a kilometer, then ...
5
votes
1answer
668 views

How to get GeoNetwork to search through PostGIS fields via GeoServer WMS

I can't seem to get GeoNetwork to search through my PostGIS fields via GeoServer WMS. According to the GeoNetwork Documentation: it should loop over datasets served by the service and produce ...
4
votes
3answers
532 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 ...
4
votes
1answer
84 views

Why does only one of the following queries throw an error?

There are 2 SQL queries: SELECT wkb_geometry FROM building_polygon WHERE ST_Contains(wkb_geometry, ST_GeomFromText('POINT (29.4 60.1)')); SELECT wkb_geometry FROM building_polygon WHERE ...
4
votes
2answers
478 views

QGIS saving analysis output as Postgis table

i am using QGIS and Postgis together. I can load data in Postgis and than i import it to QGIS. But i am trying to save an analysis output (example: buffer analysis, voronoi polygon or SEXTANTE ...
4
votes
3answers
383 views

How to find out what features /tags are included in an .osm or .pbf file?

I would like to load osm data into a postgis (postgresql) database. In How to load OSM data into PostGIS preserving all Tags? there has been a solution posted: Download the OSM files (in .osm ...
4
votes
2answers
2k views

How to select segment of linestring using PostGIS?

i have PostgreSQL+PostGIS. I have a linestring: "LINESTRING(60.7014631515719 56.8441322356241,60.7023117507097 56.8445673405349,60.702948200063 56.8447993944193,60.703902874093 ...
4
votes
1answer
218 views

Update PostGIS after updating GDAL?

I am using PostGIS 2.0 and I want to use the raster functionality through mapserver. It seems as if the latest official GDAL release 1.9.1 has an unstable PostGIS raster driver, as pointed out in a ...
4
votes
1answer
342 views

Self-intersecting polygon using extreme values

I have this polygon POLYGON((1.2E-15 1.1E-15,1.31E-15 1.21E-15,-180 -90,180 90,1.2E-15 1.1E-15)) It uses an extreme coordinates like (1.2E-15 1.1E-15) and (180 90) When I call ST_isValidReason, ...
4
votes
1answer
2k views

Performing Geoprocessing SQL Queries in QGIS from a PostGIS Database

This may be a dumb question, but is there way to run a PostGIS geoprocessing SQL query in QGIS? Specifically, I am thinking of running SQLs such as ST_Union, ST_Split etc etc. I have tried the ...
4
votes
2answers
685 views

Indian Latitude Longitude values

I am in need of around 10000 and odd Indian latitude and longitude values for my openlayers project. I have to load them in a postgis db. so a sql file or atleast text file would be better than a ...
3
votes
2answers
361 views

How can I GROUP BY linear spatial clusters with PostGIS?

I have a series of points in a horizontal line, arranged into discrete spatial clusters by the underlying data pattern. Here's an example of what they look like: How can I use PostGIS to group them ...
3
votes
2answers
2k views

What is the unit used in ST_Distance()?

I wonder what the unit is of the float being returned from ST_Distance. In the documentation it says: ...cartesian minimum distance (based on spatial ref) between two geometries in projected ...
3
votes
1answer
561 views

Importing grib, grib2, netcdf to PostGIS

According to grib2 to raster? (grib2 -> raster2pgsql -> PostGIS 2.0 -> GeoServer), it seems like that grib2 can be treated as raster directly. Is it the so called "standard" way? How about ...
3
votes
3answers
565 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
825 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
25 views

PostGIS GML round trip confusion

I've investigated the issue of coordinate order in GML and each time I think I've got it but I find my self confused once again. I think some of my confusion may be to do with PostGIS. Doing a ...
2
votes
2answers
61 views

How to export thousands of features from PostGIS to a single GeoJSON file?

I know how to export one feature from a PostGIS database using ogr2ogr: $ogr2ogr -f GeoJSON out.json "PG:host=localhost dbname=xxx user=xxx password=xxx" -sql 'select id, county, wkb_geometry from ...
2
votes
1answer
68 views

QGIS select reversed geometries

I have a road network and a geometry for each road direction. One Geometry from A->B and another Geometry from B->A. This geometries are covering each other. Is there a tool available in QGIS to ...
2
votes
0answers
50 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 ...
2
votes
1answer
50 views

Redefining the border of a polygon in Postgis

I have a PostGIS algorithm that writes a table with "pixelated" polygons, that I will call "clusters". My idea is to smooth the edges of these clusters using concave hulls (ST_ConcaveHull). To do ...
2
votes
2answers
189 views

QGIS WFS Error - Could not commit changes to layer

I have a PostGIS database being served by Geoserver. I can load the layers I want into QGIS no worries; however whenever I try to edit the layer I get this error message: Could not commit changes to ...
2
votes
1answer
70 views

Databases supporting intersection of multipolygons and a set of points

Currently we use PostGIS to store thousands of MULTIPOLYGONs and we can then use ST_Intersects to return any that rows contain any point in an input collection of points. Are there any other open ...
2
votes
1answer
78 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
117 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
129 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
167 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
160 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
352 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
93 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
65 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
1answer
107 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
4k 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
310 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 ...