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

learn more… | top users | synonyms

9
votes
0answers
268 views

How to extract sublinestring from a linestring with overlapping segments

Problem statement: Given a bus route (defined as a linestring ln.the_geom), and a set of bus stop locations (pt1.the_geom,pt2.the_geom,...ptn.the_geom), divide the bus route into segments between bus ...
8
votes
0answers
99 views

Accessing the internal data structure storing Postgis spatial index (PostGres GiST)

I am curious about how the internal data structures and storage mechanism of the spatial GiST index in Postgis. In Oracle, I used to like to show how the SDO indexes were "just another table", and how ...
8
votes
0answers
241 views

Joining layers with respective elements with PostGIS Topology

I'm currently using PostGIS topology extension, but I have some difficulties in understanding how the structure works: One of the key points is the use of "layer"s: as of what I understand, features ...
7
votes
0answers
212 views

Spatial query too slow to handle bigger OSM extracts

I'm trying to compute some statistics for OSM data using PostgreSQL 9.3.5 and PostGIS 2.1.4. I started with a small bavaria extract which I downloaded from Geofabrik. The db schema is the normal API 0....
7
votes
0answers
186 views

Add attribute table to a raster in postGIS

I would like to add attributes to a raster stored in a postgis database. I use the following command to insert the raster in the database: raster2pgsql -s 4236 -I -C -M /home/user/mysrc/outlabeled....
6
votes
0answers
857 views

PostGIS: Merge any and all adjacent polygons

I would like to do adjacency tests on a parcel (polygons) layer and merge them if they fit certain criteria (could be size). Per the picture below, I would like to merge polygons 1,2,3 and 4, but not ...
6
votes
0answers
158 views

Postgis database query optimisation

I have a set of rasters in DTED format which I load into postgis database using raster2pgsql command line tool. Each of rasters is simply stored in a row and described by rid and a value of raster ...
5
votes
0answers
128 views

Finding density centroids within polygons in PostGIS

I want to find the highest density of OpenStreetMap nodes within a dataset of census geometries. I want to tie the census data to the location of the node which is most central in terms of population. ...
5
votes
0answers
158 views

How to speed up simultaneous working with PostGIS layers in QGIS?

we are working on one big layer at the same time (10-20 people). Some of us use QGIS 2.8.1 and the other 2.6. The user with 2.8 have a lot of crashes (QGIS). The 2.6 users don't have this crashes but ...
5
votes
0answers
107 views

Diminishing performance of gdal_polygonize in a python subprocess for GRASS to PostgreSQL

