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

learn more… | top users | synonyms

2
votes
0answers
456 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
418 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
315 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
198 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, '...
4
votes
1answer
833 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 ...
2
votes
2answers
1k 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 column:...
0
votes
0answers
52 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
370 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: /points?...
1
vote
0answers
29 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
58 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
61 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
499 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
312 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 ...
5
votes
1answer
484 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
265 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
54 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, ...
4
votes
2answers
126 views

Is transformation of spatial data lossy?

I have a shapefile that contains data of a country from the following Geographic Coordinate System ( GCS_North_American_1927 aka NAD27 ) contents from the shape file .prj: GEOGCS["...
1
vote
1answer
367 views

Postgis 2.1.1 compilation issue

Hi I tried to compile postgis-2.1.1 in RedHat 6.3 with: # ./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config --with-gdalconfig=/usr/local/bin/gdal-config --with-geosconfig=/usr/local/bin/...
1
vote
1answer
160 views

Display postgis data with qgis 2.2

I have a problem with some shapefile, PolygonZ type, I have imported with "shp2pgsql-gui". This is the output (note 'coord_dimension' value): mode=c, dump=1, simple=0, geography=0, index=1, shape=1,...
0
votes
2answers
122 views

How can I optimize this point-linking query?

I have the following query, and am wondering how it could be optimised to run faster: WITH gps_nodes_1 AS ( SELECT "NODE_ID", "geog" FROM gps_nodes WHERE ST_Distance("geog",ST_GeogFromText('POINT( -1....
0
votes
3answers
445 views

Faster routing algorithm on pgrouting [duplicate]

I have downloaded data for india as a dbf file then converted it using osm2po to make it routable but the problem is when i make any routing query it takes a lot of time around 300 seconds and these ...
0
votes
0answers
520 views

ECW files to geoserver 2.4

I'm trying to add .ecw files (20 orthophotos) to geoserver 2.4. Geoserver is running on an ubuntu 12.4. Vserver. I'v already installed the GDAL plugin. Is this the right format for the import:...
2
votes
2answers
699 views

how to Find n nearest lines for the given points from a collection of lines?

I have two tables, points and lines. For each point in point table, I want to find out nearest 3 points in the nearest 3 cables. I almost developed a query, but it is best suitable for single point, ...
2
votes
1answer
555 views

ST_Intersects() in WHERE clause misses results

I have a table with a lot of geographical objects like countries, cities or points inside the cities. For instance # SELECT id, ST_AsText(location) FROM brace_brace WHERE id IN (3, 42); id | ...
1
vote
0answers
86 views

Forcing Hash Join Query Plans using PostGIS

I'm currently testing PostGIS 2.0 in a Greenplum Appliance (Postgres 8.2 based) and have hit an incompatibility between PostGIS and the MPP Greenplum environment. The basic query below can't be ...
2
votes
0answers
27 views

PostGIS two “circles” intersection [duplicate]

I am trying to see if two "circles" intersect. The data I have is two points and two radii (in meters). I am using srid 4326. My main issue (i think) is getting the radius in meters. SELECT (...
2
votes
1answer
495 views

Postgresql table won't display in QGIS 2.2

I just downloaded QGIS 2.2 to check it out and now one (just the one) of the tables from one of my PostgreSQL database won't display. It loads just fine in 2.0. The records are all there (there's ...
0
votes
0answers
51 views

Speed drastically reduced when including geometry, is there a way to improve?

-- EDIT: Issue is that the shape files being used are at too small of a precision and way too large, output was 488M total, looking for different source -- I'm having some speed issues with a complex ...
1
vote
1answer
663 views

Reprojecting in postGIS from 900913 to 4326. Wrong coordinates

I'm working with postGIS 2.1 I have a table called 'xacementos' created with the srid: 900913. I took the points coordinates from google maps and I want to convert them to SRID:4326 to show the points ...
2
votes
1answer
2k views

Transform projection from EPSG:4326 into EPSG:900913

. i've got this problem about projection. .i just wanted to know what am i missing. . i already displayed map base layer using openlayers through base_layer = new OpenLayers.Layer.WMS( "OpenLayers ...
1
vote
1answer
706 views

PostGIS: Faster way to ST_Clip() rasters with a polygon?

I want to clip an image with a polygon from postGIS rasters. What I do: - Import raster into postGIS(raster2pgsql, tile-size: 500x500, each tile contains 12 bands landsat 8) - Import a shapefile ...
1
vote
1answer
247 views

How to handle QGIS 2.2 Data Defined Label Position on PostGIS Layer Null Defaulting to 0?

I just upgraded to qgis 2.2 from 2.0. In 2.2 there was a minor change to data defined label positioning at least when used with postgis layers. In Version 2.2 the labeling engine appears to be ...
0
votes
3answers
125 views

How create geographic column in postgis table?

I merged several point shape files in postgis, but when I load the new merged shape in QGIS it is not possible to see points in the main window. To create the merged table I used this piece of code ...
6
votes
1answer
242 views

Replacing corporate GIS? [closed]

I'm looking at replacing our corporate GIS, this is the first time that I have had the responsibility of such a task despite my years of experience with the software as an end user. We will be ...
3
votes
1answer
324 views

How to access M-values in QGIS?

I am working with Linear Reference Systems and I know is very easy to get M coordinate (M-value) from a shapefile in ArcGIS. But, how to get the M-value in QGis? If you have doubts about my issue, ...
1
vote
1answer
710 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 (...
2
votes
1answer
504 views

ArcMap reports that PostGIS polygon data is self-interescting

I have an ESRI File Geodatabase of data that I upload to PostGIS using FME. Seeing as I have to have the data in PostGIS for other purposes, it would be great to view the data in ArcMap straight from ...
1
vote
1answer
152 views

ST_AsLatLonText returns wrong data

I want to list all cities in lubelskie vovoidenship, which is relation 130919. I also want to get latLong data for each city. To perform this I do: SELECT name, ST_AsLatLonText(way), place ...
1
vote
0answers
287 views

How can I edit spatial data automatically on postgis and check for topology errors on said data whitout using shapefiles?

So, I have spatial data stored in postgis (points, lines and polygons) and would like to edit and update those in an Open Source software (quantum GIS, grass, etc.) to check for topologic errors, ...
1
vote
1answer
131 views

Problem with runing a loop in a query in PostGIS

I am new to PostGIS and I have a question which can't solve. I have a table of buildings each having a value for number of people living in it. I would like to calculate the total value (sum of number ...
2
votes
0answers
306 views

PostGIS: How to distinguish overlapping routes (i.e., LineStrings) based on their direction?

I have a set of routes which are represented by LineStrings in my PostGIS database. These routes represent journeys that people make. I want to come up with routes that (a) overlap, and (b) have the ...
1
vote
1answer
283 views

Problem with nested query in PhP and PostGIS

I have a simple problem regarding a nested query. I would like to select all buildings in a given circular buffer and create a kml file of those selected objects. The following query does the job very ...
2
votes
3answers
225 views

Problem with result of query in PostGIS

I run the following query and irrelevant of the point coordinates and radius I always recieve all the records of the table I'm querying. Can anyone point out what the problem could be with this query? ...
7
votes
3answers
5k views

Installing Postgis on Ubuntu 12.04: unmet dependencies libgdal1

After sudo apt-get install postgresql-9.1-postgis I got that massage: The following packages have unmet dependencies: postgresql-9.1-postgis : Depends: libgdal1 (>= 1.9.0) but it is not going to ...
8
votes
1answer
777 views

How can I transform polylines into points every n metres in PostGIS?

Question in pretty much the same as this, but I need to use PostGIS. I have a number of polylines, and want to trasform them into points every n metres along these lines. edit: Thanks a lot to ...
4
votes
0answers
167 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 ...
0
votes
0answers
26 views

Postgis and osm2pgsql: find all cities that belong to selected state [duplicate]

I'm pretty new to postgis, so I don't quite understand it's mechanisms yet. My task is to build database with relations: +---------+ +------------+ +----------+ | country | | adm_unit ...
2
votes
1answer
326 views

Split and order lines by polygon intersection

I am using PostGIS and QGIS 2.2. I have a shapefile of rivers and a shapefile of state parks and other polygons. I would like to show the user a simplified version of a stream as a straight line, ...
0
votes
1answer
510 views

CartoDB st_makeline with geography datatype

Hi I am using an online cartodb account to try and create a shapefile based on flight routes between one airport and another. So far, I have uploaded my lat/long points for each connected airport, ...
0
votes
1answer
175 views

How can I combine two datasets with the same schema in to one table?

So I have two tables (in CartoDB/PostGIS) that are from two tiger shapefiles that have the exact same attributes, just in different counties. I want to combine them in to a single table, just ...