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

learn more… | top users | synonyms

2
votes
1answer
52 views

Bring a list of unsorted linestrings in order so that they form a path from origin to destination

I have a table of linestrings together with some attributes that, when displayed all at the same time, represent a connected path from an origin to a destination (each linestring has one predecessor, ...
0
votes
2answers
54 views

Reduce query time when using both MySQL and PostgreSQL with PostGIS

I am doing a tracking query. The device is sending its location data, timestamp to store in MySQL Database. I want to show the query result of every point with its nearest POI. The POI database is ...
1
vote
1answer
36 views

Referencing variables inside ST_Distance_Sphere function

I trying to create an UPDATE function that will ultimately return straight-line distance to the nearest node on an OSM network (which will be later added to pgrouting distances I have already ...
1
vote
1answer
33 views

Bad Layer in QGIS switching from PostGIS ST_DWithin from ST_Within

I can create a view in PostGIS using ST_Within and render it in QGIS without errors. If I change to ST_DWithin (note the D) it creates a valid view in the database, but bad layers in QGIS. This ...
2
votes
1answer
35 views

How to propagate attributes down several line features?

I have a PostGIS database of road features which are split at intersections. Some of the features on an individual road have certain attribute info (i.e. speed limits) and others do not. I want to ...
6
votes
0answers
39 views

Preventing invalid values in PostGIS geography

If I use pgAdmin to insert a point with an invalid latitude, say 91°, I receive the following notice before the query completes successfully: NOTICE: Coordinate values were coerced into range ...
2
votes
1answer
29 views

Preprocess OSM streets to see if query points fall “on” them

I am interested in the following query: Given a set of query points ($\leq 10$), how many of them have distance at most $s$ meters to the closest point on the closest street. What's the most ...
2
votes
3answers
53 views

Update existing Postgres table from KML?

This is related to this question, but different because it's about PostGis, not Django. I'm using Postgres 9.4 with PostGIS extensions. I have a KML file, and I want to use it to update the ...
1
vote
1answer
24 views

postgis update value from another table that intersects

I have a point table called t1 and a polygon table called t2 that are neighbourhoods. I want to record neighbourhoods name from t2 into t1 that falls in. My query is: update t1 set ti.f1 = t2.t2 ...
2
votes
0answers
35 views

ogr2ogr imports GML data (not from OSM) to Postgis but without the other_tags “hstore”-column

The problem I'm encountering some issue trying to use ogr2ogr to import some GML input data (not OSM) into Postgres. I'm trying to use COLUMN_TYPES=other_tags=hstore to store all the fields not ...
2
votes
1answer
68 views

Running Gevel on PostGIS 2.0

I have found Gevel, a tool enabling the visualization of the content of the GiST indices in Postgres. In particular, I am interested to use it to visualize the RTree spatial index in PostGIS. Does it ...
3
votes
1answer
36 views

Install PostGIS from source for specific PostgreSQL version [closed]

I have two versions of PostgreSQL on my machine (Ubuntu 12.04) one is 9.1 and the other one is 9.4. I want to install from source (I have my reasons) postgis 2.1.2 over PostgreSQL 9.4, but when I ran ...
3
votes
1answer
61 views

Need WFS-T for field work on GeoServer/PostGIS

I'm using a Boundless install of OpenGeo Suite on Ubuntu Server 12.04 with Tomcat 7. I need to allow remote access to update from the field. I can edit features fine on network, but not remotely. ...
12
votes
4answers
246 views

How to create lines to visualize differences between polygon features in PostGIS?

I've a PostGIS table polygon_b with some polygon features. There is also a table polygon_a which contains the same polygons as polygon_b but with minor changes. Now I want to create lines to visualize ...
3
votes
3answers
63 views

Unexpected behaviour using ST_Equals() with QGIS

Let's say there is a table 'polygon_a' and a table 'polygon_b'. Each table contains three polygon features. The polygon features are spatially equal. CREATE TABLE polygon_a ( gid serial NOT NULL, ...
1
vote
0answers
33 views

update query with st_intersects() is not finding results

So I am trying to identify which items from the requests table fall into some particular district from the district table using postgis. Basically, I am writing an UPDATE query that will take the ...
1
vote
1answer
48 views

Postgis cannot open out of db dted file

I import a dted file into a postgis enabled database with the -R option. I also gave the complete directory path to the file. I also have the raster and gdal related environment variables on the ...
3
votes
1answer
114 views

Strange behavior of of ST_Intersects in PostGIS

I'm quite new to GIS and PostGIS and, probably, this question has been already answered multiple times, but unfortunately I was not able to find an answer. I have few polygons and I want to find ...
7
votes
0answers
68 views

Accessing the internal data structure storing Postgis spatial index (PostGres GiST)

I am curious about how the internal data structures and storage mechanism of the spatial GiST index in Postgis. In Oracle, I used to like to show how the SDO indexes were "just another table", and how ...
0
votes
0answers
93 views

How to find a polygon from coordinates provided

I am really new with PostGIS, and I need to find a polygon providing (lat - long) coordinates. My goal is, get the coordinates x and y passed by parameters, and find the polygon which where this ...
2
votes
0answers
48 views

Qgis slow on loading project

Is there any work around to mitigate the amount of time QGIS takes when loading projects that have large tables from postgis layers . I have tried to turn off this large layers so they are not in use ...
1
vote
1answer
34 views

Syntax error in a query with ST_AsText and ST_CENTROID

I have a table in a PostGIS database where with this query : SELECT ST_CENTROID(pol8.geom) AS geom FROM polygon8 AS pol8; I got this: geom ...
2
votes
1answer
59 views

snapping line nodes to points

I have a dataset of manholes and pipes; I want to snap the lines start and end nodes to the manholes if they are within a specified distance. Been trying to find away to do this using PostGIS or QGIS ...
1
vote
0answers
25 views

PostGIS Street Intersection Autocomplete with full text search

What I'm attempting to do is create a custom autocomplete for addresses, road intersections, POI's, etc. For now we are going to using Mapbox GL (we'll be creating a custom map at a later phase), ...
0
votes
0answers
28 views

Installing Osm2Pgrouting on debian?

I'm new to Postgis. I'm trying to install osm2pgrouting on debian, but when I run cmake -H. -Bbuild I get an error : Could not find PostgreSQL (missing: PostgreSQL_TYPE_INCLUDE_DIR) (found version ...
1
vote
1answer
64 views

Difference in EPSG:28992 (RD/Amersfoort) definitions

I need to do some projections between WGS84 (EPSG:4326) and the Dutch RD system (EPSG:28992) in JavaScript. I use Proj4js for this. When adding the definition from spatialreference.org I noticed a ...
1
vote
1answer
52 views

ST_Intersection between MultiPolygon tables leads to gaps, missing intersections

I am trying to intersect two MultiPolygon tables, which are in the same UTM projection, and calculate the area of their intersections. I am getting some surprising results when I examine the ...
3
votes
0answers
58 views

Postgis sequence in QGIS not working

I have a Multipolygon-Layer stored in a Postgis-database. The primary key field 'gid' is SERIAL. When trying to add a new polygon in QGis (LYON 2.12.1 on OSX El Capitan), the attributes form shows me: ...
3
votes
1answer
97 views

Update GeoDjango models from KML?

I'm working in Django 1.9 and Postgres 9.4 with PostGIS extensions. I have a KML file, and I want to use it to update my geo fields. This is my model: class PCT(models.Model): code = ...
4
votes
1answer
85 views

GeoDjango with PostGIS: distance_lte filter is inaccurate

My view code (relevant part): location = self.GOOGLE_MAPS.geocode(lookup) if len(location): page = int(request.POST.get('page')) or 0 start = page * settings.PHOTOS_PER_BATCH end = (page ...
2
votes
1answer
237 views

trouble restoring dump, $libdir/postgis-2.1 missing

I have a university project in which I continue a project of last year. I never used those tool and I'm getting the following error: ERREUR: n'a pas pu accéder au fichier « $libdir/postgis-2.1 » : ...
0
votes
1answer
36 views

How to select congruent polygons in PostGIS?

Title says it all. What is the best way to select congruent polygons in PostGIS? CREATE TABLE polygon_a ( gid serial NOT NULL, geom geometry(Polygon, your_SRID), CONSTRAINT polygon_a_pkey PRIMARY KEY ...
1
vote
0answers
25 views

My OSM country roads network is not routable [duplicate]

I need a routable shapefile in order to execute pgrouting algorithms. I download a national zip from http://download.geofabrik.de/europe/greece-latest.shp.zip and import the roads shapefile in my ...
1
vote
0answers
84 views

Django/PostGIS: How to insert coordinates in PointField in EPSG:27700, and return EPSG:4236?

I am using Django 1.9 with PostGIS. I have input data that consists of British National Grid eastings and northings, and a table that looks like this: class Org(models.Model): name = ...
2
votes
1answer
60 views

Coordinates translation issue (from EPSG:23030 to EPSG:4326)

I'm trying to figure out how to make some translations from UTM/ED50 to WGS84. The reason I need to do them is that my data source's coordinates are in EPSG:23030 format, and I need to represent them ...
4
votes
1answer
80 views

Inconsistent results in ST_Distance

I have been playing with the ST_Distance function available within PostGIS and to my surprise, I have encountered some rather strange behavior... In the simplest setting, I have just two tables N and ...
5
votes
1answer
86 views

1-center and k-center problem / maxmin facility problem in Post

is there anybody who has already solved the 1- and k-center problem within PostGIS (optionally with distance metric obtained by pgrouting)? References: 1-center problem in Wikipedia and graph ...
2
votes
1answer
104 views

PostGIS convert point->raster->GeoJSON

My question is a follow up to Convert a raster to GeoJSON polygons in PostGIS I'm trying to accomplish querying point data from the database, and then turn that into a raster for calculating ...
5
votes
1answer
92 views

Find all intersections of a LineString and a Polygon and the order in which it intersects it

I would like to find out all intersections of a LineString (River) through Polygons (Municipalities). I would like to list the order of municipalities which the river crosses, using linear ...
1
vote
1answer
106 views

ogr2ogr Shapefiles to Postgres SRS problem

I am trying to import to my Postgresql (9.1+129ubuntu1) + PostGIS (1.5.3-2) database a Shapefile with polygons with the ogr2ogr tool from Gdal-Bin package (1.7.3-6ubuntu3). I know the origin SRS of ...
3
votes
2answers
185 views

Update area column after changes in QGIS

I'am using QGIS and POSTGIS, for example to automatically calculate the area of a new created polygon. I do that with following code: CREATE OR REPLACE FUNCTION calc_area() RETURNS trigger AS $BODY$ ...
1
vote
2answers
43 views

print polygon from “the_geom” field in postGIS database

I have a postGIS database with plots and features (owner, area, address, etc) and I would like to print any selection of that like a card. I mean I would like to show each record in a page with the ...
3
votes
1answer
215 views

Running PostGIS ST_ClusterWithin on large dataset?

I am trying to use the new ST_ClusterWithin in PostGIS 2.2 to help me aggregate building polygons that are within 5 metres. The source data has > 13million polygons. I ran the following query on a ...
1
vote
1answer
49 views

Database Tiled Aggregation request

We have a table in MariaDB that contains a lot of point of interest. These POI have a list of numerical attribute such has occurrence, weight, etc. We are looking for a way to aggregate these POI by ...
0
votes
0answers
58 views

Modifying an algorithm in pgRouting or creating a new routing algorithm [PostGIS using OSM Data]

I am currently making a routing application that uses pgRouting, PostGIS and OSM Data. Everything works fine but I discovered that the Dijkstra algorithm in pgRouting should be tweaked a bit to be ...
2
votes
1answer
87 views

Checking if Point is inside a GeoJson polygon using PostGIS?

I have a list of points stored in my database, in a text format. lat | long "-73.88110000007934", "40.817699999744555" "-73.92675000057572","40.81840599962764" "-73.883573184", "40.751662187" I ...
0
votes
1answer
73 views

How to improve PostGIS raster query

I have this query SELECT data_type, data_time, model_name, ST_Value(raw_data, 1, 202,417) AS val_0 FROM data WHERE data_type = 'type_a' AND data_time >= '2015-12-06 00:00:00' AND ...
1
vote
2answers
63 views

Importing OSM data into PostGIS and display into QGIS

I am new to all the GIS thing but I need to set up a full GIS infrastructure for a project. I have installed a Postgres server with PostGIS. That is on ancient hardware for now, 32bits processor with ...
3
votes
1answer
51 views

Geojson in postgis Geometry : Z dimension error

i had this php code : ...
3
votes
2answers
55 views

PostGIS raster - [x,y] from lat/lon

I have coordinates in [lat, lon]. How can I convert them to the rasters "pixel" position [x, y]? I know raster top-left corner, scale and skew.