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

learn more… | top users | synonyms

2
votes
1answer
357 views

Using ST_MakeEnvelope over the dateline

I'm using ST_MakeEnvelope in PostGIS to try and make geometries that cross the international dateline, but they are making a shape that wraps the other way around the globe. The geometry I want is ...
0
votes
0answers
10 views

postgis update query equivalent for shapefile geowithin update using QGIS [duplicate]

Using QGIS I can use the field calculator to update one point layer based on the point falling within another layer's polygon using geomwithin('water','water_id'). What is an equivalent update query ...
0
votes
1answer
38 views

Creating geometry from lat/lon in table using PostGIS?

I have a table with over 800,000 records including a lat and long column. The data source did not create geometries, so I was looking around how to do this. I know there's ST_MakePoint(x,y,SRID) but ...
1
vote
3answers
536 views

Importing MaxSea 3D Database to PostGIS

I am currently working on a project, where I combine several MaxSea 3D databases, which contain depth measurements made by the echosounder onboard on a ship. The idea is to combine these databases to ...
1
vote
2answers
66 views

In mapserver, how would I style polygons differently based on a separated points layer?

I have 2 tables in postgis - one of type polygons and one of type points. I want the color of the polygons to be related to the number of points within each polygon, say white when no points are ...
0
votes
2answers
56 views

Exporting layers from ArcGIS into PostGIS while preserving attributes such as color

I have managed to import/convert a KML into ArcGIS 10.0 (ArcMap) using the built-in conversion tools and now have a series of layers. Next, I export these layers to a PostGIS database using the ...
2
votes
1answer
230 views

Geoserver OSM data Imported via osm2pgsql - most efficient tables to use to style roads

The Osm2pgsql importer for OSM data to Postgres results in two tables for ways, one called planet_osm_roads and a second one called planet_osm_lines The Osm2pgsql documentation states that the ...
3
votes
2answers
86 views

Creating polygons from line segments using PostgreSQL and PostGIS

Is there a PostGIS function that creates polygons from multiple line segments? I want to convert the pictured thirteen lines to four polygons. All lines belong to the table "boundary" (gid, geom). ...
4
votes
1answer
144 views

Routing problem finding shortest route to line

inspiration on how to solve this problem. (Ascii art, I don't have points to insert picture) I need to find Z Z = Shortest route from X Using Road (no point exists here) O = The points that makes ...
1
vote
0answers
22 views

How to fix broken geometry after joining features in PostGIS

I have a PostGIS layer I'm serving over GeoServer. It looks like this. Im using the PostGIS query to get a new layer with some grouped features: SELECT id, name, st_union(st_buffer(geom, ...
1
vote
1answer
236 views

How to calculate the track length of GPX files with PostGIS?

I am trying to calculate the length of a GPX track. The original GPS data looks like this: <?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <gpx ...
1
vote
1answer
72 views

PyQGIS - load PostGIS layer as editable

I can load a PostGIS layer on QGIS' map canvas but "Toggle Editing" button comes "inactive". How can I load vector layer as editable? The code given below loads PostGIS layer on map canvas & ...
1
vote
1answer
2k views

Issue merging multiple polygons using ST_UNION

I've got regional data loaded into a PostGIS table and want to merge regions that share the same parent name (and ultimately output the data as KML.) This is my query (I'm using php): SELECT ...
0
votes
2answers
152 views

Enlisting all OpenStreetMap (OSM) street names for General Transit Feed Specification (GTFS) routes?

I have exported OpenStreetMap (OSM) data of a city to my local postgresql db using osm2pgsql. I would like to add the General Transit Feed Specification (GTFS) routes information (say bus routes) ...
0
votes
2answers
37 views

PostGIS raster write support in R

I want to push/write some generated raster layers to my postgres database directly in R. In theory this could be supported by the rgdal package, but sadly it isn't. In the latest version only copy, ...
2
votes
1answer
39 views

How to know if two geometric figures are approximately equal?

I would like to know how to determine if two geometric figures (the_geom) are approximately equals. By the way, I'm working with Python, PostgreSQL and Postgis I have the following geometries: ...
1
vote
1answer
82 views

How can I speed up a slow ArcGIS Server 10.2 - PostgreSQL (9.2) ST_Intersects query?

