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

learn more… | top users | synonyms

0
votes
0answers
5 views

how to Find nearest line for the given point from a collection of lines?

I have table with lines(linestring).For a point wich i give it , I want to find out nearest line in point. I almost developed a query, but it is return the same line every point i give. the query ...
1
vote
1answer
741 views

Having trouble connecting QGIS with postgres database with postgis extension

I am working on Ubuntu Precise with postgresql version 9.3 and postgis 2.0. After initially starting my postgres database and eventually getting permission errors that would prevent postgres from ...
4
votes
3answers
3k views

How to fix “spatial_ref_sys relation does not exist”

I am trying to install postgis in my database. I compiled the library successfully. Now when I try to import the sql spatial_ref_sys is shows the error that spatial_ref_sys relation does not exist ...
4
votes
1answer
146 views

PostGIS doesn't use index for spatial query

I can't get PostGIS 2.1 running on PostgreSQL 9.3.5 to use a spatial index even for the simplest queries. The whole dataset is 8 million points (population count grid from here ...
2
votes
1answer
24 views

How do I get the closest point on a road to a point when I have imported OSM data using osm2pgsql?

I have been trying to use OSM data to find the closest point to a road for a given point. I imported the OSM data into postgis using osm2pgsql, and I am getting results back, but they are at the ...
4
votes
2answers
27 views

How to extract nodes with PostGIS to a multipoint geometry

I have a line in a PostGIS table test_line. I want to extract it's nodes into a multipoint geometry. I tried the following: SELECT ST_Collect((ST_DumpPoints(the_geom)).geom) FROM test_line; But it ...
1
vote
1answer
117 views

Union of several linestring to multilinestring using MS SQL Server

