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

learn more… | top users | synonyms

1
vote
1answer
57 views

PostgreSQL is refusing connections from MapServer

I have MapServer 6.04 running in Centos 6.7. I am able to server shapefiles and GeoJSON, but when I try to connect to a PostGIS (2.1.8) enabled PostgreSQL (9.4.5) database it fails with the error: ...
2
votes
1answer
52 views

Invalid GeoJSON when inserting data to a CartoDB (PostGIS) table from Leaflet

I've been following along to this tutorial from CartoDB. I create the GeoJSON using: var drawing = "'"+JSON.stringify(layer.toGeoJSON())+"'"; and then inserting using a custom SQL function ...
1
vote
1answer
52 views

Inserting spatial data into existing postgis geometry column from shape file based on ID

I have an existing postgresql database table "city_data" with Non-spatial data in the following format: City_ID as varchar, City_name as var_char, pop as int,.... I have enabled the postgis ...
0
votes
0answers
26 views

WFS to PostGIS with Geokettle

I am trying to use Geokettle to write records to PostGIS. Geokettle has has a WFS input step. I cannot get it to work, I cannot find much documentation about it and I wonder if anyone here has used ...
2
votes
1answer
100 views

How to use ST_DWithin to query features from one table within a distance of a specific feature or features in another table

I'm pretty new with PostGIS. I have a parcel layer and a census block layer in a postgres database, and I would like to be able to query out all census blocks within a specified distance of a specific ...
0
votes
0answers
45 views

PHP, PostGIS & Geojson

