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

learn more… | top users | synonyms

1
vote
1answer
71 views

How to restrict buffer extent within land area only?

I need to create buffer for a point feature, but the buffer area will be restricted within the land area only. For example consider the following: A buffer of say 500 km radius is to be generated ...
1
vote
1answer
52 views

What is the complexity of neigborhood search in PostGIS?

I have a point with coordinates x and y. I want to know all the points in a square around this point, with side L. For this, in postgresql/PostGIS, I use: SELECT * FROM table_of_points WHERE ...
0
votes
1answer
140 views

Trouble connecting QGIS 2.0 to remote Ubuntu Postgis

I am trying to connect to a remote postgis 2.0 server (Ubuntu) from QGIS 2.0.1 (installed on winxp). I have been working with QGIS 1.7 / 1.8 on the same database for almost a year without any issue. ...
1
vote
1answer
959 views

Geoserver sql view using an external sql query?

I am trying to figure out a way of producing a view of a layer in GeoServer, using an external sql query. By external I mean, for instance, a user defined query in a php from where all the parameters ...
1
vote
3answers
299 views

Create multi-line from point in PostGIS

I'm working on an old table where polygons are stored as points. Now, I want to migrate these points to PostGIS and store them as polygons (or multi-polygons). The table structure is as follows: ...
0
votes
1answer
332 views

Maximum size on the bounding box with ST_MakeEnvelope and && and geography column in PostGIS?

I've done quite a few google searches, but haven't managed to find anything that has helped me directly. I've got a few features in a PostGIS table with a geography column. The features are focused ...
0
votes
3answers
114 views

How to extract shape of each segment?

osm2po library does a great job in creating the data required by pgRouting to calculate theshortest paths. But I need the shape (Geometry - LineString 4326) to be extracted when osm2po generates the ...
0
votes
3answers
237 views

Table Relate Spatial and Tabular data in QGIS 2.0

I am self taught in GIS, so I apologize ahead of time for my noobness. In ArcGIS you have two options to associate data in a table to spatial data. Based upon my understanding, the first is Join ...
0
votes
2answers
394 views

calculating the difference between 2 angles using st_azimuth and dot product

the function below tries to calculate the difference between 2 angles. I use the mathematical reasoning is as follows : 1) Obtain the 2 angles : angle1 = ST_Azimuth(ST_StartPoint(l1), ...
0
votes
2answers
499 views

postGIS union multiple tables, big dataset, faster approach?

my goal is simple. I want to union a given set of shapefiles. In the shapefile are stored polygons. The data bounding box is germany, so the data is relatively big. I tried to use all functions ...
2
votes
1answer
214 views

GeoDjango - return SRID of geometry in GeoQuerySet

I'm wondering if there is a function in GeoDjango which would allow me to determine the SRID of a geometry column in a GeoQuerySet. I know I could do it with a raw SQL query (I'm using PostGIS) but I ...
1
vote
1answer
330 views

Can't find libpq when installing PostGIS

I'm trying to install PostGIS 2.2.1 on Mac OS X 10.8. I've installed all of the prerequisites for PostGIS and am now running the configure command: ./configure CC=/usr/bin/clang CXX=/usr/bin/clang++ ...
3
votes
1answer
477 views

osm2pgsql: Import data in custom projection

I have osm-file and I want to import it to the postgresql via osm2pgsql with custom projection EPSG:20022. I look to the help and found out any keys like -E EPSG: but when I try to do with it I get ...
1
vote
0answers
129 views

Merging contour lines along tile boundaries

I am working with the CANVEC data set. The data in canvec is broken up in to mapsheets. eg. 116B04. I have data covering the entire province of the Yukon. I have merged all the data in to one ...
2
votes
1answer
62 views

Stereo Compilation Software with PostGIS

Does anyone know of stereo compilation software that will allow for the writing into a PostGIS database? Both Datum and Stereo Analyst will write to an ESRI Geodatabase. Standard stereo compilation ...
3
votes
1answer
626 views

postgis: difference with && operator and st_intersects

I found that there is a difference in result between using A && B operator or one of the geo functions like st_intersects(A,B) or st_overlaps(A,B) While the st_intersects or st_overlaps ...
2
votes
0answers
79 views

Using ST_Affine() and trans_param() functions on vector layer

After reading this post How to georeference a vector layer with control points? I decided to give it a try to move/rotation/scale a polygon using Postgis. I have two polygons, polygon_from and ...
4
votes
1answer
88 views

