Version 2.0 of PostGIS brought a heavy set of new extensions for the PostgreSQL object-relational database, adding greater support for spatial objects.

learn more… | top users | synonyms

1
vote
1answer
17 views

Local Coordinate System

I am currently evaluating the use of PostGIS (version 2.0) for: a project that will store 3D coordinates (x, y, z) data the data will have it's own local coordinate system which does not correspond ...
0
votes
1answer
29 views

Routes Consult with pgrouting / openlayers [on hold]

I'm starting with pgrouting. After suffering a bit unable to put the data in osm postgis using osm2po with the excellent tutorial http://anitagraser.com/2011/12/15/an-osm2po-quickstart/ ran the sql ...
0
votes
1answer
18 views

Not empty geometry having blank text

i'm having problem with geometry column, for some rows i have geometry with blank text, this query will describe more the problem : select geom, ST_AsGeoJSON(geom), ST_Isvalid(geom), ST_IsEmpty(geom) ...
0
votes
1answer
26 views

Expression with postgis

I'm using mapserver and PostGis and I want to draw a geometric table in mapserver. The trouble is when I connect mapserver to PostGis and I want to draw the objects but in different colours. I mean I ...
0
votes
2answers
27 views

UpdateGeometrySRID and ST_Transform are the same thing?

UpdateGeometrySRID actually transforms the coordinate system of my data? For in the PostGIS documentation it appears the trim ST_Transform (Returns a new geometry with its coordinates transformed to ...
0
votes
0answers
36 views

Function ST_Transform postgis 2.0

I've read many forum posts on the function ST_Transform but unfortunately was unable to resolve my doubts so I posted a new question. I have a spatial table SRID = 101010 and want to transform it to ...
0
votes
1answer
24 views

Empty geometry resulting from pgrouting function

Let me start by saying I'm assuming I'm missing something very silly but I can't see it. I have a table of points and I'm trying to generate a polygon around each point that estimates a maximum of ...
1
vote
2answers
61 views

Find out whether geography point lies within geography bounds

I have three points: Point A Point SW Point NE I want to know if Point A resides within the bounds determined by points SW (for south-west coordinates) and NE (for north-east coordinates). I've ...
2
votes
1answer
58 views

Is there any random data generator supporting geometry in PostGIS?

I found few random data generators for PostgreSQL (such as this one), but none supporting PostGIS geometry type, other than point. Making points would be quite easy, but for lines with multiple nodes ...
0
votes
0answers
35 views

within using Hibernate Spatial

I'm doing this query using postgis and working properly SELECT "public".zona."id", "public".zona.zts FROM "public".zona WHERE ST_Within ( Geometry ( st_GeographyFromText ...
0
votes
3answers
62 views

ST_transform postgis

SQL within that zone is a point SELECT "public".zona.zts FROM "public".zona WHERE ST_Within ( ST_Transform ( ST_GeomFromText ( 'POINT(-30.033514 ...
1
vote
1answer
57 views

How to have PostGIS 2.1 and the Python osgeo library installed together without compiling from source?

My python application makes heavy use of the osgeo library. We're looking to upgrade from PostGIS 1.5 to PostGIS 2.1, and I'm having issues. I'm installing packages from the Ubuntu GIS PPA. Before, ...
0
votes
0answers
24 views

Can i install opengeo suite in VPS windows?

I want to quickly set up a gis server which i can use via internet .i guess opengeo suite is best for newcomer and also it has community edition . but if you think there is option let me know. I need ...
0
votes
0answers
23 views

rasterize a geography polygon using postgis 2.1

I am still bit new to Postgis 2.1. I am trying to rasterize a polygon, meaning that I have a polygon of Syria and I want to create an empty raster that contains the shape and geography reference of ...
1
vote
1answer
31 views

Break line into 100m segments

I have a line geometry in PostGIS and I am wondering how I would break the line into 100m segments. Is there a function for this?
0
votes
0answers
26 views

pgrouting pgr_drivingdistance() query gives inconsistent results

So I have been working on a query(with the help of other stackexchangers :)) to get the edges in an isochrone from a particular point and then update the count_events field of those edges by some ...
0
votes
0answers
38 views

Displaying 3D city model from PostGIS 3D backend

I know that openlayers doesnt support 3D yet. I heard about Kartograph has 3D features but Does Kartograph support reading data from backend database especially PostGIS? I would like to create a 3D ...
0
votes
1answer
54 views

How can I find the segment of a line that lies within a polygon using Postgis?

Given a "road", represented by a line, that crosses a "state", represented by a polygon: What is the SQL query I can use to find the segment of the road that is within the state? A concrete example. ...
0
votes
2answers
59 views

How to select the cross streets in postgis spatial table?

I've used ST_Intersects and ST_Crosses but between two different tables. I have a table of streets and intersections want to know them. For example select all streets that cross the Street A. Can ...
0
votes
1answer
36 views

query to get predicted location after traveling on pgrouting route for some hours, postgis 2, postgresql 9.3

I am using Postgis 2.0 on Postgresql 9.3 on Ubuntu 14.04 x64. I am trying to find an efficient way to fulfill this routing request. So I am able to get the shortest route using the source and target ...
2
votes
0answers
57 views

how do I create a RESTful PostGIS web Service Framework?

I have PostGIS tables that store vectors that want to show on Google Maps. Read the post http://gis.stackexchange.com/questions/22354/how-to-display-a-postgis-table-on-google-maps But one thing that ...
1
vote
0answers
26 views

Import raster to postgis and add a foreign key constraint

I use raster2pgsql to import raster files into a table with this command line: C:\Program Files\PostgreSQL\9.3\bin>raster2pgsql -s 4326 -M -F -a c:\temp\mun.tif public.basqui_raster | psql -U ...
1
vote
3answers
42 views

PostGIS2 have automatic BBOX indexing?

I need to compare millions of geometries by the && operator (BBOX). When CREATE TABLE see geometry type on PostGIS2, it do also something like INDEX ON t USING GIST(g)? or I need to express, ...
0
votes
1answer
33 views

Get latitude and longitude of each point forming a MultiLineString

A MultiLineString is formed by a sequence of points and each point has latitude and longitude. Use the sql below to get the latitudes and longitudes of each point so that my MultiLineString: SELECT ...
0
votes
1answer
90 views

Import Shapefile on postgis doesn't show in QGIS

I'm currently working on a project about a database and some shapefiles. The database is built on PostGis with tables including some dots as geometry type columns. Once imported them on QGIS, I can ...
-1
votes
1answer
91 views

how to build and install pgrouting-2.0 on postgresql-9.3 on ubutntu 12.04 Lts precise?

I try to build following instructions from this link https://github.com/pgRouting/pgrouting after downloading from the github. I have done the cmake command and there is my error output: ...
2
votes
1answer
90 views

PostgreSQL : how do I make this sum [closed]

I have this huge table with all the addresses of my country in it. Every house is an object, and there is a column for the streetname (or street ID) and a column for the housenumber. I want to make a ...
1
vote
2answers
63 views

How can I speed up these queries

I am trying to make some calculations using PostGIS and PostgreSQL. There are 3 important tables : wbn, wgo and wvb. These tables have about 500.000 objects in them (geometries). The problem is that ...
1
vote
0answers
35 views

PostGIS 3D Extrude function

I selected buildings from OSM (which represents my city). I insterted a new column 'height' and I filled with a random number exactly number 2, so every building have 2metres altitude. Buildings are ...
1
vote
1answer
65 views

3D functions with SFCGAL in PostGIS

I have this setup: "POSTGIS="2.1.2 r12389" GEOS="3.3.8-CAPI-1.7.8" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.2, released 2012/10/08" LIBXML="2.7.8" LIBJSON="UNKNOWN" TOPOLOGY RASTER" on ...
2
votes
2answers
53 views

Do I still have to use a template DB for PostGIS?

createdb mydb -T template_postgis Is this -T template_postgis still necessary in new versions of PostGIS? I never saw this db being different, it always has those 3 sql files you run there. Is this ...
1
vote
1answer
54 views

ST_Union to merge tables containing lines?

I have to build a street network with Postgis that will be used with pgrouting. I have two tables: 1) the_network (182 lines): is a MULTILINESTRING table. Having columns road_name (varchar) / ...
1
vote
1answer
40 views

Trying to understand / troubleshoot intersection behavior of postgis

I'm trying to calculate the percent of intersection between two polygons using postgis. I was able to do so successfully for 90% of my polygons, but about 1500 have very unexpected values. I ...
1
vote
1answer
41 views

Weird ST_Contains behaviour

I'm creating a polygon and then checks whether one of the origin points is contained inside the polygon. To my surprise, I get False (?!) What is wrong here? SELECT ST_contains(ST_GeomFromText('POINT ...
3
votes
1answer
150 views

Improve speed of PostGIS “nearest neighbor” query?

One of the features of the Python/Django/PostgreSQL web application I'm building is that a user will be able to see the 100 other users who are nearest to them, sorted by distance. I'm using PostGIS ...
0
votes
0answers
47 views

PostGIS: calculate width/length of rectangular surface

I have rectangular shaped surfaces (multipolylines) and I need to calculate the width and/or length.. they have a rectangular shape but they're not real rectangles. Is there a way to do this ?
2
votes
1answer
84 views

POSTGIS: function st_collect(geography) does not exist

I am trying to use some Geography functions, but I am getting an error that (all) functions are not existing. I have checked other Stackexchange posts (e.g. this one), but the solutions did not work ...
1
vote
1answer
41 views

PostgreSQL : question about SELECT .. WHERE .. = max()

If you have, for example; SELECT * FROM data WHERE line = min( (SELECT length FROM lines) ) AND number < 500; (It's just an example, not a real code) How does PostgreSQL react when the ...
0
votes
1answer
59 views

Postgis query not using the spatial index

I've been using postgres8.3/postgis1.5 for some time, and it works well. I've moved my entire database to a new, faster machine and upgraded to postgres9.3/postgis2.1 using pg_dump/postgis_restore.pl, ...
0
votes
0answers
112 views

Problems moving POSTGIS database from postgresql 8.3 to 9.3 using Navicat

I am using Navicat 11 to move a POSTGIS database from 8.3 to 9.3 on Mac OS X 10.9. I have installed PostgreSQL 9.3 and PostGIS with homebrew (brew install postgresql postgis) and everything looks ok. ...
2
votes
1answer
82 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 ...
3
votes
1answer
134 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 ...
0
votes
0answers
54 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 ...
4
votes
3answers
208 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: ...
1
vote
3answers
89 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: ...
0
votes
0answers
29 views

Transforming multiple LineStrings to shape for ST_Contains

I want to find cities, villages etc inside each region of Poland. For most of them querying something like this is enough: ... AND ST_Contains((SELECT way FROM planet_osm_polygon WHERE osm_id = ...
1
vote
1answer
43 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
1answer
60 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
3answers
124 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? ...
0
votes
0answers
25 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 ...