I have written a python script to polygonize GRASS rasters into a PostgreSQL database using the gdal utility gdal_polygonize: sub.call('gdal_polygonize.py -8 gdb/quercus/{0}/cellhd/{1} -f "PostgreSQL\...
5
votes
0answers
187 views

GeoServer ImageMosaic PostGIS index update

I use GeoServer where I created an ImageMosaic storage following this manual. When I create new datastore, all *.tif files are indexed into DB (PostgreSQL with PostGIS). How can I create new index in ...
5
votes
0answers
247 views

How do I simplify the straight sections of (multi)Linestring in PostGres/PostGis leaving the curved sections untouched

I have (multi)linestrings containing upwards of 5000 points and I want to perform two simplifications possibly using Ramer Douglas Peucker or alternative methods in PostGis The (multi)linestrings ...
5
votes
0answers
570 views

Finding poi using st_dwithin in postgis

I am not familiar with gis or writing sql, so my understanding in this field is lacking. I have a hundreds of lat/lng geographic coordinates stored in a single table called Places like this: ID | ...
5
votes
0answers
543 views

Find points that fall within a radius using Hibernate Spatial

I am using hibernate spatial and postgis and i want to find the points that fall within a certain radius. Using this SQL: SELECT name FROM institution WHERE ST_DWithin(geom,ST_GeographyFromText('SRID=...
4
votes
0answers
85 views

Postgis sequence in QGIS not working

I have a Multipolygon-Layer stored in a Postgis-database. The primary key field 'gid' is SERIAL. When trying to add a new polygon in QGis (LYON 2.12.1 on OSX El Capitan), the attributes form shows me: ...
4
votes
0answers
50 views

Why won't my points (that I created by intersection) won't intersect with the geometry they've been created from?

I created a set of points by intersecting a linestring layer with the boundary of a multipolygon layer like this: CREATE TABLE freiraumkataster_grenze AS SELECT gid, ST_CollectionHomogenize(...
4
votes
0answers
35 views

Wrong coordinates after loading OSM to postgre

After loading OSM data for whole Europe to postgres (Osm2pgsql) I'm trying to add them to Geoserver, but the coordinates are totally wrong. The SRS is correct (4326), but the coordinate values are ...
4
votes
0answers
58 views

Tolerance in PostGIS

I am working with spatial data in land management using Oracle. The daily task is to perform spatial analysis: defining the mutual disposition of land plots borders, territorial areas etc. The ...
4
votes
0answers
118 views

Create polygon from lines in PostGIS

I'm trying to divide a polygon in smaller polygons from a line, but I think I can't use the st_split function. What I need is to create small polygons inside a big one, using linestring grid. I've ...
4
votes
0answers
516 views

Inserting coordinates from Google Maps into a Database

My question is pretty basic. I am using Android Google Maps to take the coordinates off a location on the map and I want to insert it into a PostgreSQL database. I know I have to use PostGIS but how ...
4
votes
0answers
165 views

How to set posgis default sequential value in a QGIS “editable” view?

Introduction In a QGIS project I have a VIEW, that I want to became editable (I'm trying to replicate the versioning system used DB Manager with some tweeks). Therefore I created a few rules to ...
4
votes
0answers
524 views

Hibernate Spatial - 'Invalid endian flag value encountered' Exception

I'm trying to run a simple query in Hibernate Spatial 4.0 on PostgreSQL 9.3. I have a number of objects in a table with latitude/longitude values, and I'm trying to query objects that fall within a ...
4
votes
0answers
501 views

Extracting x,y,z values from a postgis linestring to python using ogr

I am trying to load a postgis linestring into python (using ST_DumpPoints) and extracting x,y,z coordinates, which is working but extremely slow..and if i mean slow, i really mean it (yes, it takes ...
4
votes
0answers
269 views

Building larger polygons from smaller ones *without* common ID in PostGIS?

I am looking for a method, using PostGIS, of reconstituting a set of polygons from tens of thousands of smaller polygon 'pieces'. This is a simplified example, with the pieces shaded: Unfortunately,...
4
votes
0answers
376 views

Renaming Columns in Geotools FeatureType

I am attempting to build a simple java program that loads shapefiles into a Postgis 2.0 database. Everything is working out great except that I would like to be able to modify the FeatureType in the ...
4
votes
0answers
715 views

How to save table from PostgreSQL to MapInfo File?

I have two tables: 1 with geometry in WGS 2 with geometry in Local System I tried this: ogr2ogr -f "MapInfo File" output2.tab PG:"host=localhost user=postgres password=123456 dbname=postgis" -sql ...
4
votes
0answers
747 views

How can I properly add PostGIS data into MapGuide Maestro?

I am having trouble connecting a PostGIS database to MapGuide Maestro. Actually, I have added the PostGIS data into Maestro, but when I click to validate the layer it shows an error message: ...
3
votes
0answers
28 views

PostGIS - ST_SetValues is slow

I have large data in my C++ program (up to 3000x3000). I have connection to PSQL with PostGIS. Now I need to store my raster data (greyscale images) in DB raster. I am using ST_SetValues for this and ...
3
votes
0answers
59 views

Interpolating point to nearest polygons to compute street width in posgis

I am trying to calculate the width of streets (line.shp) in postgis using reference point (ref_point.shp) (yellow point features) and building polygons (building.shp). The red point features are the ...
3
votes
0answers
56 views

Styling using mi-style column from mapinfo

I have uploaded some MapInfo tables into postgis including the mi-style column using EasyLoader; I have had to rename all columns including both mi-style and sp-geometry columns to lowercase, ...
3
votes
0answers
75 views

Clipping raster with Postgis raster

I'm using Postgis 2.1.5 on Ubuntu 15.04. In my system there is a second disk mounted with the raster data as /media/name1/data/rasters/*.tif. The *.tif are good looking when I watch the metadata with ...
3
votes
0answers
65 views

Cached vector tiles with dynamic attributes

I am looking to implement a web map of property boundaries and owner information. The parcel data (property boundaries) is updated infrequently, but the assessment data is updated weekly, as ...
3
votes
0answers
87 views

How To save Geo-Tiff image in PostgresSQL?

I have a Geotiff image, which I want to load into a PostgreSQL database. Currently I am using the command line code for saving this image to my database : raster2pgsql -I -C -e -Y -F -s 26986 -t ...
3
votes
0answers
60 views

ogr2ogr imports GML data (not from OSM) to Postgis but without the other_tags “hstore”-column

The problem I'm encountering some issue trying to use ogr2ogr to import some GML input data (not OSM) into Postgres. I'm trying to use COLUMN_TYPES=other_tags=hstore to store all the fields not ...
3
votes
0answers
80 views

Import Large Shapefile to Postgres

I'm trying to import a large dataset to Postgres, of about 600MB, that sits on a remote AWS server. But I get the following error Not enough memory to allocate requested memory (nRecords=26923892). ...
3
votes
0answers
32 views

Postgis - Construct linestring of length N

Give a table of linestrings (roads) ogc_fid, wkb_geometry And a road with ogc_fid = X In postgis how could I construct a linestring that is of length Y metres made up of roads starting from road X?...
3
votes
0answers
35 views

How to get the geometries based on column values in postgis?

I have the following table in postgis I want to group the species along with geometries based on column values of 'val' i.e 11,11,11,11,11,11,11-corresponding species 6,6-corresponding ...
3
votes
0answers
38 views

How to quickly get coverage of multiple services at once using pgrouting driving distance

I'm trying to get some useful information out of openstreetmap data to choose where to rent an apartment in my city. I used osm2pgrouting and osm2pgsql to get OSM data into my postgis database. So far ...
3
votes
0answers
31 views

Mapnik: Parameterize queries for PostGIS datasource?

My datasource is PostGIS, but I need to build the query on the fly based on user-supplied filters. Obviously I don't want to create an SQLI vulnerability, so I'd like to parameterize my query, e.g., "...
3
votes
0answers
343 views

ERROR: PostGIS is already installed in schema 'public', uninstall it first

None of the threads in stack exchange related to this error helped me to resolve this issue. Hence I am posting it. I have installed postgres 9.3 and PostGIS 2.1 Now I have done the following su ...
3
votes
0answers
128 views

Dissolving polygons in a large dataset

I need to dissolve polygons by the ID attribute in a large dataset (+-1gb shapefile). I have been struggling to find an efficient method to do this. I have tried the following methods: Postgis ...
3
votes
0answers
116 views

Trilateration with error account or lack of precision

I am developing a node.js/javascript application where I would have dozens of beacons in a row (positions known), which gives me their distances to specific object (3 or 4 distances per object). The ...
3
votes
0answers
76 views

Problem with negative radius for ST_Buffer

I am very new to PostGis and I am trying to use negative radius of buffer for ST_Buffer function. The column is geometry(MultiPolygon, 4326) imported from a shapefile. Positive radius for ST_Buffer ...
3
votes
0answers
164 views

Selecting all pixels above a given value in a raster in PostGIS

I have a raster with one band whose value represents the date of the occurrence (a sequential integer). This raster file gets updated regularly, and each time that happens, I need to run a process ...
3
votes
0answers
154 views

How to create line segments between pairs of pixels in a raster?

I want to draw several lines between pixels (please see the image below) according to some criteria : First Criterion: The distance between 2 pixels is less than 2000m and greater than 500m ...
3
votes
0answers
100 views

Visualizing variability in the size and shape of polygons

I am working with a data set of area restrictions imposed by criminal courts. These restrictions ban a person from entering a demarcated area. These restrictions vary in their size, shape, and ...
3
votes
0answers
445 views

Why are OGR (MySQL / PostGIS) connections extremely slow in QGIS 2.0 - 2.8 (when compared to QGIS 1.8)?

In our project we have been using QGIS 1.8 Lisboa with a MySQL database placed on a server accessed via local network since two years. Everything is working fine and quick. The vector layers can be ...
3
votes
0answers
92 views

A* pgRouting issue with x1,y1 and x2,y2 values

I am trying to use the A* algorithm in a topology I have made in PostgreSQL. I can fill the x1,y1 and x2,y2 the latitude/longitude, but I have read that the same version has problems with ...
3
votes
0answers
717 views

Editing PostGIS data in ArcGIS Desktop?

Quick question regarding editing PostGIS data in ArcMap 10.0. Far as I can tell, this can only be accomplished through third-party plugins like GISSquirrel or ST-Links. Does anyone know of an ...
3
votes
0answers
352 views

Can't see Postgis layers added to QGIS

I'm trying to transition from an old Postgres/Postgis database to a new one. I'm working in a fresh install of Win 7 64 bit. I installed Postgresql 9.3 32 bit, then installed PostGIS 2.1.3. I created ...