I am troubleshooting a slow st_geometry query in Postgres 9.2 that uses ST_Intersects--a basic Select from table where ST_Intersects type query. table_extent ...
1
vote
2answers
170 views

How to style ways with CartoCSS depending on a relation property (OSM)

I'm using CartoCSS together with an OSM Postgres DB (hstore on). I want to set the line color depending on the operator tag of relations (routes). How can I do that? Update Thanks to Paul Norman for ...
0
votes
0answers
39 views

Perfom SQL queries in Python and process the result

I query column names from a PostGIS table with following Python code: colnames = [] sql_getcolumns = "select column_name from information_schema.columns where table_name='shp2py';" ...
0
votes
1answer
146 views

osm2pgsql cannot connect to postgis database, running on a Bitnami project installer

Based on this guide I am trying to import an .osm.pbf file into my PostGIS database, which is running on my Postgres Bitnami installation here: [bitnami@ip-xxx]/usr/share/proj$ which postgres ...
0
votes
1answer
32 views

How to join a WFS layer to a table in OpenLayers

So I have to bring up this old question How to join a WFS layer to a stand-alone table in OpenLayers I recently have to get this working, I have to join a WFS layer data from GeoServer using postgis ...
1
vote
2answers
206 views

invalid KML representation on ST_GeomFromKML

I exported a table with a geography(MultiPolygon,4326) column using ogr2ogr to a KML file. When trying to re-import any of the shapes using the ST_GeomFromKML function I get the following error: ...
1
vote
1answer
30 views

How to view a postgis raster query in QGIS

I have successfully loaded a large number of .asc images (>2800 200x200 tiles) into a Postgres table with PostGIS 2.1 support. The new table appears in QGIS's DB Manager and I can add the whole image ...
0
votes
1answer
132 views

OpenGeo Explorer for QGIS 2.6.1 - No module named ogr2ogrtopostgis

I'm trying to use the OpenGeo Explorer plugin for QGIS (v2.6.1) to import shapefiles to my PostGIS database. I can connect to the server, but when I try to import, I get the following error: No module ...
1
vote
1answer
20 views

Why prj2epsg cannot resolve PostGIS SRText?

In many places I have seen people referring to http://prj2epsg.org (here, here). I have used this service too, however, the service cannot uniquely identify an EPSG code alway. I understand that it ...
0
votes
0answers
22 views

Branching factor in River system?

I would like to find the branching factor for a river system. I have tried dissolving it then trying to find the branching factor but I'm not to sure how. So I have it from west to east like it ...
1
vote
1answer
192 views

Error printing pdf in OpenGeo Suite client SDK app

I am using OpenGeo Suite 3.0.2. I created an app using Client SDK and stored the raster and vector data on postgreSQL/PostGIS. The print tool is not working, giving error the following error: ...
1
vote
1answer
394 views

Downloading the distribute_setup.py

I need to download distribute_setup.py from the following website and the website seems to be broken, has anyone got an idea where else I can download this from? ...
2
votes
2answers
81 views

Can't connect to foreign SQL Server table from PosgreSQL using OGR_FDW

I'm using Windows 7, with PostgreSQL 9.3.6 installed and PostGIS 2.1.5. While I wish I could get everything into PostgreSQL, I can't and need to connect to another server running SQL Server. I need to ...
2
votes
0answers
48 views

Reprojecting PostgreSQL/PostGIS data as it streams in?

I have a postgres/postgis database. I would like to reproject those data coming to me in 4326 to 32736. For those tables with lat long info in wgs84 (4326) I have set the geom to 4326. Then I have ...
3
votes
1answer
237 views

Get Multiple Shortest Path using PgRouting in One Query

I am trying to get multiple shortest path using A* Algorithm available in PgRouting. I referred Solution given by UnderDark ( Link of the Stakoverflow Post ) . But it is not giving me proper Output. ...
1
vote
0answers
20 views

Creating geodjango model with geometry field that can accept different projections

I am working on web application with GeoDjango and within the model (db table) RoadAxis I have geometry field or more precisely LineStringField where I need to store different polylines (road axis) ...
1
vote
2answers
215 views

Counting self intersections of linestring using PostGIS?

Is there a way of using PostgreSQL + PostGIS for finding the number of self intersections in a linestring? I have a linestring that goes forward but in circles, and I need to find the number of times ...
0
votes
1answer
38 views

Insert rows into CartoDB from code

