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

learn more… | top users | synonyms

1
vote
0answers
62 views

Broken PostGIS support GDAL

I'm having some problems with Postgres/PostGIS after rebuilding my GDAL library:( I wanted to add MrSID support in GDAL so rebuilt it with the MrSID SDK. Everything compiled ok and I am now able to ...
0
votes
1answer
41 views

Connecting to PostGIS (LATIN1) from Microsoft Access 2010 - Encoding problem?

I want to connect to a PostGIS table Using MS Access. The table has been created using the PostGIS Shapefile loader in pgAdmin. It has been encoded at LATIN1 (it wouldn't load with UTF-8 default). I ...
2
votes
1answer
61 views

Problem with matching a buffer in Openlayers and the same buffer in PostGIS query

I am using a buffer tool to create a buffer on my base map in Openlayers. In addition to creating and visualizing this buffer, I pass the center point and radius to a query. The query collects all ...
1
vote
0answers
27 views

How to define Z dimension on table with PostGIS for import in TileMill?

I'm trying to reproduce the idea behind this blogpost from Mapbox, but with other data, for example the ne_10m_populated_places_simple dataset from Natural Earth. By adding a z-dimension to the data ...
2
votes
1answer
29 views

ST_ZMax() does not exist in PostGIS

I'm trying to follow this example on Mapbox blog, about using 3D shapes in PostGIS. The database-query is this: DROP TABLE tilemill_buildings; CREATE TABLE tilemill_buildings AS SELECT ogc_fid, ...
1
vote
2answers
66 views

Suggest an algorithm to measure how a node is connected to road network

I try to measure how well a node is connected to the rest of the network. If a city has a distant suburb connected with one sole road, it's connectedness is, say 1. If it's connected by 2 roads, it's ...
3
votes
1answer
56 views

PostGIS - when I add a polygon, delete overlapping areas in other layers

I'm starting to work with PostGIS and I'd like to solve the following problem: In my database, I have multiple land use class layers, for example: "residential", "industrial", "commercial". The ...
2
votes
1answer
77 views

How to create a buffer on a linestring with varying or increasing/decreasing width

I want to buffer rivers/streams for a topographic map. I'm using a PostgreSQL/PostGIS database. Usually, I create buffer with ST_Buffer with a constant width. For example, the width of a river buffer ...
1
vote
0answers
17 views

How to SELECT one day's scene (Landsat 8 scenes)

I have a huge dataset of raster in PostGIS. Each scene is divided into tiles (tile-size 500x500). I was trying to SELECT rast FROM landsat8 WHERE ST_Intersects(rast, polygon). It runs very slow, ...
1
vote
1answer
36 views

Openlayers wfs no fid being passed from tinyows

I have a webapp - OpenLayers<->tinyows<->postgis. With 1 layer I have a problem. On localhost all works well - here is a snip of the xml I get back: <gml:featureMember> <tows:trad ...
0
votes
1answer
72 views

Import shp to Postgis using Python and ogr

I just export a Postgis Table to shp using this tips but I'm not able to import a shp to Postgis using the same library(ogr). Any idea? Thanks a lot f.
0
votes
0answers
23 views

Multiple Centroids within a dataset based on distance

Is there a way that we can find out the centroids of clusters within a dataset while differentiating one cluster from other based on distance not on any attribute value. The dataset is present in ...
0
votes
0answers
32 views

Postgis performance: st_dwithin vs static buffer and st_contains

I have a table with a polyline column. I need to find which of those polylines are within 20 meters from a bunch of moving points. I can do this no problem with st_dwithin(). What I would like to know ...
1
vote
0answers
65 views

QGIS loads PostGIS layers but DBManager can't connect

DB Manager can't connect to PostgreSQL, but "Add PostGIS Layer" can. My eventual goal is to save created layers to PostGIS. I assume I can do this using the DBManager Tool. I can alternatively use ...
2
votes
2answers
53 views

Export to Mapbox (TileMill) from PSD (or SVG/PNG)

Newbie question: I designed a map (not Earth-related) in Photoshop and I want to use something like Mapbox to serve the map and make it dynamic (bounding boxes, zoom in/out, etc). How can I go from an ...
3
votes
3answers
96 views

How to create random points in a polygon in PostGIS

I have a polygon layer, and would like to generate random points in each polygon. An initial searching in Google resulted this website which presents a function for this purpose: ...
0
votes
0answers
26 views

QGIS - Loading data by SQL-window in the DB-Manager is not working?

I have problems to add a subset from a PostGIS-table to QGIS by using 'load as new layer' in the SQL-window of the DB-Manager (QGIS-Version 2.2.0-Valmiera). I defined both the 'column with integer ...
0
votes
0answers
51 views

Using PostGIS to find airplanes flying on the same routes over the sea [duplicate]

I need to answer the following questions: 1-Given a database of all flights,including flight ID and the airplanes location (lat/long etc) taken at timestamps of constant 1 minute intervals, find all ...
0
votes
0answers
34 views

Adding GIS feature into an existing postgis table using django 1.6

i am using Django 1.6 on my web map. the problem i got is that i cannot import shapefile with features about 200. . the console has given me this traceback. . Saved: 162-05-0001-005-31 Saved: ...
1
vote
2answers
44 views

How can I determine which polygons contain other polygons?

I am using only free, open source tools. I have two shape files: a shape file of voting precincts and a shape file of census tracts. I want to know: which voting precincts fit inside which census ...
2
votes
1answer
61 views

PostgreSQL : total length of roads in polygon

I have 2 tables : wgo (lines) and wbn (polygons) With this code, I can display the length of each road inside a polygon. If I have a polygon with 2 roads in it, as a result I get 2 rows with the 2 ...
2
votes
1answer
48 views

Area of polygon split by a line

I need a query that return the area of two polygons that have been split by a line. This is what I did so far: SELECT ST_Area(ST_Split(surface.geom, limite_a.geom)) from surface, limite_a where ...
2
votes
1answer
79 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 ...
0
votes
1answer
35 views

Help with postgis on mapserver

just set up my mapserver on Ubuntu - all good. Downloaded this tutorial and it works fine: http://download.osgeo.org/mapserver/docs/mapserver-tutorial.zip I've tried adding a PostGIS layer to the ...
1
vote
3answers
68 views

How to count points once with overlappying polygons?

All, We're using parcel data (polygon) to count student locations (point) based on parcel type. We're doing this using SQL and the ST_Intersects function. It works great, except the City and County ...
2
votes
2answers
116 views

Postgres Log Error

I am using Geoserver + GeoWebCache + Postgres for an application. On the application side there is no bugs but on postgres I am getting this log. Please explain and help me to solve this ...
1
vote
2answers
38 views

PostGIS: ST_Clip() throws non-noded intersection between LINESTRING

I have a polygon and a set of rasters. I'm trying to clip raster with polygon. As you see, my rasters is divided into tiles. Any tiles that is contained by the polygon has ST_Overlaps(polygon, ...
0
votes
0answers
41 views

using postgis function in pyqgis

I'd use Postgis function in Pyqgis script. This code: qsql="(select gid, id, St_Buffer(the_geom,200) as geom from archi)" uri = QgsDataSourceURI() uri.setConnection("ip", "port", "x", "x", "x") ...
1
vote
0answers
35 views

PyQGIS Dialog Plugin not resetting

I have written a PostGIS search plugin that works pretty well, except two things that I just cannot figure out a solution 1) When the dialog closes and then is reopened the previous query is still in ...
0
votes
0answers
33 views

