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

Problem visualizing OSM's ways twice in leaflet

I have retrieving all types of data from a small B-box using the Overpass Api and i have populated Postgres(postGis) using "osm2pgsql" with the default style. I can extract the ways into geoJson ...
1
vote
0answers
6 views

GeoWebCache tiling failing due to topology exception

I am running GeoServer 2.8 WAR on an Ubuntu machine in Tomcat 7. I have GeoWebCache integrated directly and it does cache and serve some tiles. However, in some areas I get errors when I attempt to ...
0
votes
1answer
16 views

PostGIS - Raster - update all values - what is prefered

I have added the Raster support to my PostGIS database program. Now, I need to update all values in the raster (one band only) several times a day. I have found and tested these two options Use ...
0
votes
0answers
14 views

Convert distance from meters to EPSG 3857

I need to convert distance from meters to units of EPSG 3857 in PostGIS. This is important for me to calculate a radius for ST_DWITHIN as I'm dealing with geometries. How can I do this?
1
vote
1answer
34 views

How can I import shapefile in python?

How can I import a shapefile in python? from PyQt4.QtCore import QSettings, QTranslator, qVersion, QCoreApplication from PyQt4.QtGui import QAction, QIcon, QFileDialog # Initialize Qt resources from ...
1
vote
0answers
16 views

Indexing PostGIS table by tile boundaries

I have a PostGIS table with 2M rows, all Points. I'm creating tiles from the data, but it's quite slow. Although I have the normal geometry indexes enabled on the table, I wonder if it's possible to ...
2
votes
1answer
32 views

How to detect if point is on the left or right side of the line in PostGIS

I have a linestring table and a point table in postgis. I know the closest line to any given point. What I need to know is on which "side" of that line is the point. I guess I have to do that by ...
1
vote
0answers
15 views

What solutions to use QGIS as insert tool for a Postgres relationnal database?

I have a Postgres/PostGIS relational database and I would like to use QGIS as an interface for inserting data. The thing is that my database is quite complex and I need my tool to handle the following ...
1
vote
0answers
9 views

Django Postgis Distance from point

I have a point where the objcet is and another point for mylocation. I want to calculate the distance >> object_location <Point object at 0x7f9ceaac7be0> >> mylocation <Point ...
3
votes
0answers
22 views

GeoServer and PostgreSQL JSON column

I have a database table with a dynamic schema implemented via a JSON column named "properties". Currently GeoServer doesn't recognize my JSON column. Is there some way to make Geoserver recognize ...
3
votes
3answers
34 views

Calculate distance with JTS

I'm trying to get the distance between two points with JTS. The problem is that this function with JTS new Coordinate(Lon1,Lat1).distance(new Coordinate(Lon2,Lat2)) Is giving a different result ...
1
vote
1answer
34 views

How to get PostGIS DB name from QGIS layer?

I'm writing a custom Processing script that needs to know which database connection a vector layer resides in. I can't find anywhere in the API a function to return this information from a layer. So I ...
2
votes
1answer
42 views

How to load a style from POSTGIS in PyQt

The thing is that I have four styles I have created in QGIS through the GUI and saved into a postgresql database. I can see them in the table named layer_styles I have seen similar questions asking ...
1
vote
1answer
19 views

PgRouting: Target vertex error

I'm trying to make a matrix that shows the cost from a node to the rest of the nodes in a network. The final result I'm looking for is not the cost, but only know if a car can or can not reach each ...
2
votes
0answers
50 views

Create Indexes Within a View? How could I Speed up Spatial Queries Over a View?

I´m trying to add a view from postgis using QGIS, what´s facile. The problem is that it´s taking too long to load it and to perform any kind of operation, for example, as simple as counting rows. It´s ...
0
votes
1answer
18 views

GPS points of a vehicle snapped to a specific polyline path [duplicate]

So I have been capturing bus GPS locations for a while now, and I am became interested in snapping them to their corresponding polyline (route). While at first this seemed like an easy enough task I ...
0
votes
1answer
27 views

Find Overlap Between Two Polygons

I have a two shapefiles, one is a DMA level and one of US states level. How do I figure create a shape file containing DMA of a certain state, for instance, Texas from a larger shapefile. I tried ...
2
votes
1answer
34 views

How to find Shortest Route between two points in PostGIS without using pgRouting?

I want to find shortest route between two points stored in PostGIS database. I know about pgRouting functionalities but I don't want to use it because of data processing/topology creation processes. ...
0
votes
0answers
19 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 ...
0
votes
1answer
35 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.
2
votes
0answers
31 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 ...
2
votes
1answer
34 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
2answers
31 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
25 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 ...
-1
votes
0answers
34 views

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

I am a newbie in geoserver and want to know how to render map (postgis database) in openlayers using geoserver? I want to add the base layer. I tried: var layer = new OpenLayers.Layer.WMS("OpenLayers ...
1
vote
0answers
10 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 ...
3
votes
1answer
98 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), ...
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 ...
0
votes
1answer
54 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 ...
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: ...
2
votes
1answer
46 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
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 ...
2
votes
1answer
73 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 ...
1
vote
1answer
34 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 ...
1
vote
1answer
29 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 ...
1
vote
0answers
19 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
22 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 ...
2
votes
1answer
24 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 ...
4
votes
1answer
52 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 ...
1
vote
2answers
33 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, ...
0
votes
0answers
29 views

Enable PostGIS extension on Ubuntu 14.04.2

I have troubles enabling PostGIS extension on Ubuntu 14.04.2 and PostgreSQL 9.3. I have installed the packages with this step by step procedure. PostgreSQL and pgAdminIII seem to be installed ...
1
vote
0answers
32 views

Is it possible to perform spatial join in PostGIS and keep all features?

I am attempting to create an employment change map using a hex grid. I have individual establishment data as points with attached employment figures. When I ran the spatial join using the postGIS ...
0
votes
1answer
31 views

Spatial query ST_CONTAINS returns empty result

I want to create a database view in Postgres/PostGIS which returns a subset of the points stored in another table called locations. The subset is defined by an area stored in yet another table called ...
1
vote
2answers
46 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. ...
0
votes
1answer
18 views

How to set the target schema using osm2pgrouting

Is it possible to set the target database schema using osm2pgrouting? After some debate and troubleshooting, I've decided to host my OSM-based pgRouting data in the same database as the rest of my ...
5
votes
0answers
51 views

Best way to cut linestrings with points

i was checking the best way to cut linestrings by points. The scenario is: lots of streets, need the segments cut by intersect points, kind of this: I got linestrings (full uncuted by points) ...
0
votes
0answers
21 views

Return nodes along portions of edges with pgrouting

I have been experimenting with generating isochrones with pgrouting using osm data. So far, I have been able to generate isochrone polygons by getting the concave hull of the nodes returned from the ...
0
votes
1answer
20 views

Tweaking the table after shapefile import?

I'm importing shapefiles to Postgresql with the shp2pgsql command line tool. shp2pgsql -s 3035 -W "latin1" foo.shp | psql Should I do some table (SQL) tweaks after that? Or is the import fine after ...
0
votes
0answers
32 views

Cannot find information about my.table table in raster_columns

I am running PostgreSQL 9.4 and PostGIS 2.1 and have loaded a small piece USGS SRTM data for North America successfully into my database. I am attempting to export a small piece of of the rasters I ...