Followed Postgreql query is the existing one used to combine serveral linestring to a single multilinestring. is there any equivalent of this in SQLServer . SELECT ST_AsText(ST_Collect( ARRAY[ ...
2
votes
1answer
250 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 ...
1
vote
1answer
73 views

QGIS does not update data in Geoserver WFS-T

I am trying to edit a WFS from geoserver (using PostGIS data) within QGIS. This is the request as recorded by Fiddler <Transaction xmlns="http://www.opengis.net/wfs" ...
1
vote
0answers
50 views

Issues with QGIS WFS editing/PostGIS rendering

I want to be able to view and edit spatial data within a postgis database. I have tried using a WFS with Geoserver - but constantly get 'Empty Response' error and the Network log says the request ...
0
votes
0answers
17 views

Ways of editing Postgis tables from remote desktops (WFS?)

I've got like 500 postgis tables and i would like to serve then as WMS and especially as WFS to be able to edit that info. To do so i read that the easiest way is Mapserver + TinyOWS. Mapserver works ...
7
votes
1answer
141 views

Suitable algorithms for simplifying isochrone polygons

I'm looking for an algorithm for simplifying isochrones which were generated using OSM data. These are generally characterised as having lots of small "holes" mostly due to missing OSM data but also ...
0
votes
1answer
198 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 ...
0
votes
1answer
19 views

geometries with different SRIDs errors (even after setting SRID)

I've looked at existing questions about this (including this one) and followed the advice that was shared there. I'm still seeing this when I run some queries: RuntimeError: Postgis Plugin: PSQL ...
0
votes
0answers
43 views

box2d spatial type

I'm storing data that defines a box. I created a column by adding it to my table as follows: SELECT addgeometrycolumn('grid', 'grid_geometry', 32650, 'GEOMETRY', 2); I then insert my data in using ...
0
votes
0answers
25 views

How to deal with grid data?

I'm trying to create an application that will show (approximate) population in a given area (the area is quite simple, just a circle with user-supplied coordinates and radius). I've imported this ...
3
votes
2answers
34 views

Querying PostGIS and OSM to get only major stations and subway of UK?

I am working with Great Britain OSM data. I have read the classification of UK railway stations. There are a lot of classes in there such as subway entrance, halt, station and many others. I want to ...
0
votes
1answer
58 views

PostGIS: Ensure Intersection of 2 Polygons results in a Polygon

I want to ensure that the result of ST_Intersection(polygon1, polygon2) is also a polygon. I initially filtering by ST_Overlaps(polygon1, polygon2) but that seems to only ensure that both features ...
0
votes
2answers
358 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 ...
2
votes
1answer
43 views

osm: relation tags to nodes

I filter an osm planet extract using osmfilter. I am only interested in nodes belonging to route=subway relations. After performing this operation, I use osm2psql to load all the data into my postgres ...
35
votes
4answers
7k views

What are the pros and cons of PostGIS geography and geometry types?

My company uses geometry (the_geom) data type for storing geospatial data. I've recently been acquainted to the concept of geography (the_geog) data type which, as I understand it, stores the SRID ...
3
votes
2answers
887 views

How to get JSON representation from JTS Geometry?

I'm using JTS (http://www.vividsolutions.com/jts/JTSHome.htm) and need to get a JSON representation of a Point : Hibernate beam: @Type(type = "org.hibernate.spatial.GeometryType") ...
4
votes
2answers
2k views

How to setup PostGIS JDBC with Hibernate?

I try to setup an Java Application with Hibernate and PostGIS but I always get nasty exceptions like : java.lang.NoSuchMethodError: org.hibernate.type.CustomType.<init> ...
1
vote
1answer
117 views

Creating a postgis database a GML application schema

Is there any open Source tool(automated or semi-automated) that converts GML application schema to a POSTGIS database/table .Specifically I have a huge application schema containing many ...
1
vote
1answer
81 views

PostGIS - Intersects feature to split into linestring

I would like to know if it's possible to intersect feature datasets (multipolygon, polygon, multilinestring and linestring) to get a result as a set of linestrings being split at each intersection ...
55
votes
8answers
4k views

How do I get started with PostGis

I have been reading a lot about it, but I am struggling to find a good beginner's guide. Which tutorials/books do you recommend? My past experience involves python and arcgis. But I have never worked ...
2
votes
1answer
442 views

Create isochrone from multiple start points

I want to create an isochrone. For this I could use the pgr_drivingDistance function with pgRouting (http://docs.pgrouting.org/dev/src/driving_distance/doc/index.html) but it only takes one start ...
4
votes
1answer
3k views

Why is PostGIS query not using spatial index?

I am having an issue with a spatial query that is not making use of indexes. My schema is: CREATE TABLE geoplanet_place ( woeid integer NOT NULL, "name" character varying(300) NOT NULL, ...
0
votes
2answers
238 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 ...
1
vote
0answers
48 views

PostGIS: Merge any and all adjacent polygons

I would like to do adjacency tests on a parcel (polygons) layer and merge them if they fit certain criteria (could be size). Per the picture below, I would like to merge polygons 1,2,3 and 4, but not ...
2
votes
1answer
63 views

PostGIS cannot create new feature

I have a PostGIS database - using the main user I can create/update new features no worries. I have created a series of new logins and given them all full access to select/insert/update etc all the ...
6
votes
4answers
2k views

Point in polygon algorithm for multiple polygons

I've a Google map with bunch of polygons on it. Here is a problem I'm interested in: Given a lat,lng point, what's the best way to determine all the polygons that this point lies in? The obvious way ...
2
votes
1answer
26 views

PostGIS replace pixel value by lookup table?

I was wondering if it is possible to write a PostgreSQL statement to replace the value of each pixel in an input PostGIS-raster with a value obtained from a look up table. For example, suppose I have ...
1
vote
4answers
167 views

PostGIS importing shapefile error w/ official manager

I'm having some trouble when trying to import an shapefile of the Sao Paulo Brazil's state (I downloaded it from the web and I'm using the own PostGis manager to import it). Here's an image! The ...
0
votes
0answers
29 views

How to speed up PostGIS-Raster based map algebra?

I am testing map algebra with PostGIS (2.1) on two images, and found it to be rather slow. For example, dividing two images of 7200 * 3600 pixels took 110 ~ 120s on a desktop with i7 3.4 GHz CPU; the ...
3
votes
2answers
639 views

How to debug 'Layer is not valid error' from Python plugin?

I'm trying to understand what goes wrong with a QGIS python plugin. Basically I'm trying to render a series of POINT. The query works fine, at least giving it by hand from inside PostGIS DB: "SELECT ...
11
votes
1answer
210 views

How to compute the smallest network that connects all points using PostGIS?

I have a set of postgis scripts which generates two tables - one of a set of points and the second a set of roads which surround them. All data is in the same projection and both outputs are stored in ...
3
votes
1answer
196 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. ...
0
votes
1answer
309 views

How to get points in bounding box by degrees for map

I have some concerns about working of BOX3D PostGIS function. I tried to find places in square -158.721365889063 66.09275164148659, 154.608712235937 52.56807548751039(degrees). But this where ...
1
vote
2answers
288 views

What are some good examples of geospatial UI's [closed]

I am interested in understanding and applying practical geo-spatial examples for some of the transportation data that I have. I have several geocodes that I will pull from the database, and display in ...
3
votes
3answers
106 views

Plotting Geo Points with “by arc centered at” Instructions

A recent Supreme Court decision redefined the legal boundaries of California along the Pacific Ocean: http://www.theverge.com/tldr/2014/12/15/7397085/supreme-court-california-boundaries-map I am ...
0
votes
0answers
20 views

Trouble setting up Postgres PostGIS database with GeoServer [closed]

Last weeks I created an application. I want to import from PostgreSQL a database to GeoServer, so that I will call WFS-T service after to my project using JavaScript. For the first time I have to ...
2
votes
0answers
10 views

Geoserver : create a rasterized polygon / dynamic fill for polygons with features from database

I decided to post here because I couldn't find any answer to my problems on the internet. So I am using geoserver 2.7-SNAPSHOT, everything is working fine but I need to implement a new function or ...
6
votes
5answers
2k views

Problem loading OS OpenData multipoint shapefile into PostGIS

I am trying to load the OS OpenData Strategi shapefile dataset into a PostGIS database. I have had no problems with the polyline and polygon shapefiles, but I am unable to get the point shapefiles to ...
0
votes
0answers
151 views

Problem inserting feature into GeoServer empty layer via WFS-T

I'm facing a strange issue with GeoServer (2.4) (on PostgreSQL 9.4/PostGIS 2.1). The problem is I am not able to insert a feature via WFS-T if the layer is empty; it returns me the following error: ...
1
vote
0answers
20 views

Postgis routes diagram point-to-point

I have a set of centroids to which are related a set of points characterized by linename. The table with the points contains these fields: id ¦ linename ¦ lat ¦ lon¦ I would like to make a diagram ...
4
votes
0answers
58 views

Point sampling along a pole-wrapping coastline with PostGIS

I am working on a task that requires me to get sample points every 1000KM along coastlines, and have run into a problem with Antarctica. From what I can tell, it seems to be an issue with the use of ...
3
votes
1answer
33 views

Finding all segments that makeup a road in OSM

I've spent 2 days trying to figure this out and I'm afraid that it's something that's not possible. If that's the case then I'm thinking the wrong with with respect to OSM data. Let's say I have a ...
0
votes
2answers
105 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) ...
1
vote
2answers
461 views

Function for Selecting Points in a Polygon

I've been banging on this for a few hours, but since I'm relatively new to PostgreSQL and PostGIS, I can't find the solution. I'm trying to create a stored procedure (function) which will return all ...