pgrouting shortestpathfromAtoB multiple pairs

I've got to solve a shortest path problem between multiple location pairs. E.g.: A to B C to D E to F etc. These pairs are stored in a table routing_basis like hkey; A; a.lat; a.lon; B; b.lat; b.lon ...
1
vote
3answers
61 views

Geometry vs geography for line-to-polygon intersection

I have two WGS84 NAD83 shapefiles, one polygonal, the other containing lines: Geometry: Polygon Feature Count: 1294 Extent: (-79.761059, 44.991143) - (-57.105486, 62.582865) Layer SRS WKT: ...
3
votes
3answers
194 views

PostGIS: parse geometry wkb with OGR

I'm trying to pull a LineString geometry out of PostGIS and parse it with OGR (python bindinds). from osgeo import ogr import psycopg2 connection = psycopg2.connect("...") cursor = ...
0
votes
0answers
38 views

Create Image Mosaic JDBC datastore in command line

I would like to publish raster from PostGIS database, and I found this tutorial http://docs.geoserver.org/2.1.4/user/tutorials/imagemosaic-jdbc/imagemosaic-jdbc_tutorial.html , everything works fine, ...
2
votes
2answers
43 views

How to obtain timestamp and user id from .osm file in PostGIS enabled Postgres database

At present, osm2pgsql seems to ignore the timestamp and user id of the elements, a serious drawback for some applications. According to a bug report this is not solved by the addition of the ...
1
vote
0answers
68 views