I have a simple web page where i show my cartoDB map and a dataset. I want to know if there is any way to insert new rows into my cartoDB dataset from code, so external users can add points to the map ...
0
votes
2answers
325 views

can't geocode with PostGIS 2.1.1

I don't know where's the mistake... I am using the process from the PostGIS documentation (http://postgis.net/docs/manual-2.1/postgis_installation.html#loading_extras_tiger_geocoder) . I created a ...
2
votes
1answer
57 views

How to cluster points into clusters of a maximum diameter in PostGIS?

I'm working with transit stops in GTFS. I want to group together stops (N~8000 for a medium sized agency in the USA) which are proximately related in order to reduce the number of dimensions but also ...
12
votes
4answers
5k views

Which is the best way of working with PostGIS data in R?

I work with R almost all the time, and now I am using it for doing spatial data mining, but I have this question: I have a PostGIS database with (obviously) GIS data, If I want to make statistical ...
1
vote
1answer
45 views

How do I create a spatial filter on a layer?

I have a layer that draws points in a PostgreSQL (PostGIS) database. The problem is, all points in the table are being drawn. I want to limit the points drawn to a spatial query. How do I limit the ...
1
vote
1answer
57 views

Speeding Up pgr_dijkstra using bounding box in PostGis2.0

I'm using PostGIS for the first time to calculate distances between two points, for a driving school booking system I am working on. I have loaded in all of the maps for Australia, but the query I ...
1
vote
0answers
55 views

Import shapefiles into PostGIS using Python with psycopg2

I want to import shapefiles to PostGIS using Python with arcpy & psycopg2 to connect to PostGIS. I don't want to use the existing shapefile loader nor ogr, just write my own import tool. My steps ...
0
votes
1answer
55 views

Can't import shapefile to PostGIS

Sorry if my question is double post with the previous. I have tried to browse but I think I still can't find the solution. I am using postgresql 9.4.1 and postgis 2.1(pg 94) and also qgis 2.4.0. All ...
0
votes
1answer
35 views

Problem with importing WKT to PostGIS

I'm trying to import WKT (http://polygons.openstreetmap.fr/get_wkt.py?id=2413177&params=0 - boundary of one of districts of Łódź) into PostGIS database and convert it to geometry. I've created ...
1
vote
0answers
25 views

suitable column Data-type for geojson data storage and processign in PostGis

I have a MySQL table with 2 columns, id, a unique geometry id, and GeoJSON stored as a varchar, eg, {"type": "Point", "coordinates": [116.4, 45.2, 11.1]} ...
1
vote
2answers
164 views

Error in displaying wfs layer from mapserver/postgis

I have read and tested all the relative posts but I still don't have a solution for my problem. I have a layer suscribers (points) stored in postgis database with srid=32232. I would like to display ...
1
vote
1answer
227 views

SQL-query should return GeoJSON FeatureCollection

I'm trying to return a GeoJSON FeatureCollection object from a SQL-query with PostgreSQL 9.3 and PostGIS 2.1. This is my query so far: SELECT row_to_json(fc) AS p FROM (SELECT 'FeatureCollection' ...
1
vote
0answers
16 views

set Default projection in postgis table

I've set the SRID 4326 for a table having geometry column, but when i insert a geometry without SRID, i get an error because no SRID specified is interpreted as -1 or 0, so how i can set a default ...
0
votes
3answers
344 views

Coordinate System Google Maps API

I am making an application in java using GMaps4JSF where the person will enter the address on the map I'll take this coordinate and consult on my postgis base regions in which region this point is ...
0
votes
3answers
349 views

Import DEM into PostGIS for QGIS

I'm a complete GIS newbie so sorry if I'm using the wrong terminology in searching for a solution to this... I'm trying to import a DEM into PostGIS and display it in QGIS. The data is from the EU-DEM ...
1
vote
1answer
68 views

How to create dissolved buffers in QGIS with PostgreSQL/PostGIS?

Creating a dynamic buffer in QGIS I use the following query: CREATE VIEW buffer40units AS SELECT gid, st_buffer(geom,40)::geometry(polygon, 31492) AS geom FROM point; Now I want to dissolve ...
0
votes
1answer
38 views

Displaying KML data with a user selection

I want to web map some historical cyclones data which are now in KML files, file/year. So I want the user to select a year from a button and the KML files will be displayed on interactive map). I ...