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

learn more… | top users | synonyms

1
vote
1answer
32 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
16 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
25 views

How to find a polygon from coordinates provided [on hold]

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 ...
1
vote
1answer
20 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 ...
5
votes
1answer
64 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
42 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 ...
2
votes
0answers
14 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 ...
4
votes
1answer
227 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 ...
0
votes
1answer
218 views

spatial query using GeoExt and openlayers

I want to allow the the User to make advanced custom queries against a layer.So he can search by name or another attribute and get zoomed to the requested feature ( hospital in my case) . I m ...
-2
votes
0answers
16 views

how can i add tiled layer on Sharpmap using postgresql? [on hold]

map = new Map(); try { //VectorLayer v = new VectorLayer("Point", new PostGIS("server=localhost;port=5433;user=postgres;pwd=9839757437;database=OSM3", ...
2
votes
0answers
28 views
+50

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 = ...
6
votes
2answers
545 views

How to symbolize features with NULL values in graduated symbology?

I have a polygon feature dataset, and an attribute from a different table that I join (one-to-one) within QGIS in order to symbolise the attributes as a choropleth map. However, not all polygon fields ...
2
votes
1answer
17 views

Multi-string data-set without z layer, applying ordinal values as a workaround

I'm new to GIS and have been learning a lot over the last few weeks, however, I've finally come to a point where I could use some help. I'm working with the pdx_streets data-set from ...
1
vote
0answers
13 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
20 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
20 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 ...
2
votes
2answers
204 views

Using st_intersects caused mismatch when a marking (tagging) shape marked a polygon overlapping only on the edge

I have accidentally marked a landshape as being tagged "CU GO-M" because it seems to share an edge with a tagshape for "CU GO-M" but nothing else. I used the st_intersects method to join these shapes ...
1
vote
1answer
43 views

Display WFS (GeoJSON) from GeoServer with OpenLayers on Django

I want to display point data from PostGis to my Django application. I created WFS service from GeoServer and want to display using OpenLayers. I went through many posts but none of them worked My ...
1
vote
1answer
79 views

Getting netCDF data into PostGIS database using Python?

I can read the netCDF file data with netCDF-python or with gdalinfo, but I am unsure of the easiest way to get it into a PostGIS database. It would be really easy if I could convert the netCDF file ...
1
vote
2answers
88 views

How to get ST_MakeLine ready for QGIS?

CREATE VIEW new_line AS SELECT point1.gid, ST_MakeLine(point1.geom, point2.geom) FROM point1, point2 WHERE point1.gid = point2.gid; It's possible to load the layer but QGIS says 'There is no entry ...
1
vote
1answer
47 views

TileStache Dynamic query based on zoom level

I wanted to make tilestache to be able have a different query for different zoom level. For certain zoom level I wanted TileStache to query from different postgres table. How can I achieve this? Is ...
1
vote
1answer
244 views

ST-Links convert Feature Class to DB Table error

I'm using ArcMap with the ST-Links SpatialKit Conversion tool to convert a Feature Class to a DB Table. But I'm getting an error: ERROR: 42601: type modifier is not allowed for type "geometry". I ...
4
votes
1answer
508 views

How to create an exact tracking route from GPS data with animated icon?

Probably this is not purely GIS related question, its related to developing issues. I am just asking if there is any kind of suggestions from Gurus. I am building an tracking application where GPS ...
0
votes
1answer
303 views

Starting Tile Sever Rendering Error: OSMBright.xml

I was following the entire process found here: https://switch2osm.org/serving-tiles/manually-building-a-tile-server-14-04/ I have an error though on Testing your tileserver part where i run the ...
3
votes
0answers
42 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: ...
2
votes
0answers
20 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
23 views

QGIS Server sending UPDATE… WHERE NULL to postgis in a WFS layer

I am running a Windows Server 2012 server. PostgreSQL 9.3.5, 64-bit POSTGIS 2.1.3 QGIS Server 2.6.1-2 QGIS Desktop 2.8.3 and 2.12 I am using a Microsoft Surface Pro 4 tablet using QGIS Desktop ...
-1
votes
0answers
12 views

analysing height data using dem [duplicate]

i ran the following code on python 2.7: import sys, struct from osgeo import gdal from osgeo import gdalconst minLat = -48 maxLat = -33 minLong = 165 maxLong = 179 dataset = ...
2
votes
1answer
29 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
32 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 ...
3
votes
2answers
2k views

calculating percent area of intersection in where clause

I have a table of polygons (census block groups) in postgres. I want to tag each block group with the town (another polygon table) it mainly resides within. Is this possible? I'm thinking I'd need to ...
0
votes
2answers
243 views

Shp2pgsql - exec() not allowed on external server

Me and my collegue are using the shp2pgsql and psql commands in php code (a Drupal module to be precise). We put these commands in a php variable and use the exec() command to execute them. This ...
1
vote
0answers
20 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 ...
0
votes
2answers
559 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 ...
4
votes
1answer
67 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 ...
0
votes
0answers
34 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 = ...
21
votes
5answers
39k views

How to get coordinates from geometry in PostGIS?

This line: SELECT geom FROM myLayer.geom will return a hex value, i'm wondering how would it be possible to get decimal values, a result that look likes human-readable coordination? Regards,
2
votes
1answer
293 views

How to enable SFCGAL in PostGIS?

I have the problem with the enabling extension SFCGAL. CREATE EXTENSION postgis_sfcgal; doesn't work for me even I have the PostGIS v2.2. When I do that, it throws an error ERROR: could not ...
1
vote
1answer
31 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
69 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 ...
2
votes
2answers
62 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 ...
3
votes
1answer
97 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$ ...
4
votes
1answer
226 views

How to migrate spatial tables from MSSQL to PostGIS

I'd like to migrate my spatial data from MS SQL Server to PostGIS. Originaly the data was stored with SDE under MS SQL. Then I migrated with an ArcGIS tool. That created a spatial data column with ...
29
votes
5answers
13k views

How to migrate GDB data into PostGIS without ESRI apps?

Can you tell me how I can load geodatabase data into PostGIS without having to install ESRI apps? The solution I found online talked about using ArcGIS to convert GDB to SHP and then importing SHP to ...
1
vote
1answer
41 views

Find Feature class into another feature data

I am trying to find the feature classes from one feature data into another feature classes. But I'm getting nothing at the end as a result of the matc statement. The data in the arc environment is ...
1
vote
1answer
66 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 ...
2
votes
1answer
202 views

Solving “Traveling Purchaser Problem”

Till now, I was using PostGIS-pgrouting pgr_tsp function to solve Travelling Salesman Problems. This function can give us the best possible route depending upon the cost parameter when the starting, ...
1
vote
1answer
43 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 ...
1
vote
1answer
640 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 ...
3
votes
1answer
165 views

GROUP BY on geography in postgres 9.4.0 returns wrong/different results

table definition: CREATE TABLE search ( id bigserial NOT NULL, location geography(Point,4326) NOT NULL, location_aggregated geography(Point,4326) NOT NULL, created timestamp with time zone ...