I'm using Lumen to connect to postgis and I want to execute this query: WITH query AS (SELECT ST_GeomFromGeoJSON('{"type": "Polygon","coordinates": [[[366063.228612569917459, ...
2
votes
0answers
33 views

Efficient processing of ST_ValueCount Results in Postgresql

General Problem: I have a table of rasters. The rasters are classified MSI images, so each pixel is an integer indicating the class of the pixel. For a number of regions, I am querying pixel counts in ...
2
votes
1answer
64 views

Export/import from local PostGIS db to cartodb?

I have a local PostGIS database with a polygon table and a nonspatial table. I would like to upload them into my CartoDB account. What is the best way to do this? I could export the polygon layer as a ...
3
votes
2answers
81 views

PostGIS database design: For polygon data

I am designing a spatial database using PostGIS. My main aim of this spatial database is to organize Administrative (250 polygon layer) and postal layers (154 layers) in a database. These layers ...
1
vote
1answer
90 views

PostGIS: How to dissolve vector data

I have a few scenarios where I need to dissolve vector data, and I'm wondering how to do this using PostGIS. What would the queries look like to perform these operations? Below I'll describe the ...
1
vote
1answer
42 views

Deleting records from table where ST_DIstance from another record in another table is greater than a certain amount

I'm currently learning SQL on the run, and have come across a situation where I'm trying to delete records from a table depending on a function result. I can select the records of interest with the ...
1
vote
1answer
21 views

spatial DB lookup to image DB

I am working on a library project for rectifying old map imaging on a map. The images are in tiff and jpeg formats. After rectifying the images I want to save the geographical information in a ...
1
vote
1answer
51 views

Cannot create postgis extension to postgres database even though postgis is installed

What I do: Windows 7, Pgadmin, I select my database, go to extensions, select "New Extension", select "postgis" from List. Then, I get: "An error has appeared: Error: could not load library: ...
0
votes
0answers
9 views

The geoserver openlayer renders disjoint lines [duplicate]

I am using geoserver 2.8 , PostgreSql 9.4 and Java 1.7 . I have written an sld to visualize the lines of the osm data of hamburg which I have converted to postgis format using osm2pgsql and then ...
0
votes
0answers
31 views

postgis ST_Intersect on 2 valid geometries throws TopologyException

Using Postgis 2.1 on PostgreSQL 9.3.4, I'm getting an error when I try to intersect two valid geometries: TopologyException: found non-noded intersection... These geometries are created on the fly ...
1
vote
2answers
58 views

How to aggregate pgr_dijkstra results by attribute?

I working with a table with a lot of points per road/street. I'm using pgRouting's pgr_dijkstra method to give me a path, but it returns too many points per road/street, I'd like to know if there is a ...
2
votes
2answers
67 views

clip raster to polygon with 3 srids

I have 70 raster landsat images with srid: 32647,32648,32649 and want to clip raster to polygon (shapefile, srid: 4326) in postgis. I imported all raster into 1 table with parameter -s : 32648, ...
3
votes
0answers
52 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 ...
1
vote
0answers
44 views

Unable to load raster from PostGIS into QGIS

I'm trying to load raster from a postGIS connection into QGIS, but I'm getting the following error: PG: dbname=EnvModel host=127.0.0.1 user=postgres port=5432 mode=2 schema=public column=rast ...
1
vote
1answer
23 views

PostGIS - raster - get multiple values at once

Is there a way, how to obtain more points from raster in one query faster than this? SELECT x, y, ST_Value(raw_data, 1, x, y) AS val_0, ST_Value(raw_data, 2, x, y) AS val_1 FROM data CROSS ...
1
vote
2answers
50 views

PostgreSQL/PostGIS: Closest outside point (health center) to point (education center) inside polygon (danger zone)

I am trying to find the closest health centers (points) to the education centers (points) located within the "danger zone" (a specific polygon) while excluding those health centers located in the ...
1
vote
1answer
33 views

How can I count points from several buffer distances in PostGIS updating the table?

I have a problem regarding a calulation on PostGIS. I have to calculate how many facilities fall within a given distance. This is not really a problem though, but updating my table is. I have this ...
2
votes
2answers
112 views

PostGIS operations extremely slow when called in a script

OK, I am aware that this is rather vague, but unfortunately I was not able not reproduce my problem in simplified code. I am running a series of functions within another function (main()). All ...
0
votes
1answer
31 views

Restoring public.layer_styles table from PostGIS dump

I created a PostGIS database on a PostgreSQL server and stored some QGIS styles (in public.layer_styles). When dumping and restoring the database only this table gives me an error and stays empty. I ...
0
votes
1answer
48 views

How to add tiger schema to the database search path? [closed]

The tiger schema must be added to the database search path for the functions to work properly. I just started recently to use tiger dataset and postgres database and I have basic understanding of ...
0
votes
2answers
79 views

Creating Intranet GIS application [duplicate]

I am working about task for custom GIS application (about 70 users). It must show a map of region with custom objects from database (they will be triangles, lines, and icons with coordinates) . Users ...
6
votes
2answers
178 views

How to do a spatial join in PostGIS that returns on the minimum value of point intersecting polygon?

I have a polygon table (buffer) and a point table (dem_points), and I want to do a spatial join on them. I need to join the point with the minimum elevation (dn) to its spatially corresponding ...
1
vote
1answer
52 views

using qgis to split geometry in postgis: how to add unique id and copy original data in linked tables

We have set up a postgis database to manage all our old shapefiles. There is one table that contains the geometry and some basic information. There are several tables linked to that in a 1:m ...
1
vote
2answers
47 views

PostGIS insert failed without raising error

I'm learning PostGIS through a book "PostGIS in action". The SQL code written in the book has a lot of issues and I've figured most of them except this one: Copied from the book chapter: CREATE ...
0
votes
2answers
51 views

Uploading MDB into postgis with non geometry tables in the mdb

In osgeo4w I am uploading an mdb into postgis. It works perfectly with all the geometry content within the personal geodatabase, but it does not take the tables from the personal geodatabase. Is ...
1
vote
1answer
72 views

Can't upgrade to PostGIS 2.2

I am running on MAC OSX El Capitan. My version of postgres is 9.4.5.0. My PostGIS version is 2.1.7. I cannot upgrade to PostGIS 2.2, because when I am trying to do, it pops "PostGIS requires SFCGAL >= ...
2
votes
1answer
41 views

Show geometry on a web map

Is there a simple webpage that I can paste a geometry field from POSTGIS (OSM data - sRID 900913) and it will show on the map? Something like this http://www.darrinward.com/lat-long/ but with ...
2
votes
2answers
38 views

PostGIS - raster and bands

I have several images from different times and for every time I have three types of image (temperatureA, temperatureB, pressure). Should I store them as every time as band in a single raster with N ...
1
vote
1answer
44 views

Delete polygonal features in one layer outside polygon feature of another layer in PostGIS

For deleting polygonal features in one layer (~1000000 features) outside polygon feature of another layer (one feature) in PostGIS I use query: DELETE FROM layer WHERE layer.id IN (SELECT a.id FROM ...
1
vote
1answer
46 views

PostGIS/QGIS: Update polygon attribute based on the mode value from a cluster of points

I'm updating a PostGIS table of polygons denoting property boundaries with some values that form part of a code for sites scattered across the properties. Neither dataset is 100% accurate so I can't ...
0
votes
0answers
44 views

Postgis poligonize. How to create polygon in postgis from linestring

I have a problem with the poligonization. I have a table that contains the my borderstones. The second table defines the next and previous point. It is important because these are attribute datas. ...
0
votes
1answer
48 views

TypeError: a.geometry.getBounds is not a function in OpenLayers.js (line 611, col 334)

I'm using OpenLayers 2.13 and Postgresql 9.3 for my development activities. I want to load region data from database and load into openlayers. Below result i'm getting from St_astext(geom) in ...
2
votes
2answers
83 views

How to create a PostGIS table with arc support compatible with QGIS?

In postgis database I have two tables - let's say 'polygons' (gid, the_geom,MultiPolygon,srid=2180) and 'lines' (gid, the_geom,MultLineString,srid=2180). I'd like to use "Add circular string tool" ...
2
votes
1answer
63 views

BBox select accuracy

I have an Openlayers 3 application. When using a box to select features from Geoserver WFS layer (request=GetFeature) I get inaccurate results see image below. The layer is served from a PostGIS DB. ...
1
vote
3answers
84 views

Editing vector layers

I wish to edit and remove qgsfeatures in qgsvectorlayer. Vectorlayer contains postgis table. QgsVectorDataProvider::capabilitiesString() returns the folowing string: Add Features, Add Attributes, ...
1
vote
1answer
32 views

Display simple raster file in openlayers

I have raster files (one sample can download from here) just have values for points and in beside i have top-left and bottom-right geo data and pixel size of file. so i want to just simply display ...
4
votes
3answers
156 views

How do I select points within a specified distance of a polygon's border?

I have a table with points and another table with polygons (multipolyons to be more accurate). How do I find the points that fall within a specified distance of the polygon's border? Most of the ...
1
vote
1answer
39 views

postgis - wrong ST_Distance with geography points [closed]

I'm trying to calculate the distance between to geographical points, but the calculated distance is bigger than the real one (from Google Maps). The location column in postgresql is define as ...
2
votes
1answer
283 views

How to enable SFCGAL in PostGIS?

I have the problem with the enabling extension SFCGAL. CREATE EXTENSION postgis_sfcgal; doesn't work for me even I have the PostGIS v2.2. When I do that, it throws an error ERROR: could not ...
0
votes
1answer
55 views

Generating pivot table in PostgreSQL that ties cities to counties using QGIS (or PostGIS)?

I have a cities shapefile and a counties shapefile. I have the counties shapefile imported to a PostgreSQL table. I haven't transferred my cities to PostgreSQL yet, but the issue I really want to ...
2
votes
2answers
67 views

How to add temporary PostGIS table to canvas?

I'm working with PostGIS database. I would like to create temporary table with geometry and add it as a layer to QGIS. There is no problem with regular tables, but I can't figure out how to add ...
1
vote
1answer
33 views

Sum and groupby several conditions

I have a road network where each link is part of a reference number. I am trying to sum up the length of roads per reference number and status. My nested query fails and just sum the total length of ...
2
votes
0answers
125 views

Compiling Postgis 2.2.0 on Raspian error doesn't install postgis extension

Installed postgresql 9.4 following this tutorial using the method of already compiled pkg. All seems fine with postgres installation. testdb=# SELECT name, setting FROM pg_settings where ...
4
votes
2answers
80 views

Identifying “chains” of adjacent polygons with PostGIS

I have a table of polygons (land parcels in a city) and I am trying to identify "chains" of 5 or more adjacent polygons. For example, if each letter is a polygon and each . is empty space, ...
2
votes
2answers
76 views

What is the SRID for EPSG 102743?

I am trying to create a table in PostGIS for some LiDAR data and I need to set the the_geom column to my data's SRID. My data is in EPSG 102743, but when I try to use 102743 as my SRID as the_geom I ...