How can I strip out Z values in PostGIS?

How do I get rid of the Z dimension in PostGIS? Specifically, I have some MultiPolygonZs that I want to copy into another table as MultiPolygons. I don't care about the Z values - it's okay to just ...
2
votes
5answers
644 views

How to export raster from PostGIS enabled DB as GTiff with gdal_translate

When I want to export a GTiff from my PostGIS DB with this code: gdal_translate -of GTiff PG":host='localhost' port:'5432' dbname='landslide' user='postgres' password='pass' schema='public' ...
2
votes
2answers
203 views

Separate a polygon in different polygons depending of the distance to another polygon

I have a reference polygon "R", and others polygons (in grey). I want to separate each grey polygon in multiple polygons, depending on the distance to R with different Buffers : - The red line is R ...
1
vote
1answer
50 views

High number of unique user defined views

We're just at the stage of starting to developing a GIS application accessible through a web front end. We're thinking of using the boundless stack which includes GeoServer and PostGIS. One of our ...
1
vote
1answer
82 views

WHERE query when creating layer in MapServer

Is there a way to have WHERE clause when you're querying for postgis data on mapscript ? like, geom FROM country WHERE country = 'usa' USING unique gid. My current workaround is by creating VIEW. ...
-1
votes
1answer
964 views

Retrive data from database in openlayer GIS

i am using this code but it shows nothing, whats wrong with this code. <!DOCTYPE html> <html lang='en'> <?php $conn_string = "host=localhost dbname=postgis_21 user=postgres ...
10
votes
1answer
1k views

GUI tools for PostgreSQL/PostGIS?

as a cartographer I work with TileMill to visualize geodata. I installed a local PostgreSQL server with PostGIS and osm2pgsql. Everything works fine. Anyhow, I am new to working with servers and the ...
1
vote
1answer
1k views

Postgresql Trigger to insert records in my table from another one