How do I catch PostGIS/PostgreSQL RAISE messages in QGIS?

I have a trigger set up in PostGIS/PostgreSQL which will show a RAISE WARNING when an inserted or updated polygon is within a certain distance of some predefined planning constraints. I want this ...
2
votes
2answers
68 views

Switch coordinates in linestring

I made a silly mistake: when creating linestrings in my PostGis database i inverted the lon and lat values. Which isn't a problem for postgis itself, but for my visualization and intersections. ;) Of ...
1
vote
0answers
37 views

django---error in displaying data and displaying it on the map

. i am trying to display a feature queried from postgis. . i also designed a user input field to enter the id of the desired feature to be displayed. . i have already queried the attributes first ...
0
votes
1answer
64 views

PostGIS: ST_Clip() raster in SRID:32617 with a polygon

I'm trying to ST_Clip() raster in `SRID:32617' with a polygon. What I did ST_Transform(polygon, 32617): It fails, couldn't project point() exceeded limit (-14) ST_Transform(rast, 4326, ...
2
votes
1answer
78 views

PostGIS ST_Intersection of polygons can return lines

When clipping the polygons of one table with polygons in another, ST_Intersection can return a set of results that can be handled with ST_Dump. The returned multiple geometries are not necessarily ...
1
vote
2answers
62 views

How to get the geometry type of an empty PostGIS table?

I have a web application that needs to know the geometry type of a PostGIS table's geom field before inserting rows into it. I use the following query to determine the geometry type of the geom ...
1
vote
0answers
42 views

Differences between PostGis and SpatiaLite [duplicate]

I am working on spatial data where there is quite a lot of data (mainy data from GBIF for people who know it). It is not so complicated analyses (I am not Gis Expert!). I am currently working with ...
2
votes
1answer
56 views

Cache geodjango query with bounding box filter

Im using geodjango (postgis) to retrieve points contained inside a bounding box (made by leafletjs), it works so nice, but now I want to cache this query. A tipical query is one like this: ...
1
vote
0answers
27 views

PostGIS: ST_Transform() couldn't project point (lon, lat) exceeded the limits [duplicate]

I'm trying to clip rasters with a polygon. Here's my query: SELECT ST_Union(ST_Clip(landsat8.rast, ST_Transform(ST_GeomFromText('POLYGON((105.78873 21.38659, 106.49185 21.38659, 105.78873 20.71758, ...
0
votes
1answer
35 views

Rendering PyQGIS objects in MapCanvas

I'm quite new to PyQGIS and have what is probably a pretty basic question, but I haven't been able to pick it up from the documentation. I have a QgsVectorLayer object from a PostGIS server, and I ...
0
votes
1answer
34 views

Query to create polygone from lines that touches in POSTGIS

I am trying to create polygons from a line layer with a spatial query in postgis the probleme is i dont have a lot of information on the lines only id of each line and geometry thanks for your help
1
vote
1answer
45 views

PostGIS ST_Within returns zero data

I am using PostgreSQL 9.3.3 & PostGIS 2.1.1 and I have a table Entries which has a column called "latlng" of geographic type (this column stores entry's latitude and longitude coordinates). I am ...
1
vote
1answer
69 views

pgrouting unexpected output

Thats my ways.shp file. I loaded this to PostgreSQL DB using PostGIS shape file loader. I ran pgr_anlayzeGraph() on it and found it had a lot of isolated segments. Next I ran pgr_nodeNetwork() to ...
3
votes
1answer
74 views

PostGIS: convert point data to raster

I have a table of points and I'm trying to visualize their distributions. Each point has a POINT geometry (WGS84) and some numeric attributes: a, b, c. | id | geom | a | b | c | ...
1
vote
1answer
68 views

data defined labeling with postgis layer

How to use the expression based (edit: data defined) labeling with postgis? I'm wondering, whats the best way to use expression based (edit: data defined) labels with postgis (I'm new to postgis). ...
2
votes
1answer
26 views

How to use PostGIS for tile-based aggregation?

How can I create a tile-based aggregation of polygons with PostgreSQL/PostGIS? The input of such an operation could be the database table with the geometry and the data to aggregate, a bounding box, ...