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

learn more… | top users | synonyms

0
votes
0answers
6 views

Extract TopoJSON directly from PostGIS

I have a simple "region" table: id (TEXT), name (TEXT), geom (MULTIPOLYGON). Here's the query I can use to extract a GeoJSON FeatureCollection: SELECT row_to_json(fc) FROM ( SELECT ...
2
votes
1answer
64 views

Trouble using ST_Difference to remove overlapping features

I am trying to use ST_Difference to create a set of polygons (processing.trimmedparcelsnew) that do not contain any of the area covered by another set of polygons (test.single_geometry_1) using ...
2
votes
2answers
28 views

ST_Union based on attribute

I have a road network of center lines of MultiLinestrings.They have nodes at every intersection. I try to understand how I can merge roads together that have the same category as attribute (There are ...
0
votes
0answers
22 views

ST_Dwithin Source Code

I am looking for the st_dwithin postgis source code. I want to learn the way postgis determines whether a given geometry is within a given radius to another geometry.
0
votes
1answer
27 views

CartoDB (PostGIS) near function (distance) points to polygons

I have a CartoDB map here: Link: https://dms2203.cartodb.com/viz/78db6c02-3148-11e5-a42f-0e018d66dc29/public_map I'm trying to find the distance of the points to the polygon. If the points are ...
2
votes
0answers
11 views

Calculate mean value of polygon from raster in PostGIS

I started with a NetCDF .gri and .grd raster file of the UK provided by a colleague. I clipped it in R to be only London, exported and converted to a ASC file, and then imported it to PostGIS using ...
0
votes
1answer
18 views

PostGIS - store 2D elevation data

I am new to PostGIS. How can I store 2D elevation data? I have uniform raster and for every [x,y], height is set. I want to be able to use this in my queries (something like SELECT height FROM data ...
0
votes
0answers
6 views

Clean polygon from ST_Difference problem

I'm trying to make union then difference between the same polygons using this code: ST_Simplify(ST_Difference(ST_Simplify(ST_MakePolygon(ST_ExteriorRing(ST_UNION(parcelles.shape_prcelle, ...
0
votes
0answers
15 views

Problem importing sqlite into Postgres (with PostGis) using ogr2ogr

I am trying to import a very large sqlite file into Postgres SQL 9.3. The first tool I tried to use was OGR2GUI (http://www.ogr2gui.ca/). The 64 Bit version does nothing, whilst the 32 bit version ...
-2
votes
0answers
19 views

How to generate map using geoserver & openlayers in java from postgis data? [on hold]

How do I generate a layer of map from postgis data(from shape files) using geoserver and openlayers. I have installed geoserver-2.7.1.1 & openlayer 2.13.
1
vote
0answers
8 views

Postgis ST_AsSVG renders a tiny SVG

I am storing information about a person's journey as a linestring. Having recently discovered ST_AsSVG I tried the following query: SELECT ST_AsSVG(path) FROM activities WHERE id = 209 ...
1
vote
0answers
265 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' ...
0
votes
1answer
213 views

ST_Dump not working with geometry_dump

I am trying to ST_Dump a geometry_dump column comprised of points and paths in PostGIS 2.0 using SELECT (ST_Dump(geom)).geom FROM pointdump However, I get the error message 'function ...
0
votes
1answer
51 views

What command to use in PostGIS to get same result as ArcGIS?

I have two shapefiles and i'm trying to do simple spatial analysis. When I want to know which polygon belongs to other polygon in other shapefile I always use select by location and in Spatial ...
0
votes
2answers
435 views

PHP PostGIS to geoJSON missing required parametar error

I'm using this PHP PostGIS to geoJSON script: https://gist.github.com/bmcbride/1913855 But I keep getting this error: 'missing required parameter: geotable' This is my code: # Retrive URL ...
1
vote
0answers
34 views

How to create a trigger for multiple schemas?

One of my PostgreSQL databases contains different schemas which share the same structure. -- schema region_a CREATE TABLE region_a.point ( gid serial NOT NULL, geom geometry(point, SRID), ...
2
votes
1answer
44 views

Spatial Join to count points in polygons in lat/lon

I have a table, called pets, with lats and lng coordinates and variables and a table that was created by uploading a shapefile, called city, with columns left, right, top, bottom, lat, lng, and geom. ...
0
votes
1answer
423 views

ERROR: Operation on two geometries with different SRIDs

I'm new when it comes to GIS and PostgreSQL. I have searched everywhere for the cause of this problem but I can't find the solution. I was following the documentation here First i created a table: ...
1
vote
1answer
244 views

How to refresh features on a OL3 map automatically?

I am using OL3 and GeoServer and PostGIS as database. My database is connected to GeoServer and OL3 conected to GeoServer and reads the points in database as vector layer and shows on the map. My ...
0
votes
1answer
15 views

PostGIS: Invalid Input Syntax for Type Double Precision

I have this query that is trying to update my geom column that's built off of lat and lng coordinates UPDATE main_table SET geom = ST_SetSRID(ST_MakePoint(lng, lat) ,4326); However it returns that ...
2
votes
0answers
26 views

match noisy GPS data to closest linestring in road network [duplicate]

I have some noisy GPS data(Points) that they are not exactly on the road because of the noise. But I want to match them to the closest road linestrings. How to do this in PostgreSQL? Data: ...
0
votes
1answer
31 views

I'm not able to add SQL file to postgresql database

I started with basics and did these steps: createdb -U postgres -E UTF8 -O Peete gis -OK createlang -U postgres plpgsql gis (was already installed) -OK psql -U postgres -d gis -f ...
3
votes
1answer
181 views

Building a ol3 webapplication with dynamic content and user registration

My setup: currently i'm using a postgis database, get it with a geoserver and display it with openlayers 3. I use the wfs data to display the features in clusters and i'm able to edit them with wfs-t. ...
3
votes
1answer
168 views

Query to Dissolve Nearby Polygons on Hive

I am using the ESRI spatial framework for Hadoop, that extends Hive to use spatial types and operations. My objective is to translate a set of simple queries on PostGIS into Hadoop, in order to ...
0
votes
1answer
150 views

How do I explode a MultiLineString using ST_Dump() in PostGIS?

I want to do what this blog post does: explode a MultiLineString into individual LineStrings. I'm using CartoDB but don't get individual LineStrings as the result of my query. I still get a ...
3
votes
2answers
2k views

PostGIS Error: type “geography” does not exist

I just upgraded my development machine to Windows 7 and am therefore reinstalling PostgreSQL and PostGIS. I used the Postgres Plus installer, as recommended on the Postgres website, and followed this ...
1
vote
1answer
31 views

In PostGIS: How to delete completely overlapping polygons?

I would like to eliminate overlapping polygons from a table that is often updated with new polygons, but only if a certain attribute has a higher value. If this higher-priority polygon only partly ...
2
votes
1answer
23 views

Attaching way id to SVG XML from GeoServer/PostGIS for postprocessing?

I render my SVG from Database Layer (PostGIS). I suppose there is basically 1-to-1 match between the ways (polygons) in DB and SVG path elements. Is it possible to attach the way id to the SVG XML ...
2
votes
1answer
182 views

pgsql2shp ERROR: incompatible mixed geometry types in table

I have multi-linestring in .shp files and I split the lines with postgis, but that result is only geom column. It does not works with shape file exporter error: incompatible mixed geometry types ...
2
votes
1answer
569 views

PostGIS: ST_Transform function conversion problem

I'm inserting map data from a GML file with srid EPSG:27700 into a PostGIS database table with srid EPSG:4326. I'm using the ST_Transform function as in this snippet: ...
1
vote
2answers
466 views

Polygon intersection with bounding box with polygon's holes intact

I am trying to serve GeoJSON FeatureCollection tiles with each feature's geometries trimmed to the tile boundary. I am working on a Leaflet plugin to re-assemble the geometries. It works by building ...
0
votes
1answer
353 views

Drawing curved lines in CartoDB?

I am experimenting drawing curved line from Origin to Destination in Cartodb. I was able to do so once, however, failed the second and third time. Could anyone offer me some insights into the ...
1
vote
1answer
674 views

Error saving polygon with hibernate spatial and postgis

I'm trying to persist a com.vividsolutions.jts.geom.Polygon in my PostgreSQL (with PostGIS enabled) database, using Hibernate and Hibernate-Spatial plugin. Caused by: ...
4
votes
1answer
51 views

Is there a difference in results between Simplifying a geometry by different projections?

We have geometries in a PostGIS database projected in srid 4326. We need to have these geometries simplified with ST_SimplifyPreserveTopology. My question is whether this geometry needs to be ...
4
votes
3answers
172 views

3d vector and geometry operations in open-source GIS

There is some really good open-source software available to work with 2D vectors. For example QGIS has operations like buffer / clip / dissolve / select by location / join attributes by location... ...
2
votes
2answers
287 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 ...
0
votes
0answers
33 views

connect postgis on Openlayers 3 and mapserver

Hope you can guide me in this issue I have. My aim is to connect to a Postgis database from Openlayers 3 using Mapserver WMS. (All test I have done as localhost) I have read that I can do that ...
1
vote
0answers
18 views

Unable to load Postgresql spatial data in R (with rgdal)

I'm trying to load spatial data from a postgresql database in R, using functions from the package rgdal, but I'm having trouble getting the functions to work. For example, when trying to read a ...
1
vote
1answer
21 views

PostGIS nearest point with LATERAL JOIN in PostgreSQL 9.3+

I need to obtain on each element on one table the closest point of another table. The first table contains traffic signs and the second one the Entrance Halls of the town. The thing is that I can't ...
2
votes
0answers
19 views

Are there methods of filtering gps-data with metadata?

In our project we captured GPS-tracks from subjects in the timeframe of a year. In total we captured around 13000000 GPS-points this way. The captured data comes from an electric powered car and is ...
6
votes
2answers
164 views

What controls the direction of TopoGeometry Linestrings?

In PostGIS, what if anything controls the direction that topogeometry LINESTRINGs will have when converted to geometry? It doesn't appear to be the order in which the edges are listed in the call to ...
1
vote
2answers
30 views

GeoJSON from PostGIS for Vector

Based on the following code block: var SphericalMercator = require('sphericalmercator'); var mercator = new SphericalMercator({ size: 256 }) var bbox = mercator.bbox( +req.params.x, ...
1
vote
2answers
41 views

Adding additional geometry column in PostGIS

I'm importing many sets of geodata into PostGIS, and they have different SRID's. (Some have EPSG:3857, some EPSG:4326, some something else). I'd like to create an additional geometry column, eg. ...
10
votes
2answers
2k 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 ...
0
votes
2answers
38 views

PostGIS : ST_Contains doesn't work after ST_FlipCoordinates

I'm using postGis in a personal project, mainly to determine if a point is inside a Polygon. I realized I was using lat/long instead of long/lat for creating my polygons and using ST_Contains. Thus i ...
1
vote
2answers
291 views

Create shapefile from data PostGIS or KML using Java

I'm working on a geographic information system project, whose products form shapefiles. I am using the Java programming language and a PostGIS database. Is there a way to generate a shapefile from ...
0
votes
1answer
143 views

How do I create a new vertex in the middle of an edge in postGIS?

I have a postGIS database populated with OSM data with the osm2po import tool. I have a number of fixed points that I want to route between using pgrouting. In order to do this accurately, I want to ...
2
votes
2answers
3k views

PostGIS convert geography(Point,4326) to GPS

I got a database with a column of type geography(Point,4326), the data contained looks like 0101000020E610000092E057F66EF73140930035B56CBD4840. How can I convert it to GPS coordinates?
0
votes
1answer
146 views

TileStache:TileStache.Core.KnownUnknown: Couldn't get a layer from data source!

I want to use tilestache to get geojson files. I hava run tilestache-server.py -c tilestache.cfg ,and it works well. However,I want to get tiles from data stored in postgis. Maybe it will need to run ...
7
votes
1answer
2k views

Generating Interactive Tiles using Nodejs, Mapnik, and PostGIS for Leaflet

I am looking to do something like this but where I have all the data on the same server. I've been following through the set of tutorials @ sparkgeo.com/labs/big/ and I'm having some difficulty. ...