I spent few days trying to resolve this question but it was impossible. I have two tables: Table1. CREATE TABLE point ( id_point integer NOT NULL DEFAULT, layer text, elevation numeric, ...
3
votes
0answers
343 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 ...
2
votes
3answers
157 views

How should I implement a many-to-many relationship in a web mapping application?

Scenario: I am given a layer of point locations called "problems." These will be displayed on a web map. Users will then use the web map interface to create and populate field information for a point ...
0
votes
1answer
348 views

Unable to load PostGIS vector layer into QGIS using python cookbook recipe

I'm having trouble loading a PostGIS layer using Dufour (from osgeo4w), using the guide at http://www.qgis.org/en/docs/pyqgis_developer_cookbook/loadlayer.html. I just get the 'invalid layer' message. ...
1
vote
1answer
386 views

Postgis functionalities in Microsoft SQL Server

I'm using Postgresql 8.4, Postgis 1.5 for My GIS works. Planning to change my Database to Microsoft SQL Server 2012. Can we use all the Postgis functionalities in Microsoft SQL Server 2012. Please ...
1
vote
1answer
537 views

Postgis: find geometry within multiple polygons

I've got two tables with geometry in it. Table 1:items holds items with a point geometry; while the second table property_zones holds polygons. The Items: CREATE TABLE public.items ( id integer ...
0
votes
1answer
180 views

Defining a WHERE clause from a subquery for a query to create a handy view

It is about my implementation from an answer of this question. It is more an postgresql issue than a GIS issue, whereas it is about geometries and spatial queries. I want to create a view from the ...
1
vote
1answer
60 views

PostGIS | Get degrees clockwise from north of a linestring's beginning and end

I have a table full of linestrings in PostGIS. I would like to know the degrees clockwise from north of the starting point of the linestring and also of the end point. I was thinking that maybe ...
2
votes
2answers
845 views

Postgis, get the points that are x meters near another point, in meters

I'm trying to find the points within a certain distance, in meters, from another point. I'm using the function ST_Buffer, but I don't get how to express the distance in meters. I'm trying with ...
6
votes
2answers
681 views

How to extract mountain peak points from a given digital elevation model?

For past couple of days, i m trying to determine how many mountain peaks are visible (line of sight) from a given location using POSTGIS. The data i have is DEM for Swiss and address locations from ...
0
votes
2answers
352 views

How to transform a PostGIS bounding box?

I need to query the bounding box of a table (in WGS 84, srid 4326), and transform it to Web Mercator to be consumed by an OpenLayers map. Currently, I am using this to retrieve the bounding box: ...
3
votes
2answers
417 views

QGIS DB manager Import layer/file tool won't allow me to choose “Append data to table”

I want to append some data to a layer in my PostGIS DB using a shapefile, but when I use the Import layer/file tool in QGIS, it doesn't allow me to choose the append option. Why is this and how do I ...
1
vote
0answers
102 views

Upgrading Postgres database to Postgis 2.1.1

I executed the postgres 9.1.6 with Postgis 1.5.8 dump from a remote server on Linux pg_dump -h localhost -p 5432 -U postgres -Fc -b -v -f "/somepath/tumidb9.1geom1.5.8.backup" tumidb9 So I have a ...
3
votes
2answers
969 views

How to get JSON representation from JTS Geometry?

I'm using JTS (http://www.vividsolutions.com/jts/JTSHome.htm) and need to get a JSON representation of a Point : Hibernate beam: @Type(type = "org.hibernate.spatial.GeometryType") ...
2
votes
0answers
177 views

Styling river charts with TileMill - issue with filling a polygon made of disjoint line segments

I am trying to style inland river charts produced by the Army Corps of Engineers. I imported the vectors into Postgres, and I’m using TileMill to style the data. I am having trouble correctly filling ...
4
votes
2answers
370 views

How to calculate the azimuth of a line of a multilinestring in PostGIS?

I have two spatially enabled tables in PostgreSQL with a geometry in each: First table is with POINT type, second is with MULTILINESTRING. I need to calculate the azimuth of the LINESTRING part of a ...
1
vote
2answers
383 views

QGIS - load data by SQL window

I have problem with QGIS (2.0.1), PostGIS (2.0.4) combination. - A can load tables or views by Add PostGIS layer. This is OK. - But a can't load data by DB Manager and SQL Window. Executing query ...
1
vote
0answers
63 views

Problems with versioning

I have 5 PostgreSQL_PostGIS database in my company and i conneting on them through ArcSDE. Four of database work correctly, only with one i have i realy big problem. When i make two versions of ...
1
vote
2answers
214 views

Editing vector data over the net: WFS or PostGIS?

I'm using QGis to update the attributes of a large vector dataset (~20,000 polygons) stored in PostGIS. I'm going to have to do that to other large datasets so the idea is to bring in more people, ...
6
votes
1answer
117 views

Postgis 2.1 Inconsistent with spatialreference.org

The County of Napa, California, uses a projection "NAD_1983_StatePlane_California_II_FIPS_0402_Feet"; for example their roads.prj file has: ...
5
votes
1answer
307 views

How to do parallel queries in postgis [closed]

Is there any way to do queries in postgis using multiple cores in a transparent way, other than splitting my queries among several client connections ?
-1
votes
1answer
263 views

Create a View with a new geometry field in PostGIS

I have a table in my data base. This table was created with differents fields as 'x','y' and 'z'. Now I need to make a view to generate a geometry column, but I found problems, because the created ...
0
votes
1answer
25 views

How to join two LinestringM into one without dropping M value?

I have, for example, two Linestrings with M value: LINESTRINGM(1 0 2, 2 0 4, 4 0 7) and LINESTRINGM(4 0 7, 6 0 9, 10 0 10) How can I merge them into one Linestring and preserve the M value? Expected ...
1
vote
1answer
835 views

Failure to Access DBMS Server Error - ArcGIS/Postgres

If connected to an SDE enabled Postgres database via ArcGIS (10.1) for a long period of time, maybe an hour +, I will often receive an error from ArcGIS stating "Failure to access the DBMS Server[my ...
1
vote
3answers
324 views

ST_Intersection point of two 3D linestrings - how is the Z value calculated?

I have two 3D linestrings (geometry type LINESTRING Z) in a PostGIS database that intersect in 2D space, but not in 3D space. Given that there is technically no 'shared portion' of geometry in 3D, how ...
2
votes
1answer
681 views

Postgis | Problems Reprojecting a Point from UTM ED50 to GEOGRAPHIC ETRS89

I've got a POINTS PostGIS table in the 23030 (ED50 UTM 30N) SRID. I'm having a lot of problems trying to reproject those points from ED50 UTM coordinate system to ETRS89 Geographic (lat/long) ...