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

learn more… | top users | synonyms

1
vote
0answers
27 views

Is the Azimuth on the equator equal to the one not on the equator?

I am trying to fully understand the concept of Azimuth and I am encountering some inconsistencies (or maybe it is my error). I show you some examples that do not match, hoping somebody can explain me ...
0
votes
0answers
29 views

How to calculate the Azimuth between two points in PostGIS?

I have a GIS API based on OpenLayers. I have been trying to implement Azimuth calculation in JavaScript and I needed some way to calculate the Azimuth in order to perform tests. I started using ...
0
votes
1answer
10 views

Road displays up to node, not up to starting point and ending point

SELECT id FROM table ORDER BY st_distance(the_geom, st_setsrid(st_makepoint($slng,$slat), 4326)) limit 1 ; get source and similar for target ; and then apply in dijkstra algo SELECT pgr_a('SELECT id ...
1
vote
0answers
15 views

How can I associate a consistent polygon area with a set of attributes using a topology?

Consider the following topology. SELECT CreateTopology('topotestschema', 0, 0.01); CREATE TABLE topotest (id SERIAL PRIMARY KEY, data TEXT); SELECT AddTopoGeometryColumn('topotestschema', 'public', ...
0
votes
0answers
9 views

Working with different source WMS data

I have a geoserver and WMS services on it. For example my water valve layer is point data and published from geoserver. (I am using postgis to saving data.) An external WMS service publishes polygon ...
2
votes
0answers
22 views

Determine PostGIS geography polygon orientation

How can you determine the orientation of a PostGIS geography polygon? I'm looking/hoping for a function that would tell me which side is the interior (left or right) as you traverse the vertices of ...
1
vote
0answers
17 views

Query PostGIS database without creating primary key [on hold]

I'm trying to query PostGIS database from QGIS DB Manager: select row_number() OVER(ORDER BY idx DESC) as id, p.*, * from table_1 join table_2 as p on "name" = "name" where row_number() OVER(ORDER ...
3
votes
0answers
30 views

PostGIS - Interpolate point between contours

Using PostGIS, what is the best method to interpolate the z value for points (the orange dot in the image below) located between each contour layer (blue lines and red lines in the image below)? So ...
1
vote
0answers
33 views

Join/append multiple, identical polygon layers into a single layer whilst retaining all attributes?

I have run some analysis (zonalstats) on different raster layers using the same analysis polygons. I want to concatenate all these different layers together, i.e. retain a single polygon and have a ...
2
votes
1answer
36 views

<#> doesn't give a useful distance

I'm new to postgresql/postgis and trying to measure a distance. So st_distance() may be the most accurate, it's the slowest too (as I've read). I read that one can use geometric (instead of ...
3
votes
2answers
49 views

Buffer multiple roads to find points within and compare?

What I am trying to do is buffer a main st and a side street and get all of the points that intersect that buffer, however they need to be mutually exclusive. In the example below, my results would ...
3
votes
1answer
42 views

Find the closest line vertex from the linestring using PostGIS

How to find the closest line vertex from a linestring? ST_ClosestPoint will give a point which is not from the linestring.
1
vote
0answers
21 views

Postgis / QGIS Snap Point to Line

I'm trying to snap points to lines in postgis for use in QGIS, but cannot get it to work. I have one line in my line table (although it was created by merging multiple lines together) and about 600 ...
1
vote
0answers
34 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 ...
1
vote
1answer
12 views

postgis - managing single dataset, multiple coordinate systems

I am setting up a forest inventory database that aims to store information about forest plot data from various countries. The current project is in Mozambique, others are in Laos, etc. Each project ...
1
vote
1answer
41 views

Is there a PostGIS function to get a tangent and normal line?

I'm looking for a function that will return a tangent (and normal) for a LINESTRING in PostGIS. I think this is the 3rd time I've come across the need for this function and everytime, I end porting ...
1
vote
2answers
50 views

select intersection of 2 geometries, polygon and polyline

I'm searching how to have a result of 2 geometries (villages and wetland) which don't intersect. When I write: select distinct v.name from villages v , wetland w where ST_intersects(w.geom,v.geom) ...
3
votes
1answer
42 views

How to model a geodesic grid in PostGIS?

Abstract I've decided to use PostGIS for a hobby game project. It requires a lot of units allocated on the surface of a planet. I'd like to model not only the units (simple points), but also their ...
0
votes
1answer
34 views

Conflicts while installing postgresql9.3-postgis2.1,QGIS and gdal-bin

I want to use postgresql9.3-postgis2.1 and gdal-bin parallel . I have refer instruction here for installing postgresql-9.3 on ubuntu 12.04. I have install qgis from here While installing gdal-bin it ...
0
votes
1answer
16 views

Trouble installing PostGIS PlugIn for OpenJump

I’m trying to install PostGISPlugin version 1.52 in OpenJUMP 1.7.1 release 4004. I moved the JAR file into my installation’s lib/ext directory, but I’m not sure how to access the plugin-specific UI ...
2
votes
1answer
27 views

SDO_Inside equivalent in PostGIS for 3D objects

I am looking for a solution for querying a point whether it is located inside a 3D object or not. If the point is located on the surface of 3D, I could use ST_3DIntersects or ST_3DIntersection. But, ...
0
votes
1answer
14 views

Postgis make error on MacOS

I could compile it with the following command on Macbook mavericks. ./configure --with-sfcgal=/usr/local/Cellar/sfcgal/1.0.4/bin Then, I receive following results along with lists: PostGIS is ...
0
votes
0answers
32 views

Connect to PostgreSQL from ArcMap 10.2 failed [duplicate]

I have a database server PostgreSQL and Postgis. I want to connect to database from ArcMap 10.2 , I tried Add Database Connection from arcmap menü. I typed my connection informations and clicked ...
1
vote
3answers
47 views

How can I insert a bounding box or polygon in a PostGIS geometry field?

I have a field in my table called 'geometry' that was created thus: CREATE TABLE "public"."sites" ( "id" int8 DEFAULT nextval('sites_id_seq' :: regclass) NOT NULL, #... A few MORE fields ...
0
votes
2answers
98 views

Import shapefiles on my postgis table using R

Using R, I would like to import shapefiles that are in a directory on a geometric table i have on postgresql / postgis. What is the instruction that allows me to do it? EDIT: here is my code to ...
1
vote
1answer
27 views

Merge polygon based on other line shape file PostGIS

I have a polygon shape file and a line shape file. I would like to merge two polygons which shares the same border along with line shape. Finally the line should be removed in polygon shape file. In ...
1
vote
0answers
24 views

Postgis Raster Unions Color Issues

Can someone explain to me what I am doing wrong here as I think I do not properly understand postgis raster bands. I have a set of geometries that I want to merge with a raster and created a raster ...
2
votes
1answer
43 views

Spatial joining syntax

A standard PostGIS point-in-polygon query might look like this. (example tutorial) SELECT p.*,b.polyname FROM points p, shapes s WHERE ST_Within(p.the_geom,s.the_geom) Imagine this was not a ...
1
vote
1answer
37 views

Is MongoDB more suitable than PostGIS as backend for geo-enabled Django website?

I am trying to select a backend for a geo enabled website written in Django. Is MongoDB an easy possibility or stick with PostGIS? What are the key considerations to choose one or the other if ...
2
votes
0answers
27 views

Use of postgis with hibernate

We have an existing postgis database. Our application is developed in Java, but queries database through a jni dll, which appears to be not very effective for our purpose. I've managed to migrate to ...
3
votes
1answer
63 views

Using OpenStreetMap for simulation of commuter routes

I'm seeking some advice on how to build a simulation based on OpenStreetMap Data for my masterthesis. My knowledge of spatial data is very limited, since I come from another field of science, namely ...
2
votes
2answers
59 views

Problem with running PostgreSQL 9.3 after installing pgRouting

I have PostgreSQL 9.3 installed on the server. It worked just fine. I also had a webservice which connected to a database. That also worked like a charm. Later, I decided to install and use pgRouting. ...
5
votes
2answers
50 views

Working with address data extracted from *.osm

My goal is get all the addresses from a certain country, ideally - from all countries, but for now - only from one. I downloaded an *.osm file from here http://download.geofabrik.de/ for a certain ...
2
votes
1answer
32 views

ST_Within for TIN or 3D objct in PostGIS

I would like to query if a point is located in the TIN object. My TIN object is closed (convex hull) object (i.e. surface of a round object). I tried to use ST_Within, but the error message returns ...
3
votes
1answer
29 views

PostGIS ST_ConvexHull for cube corners not as expected

I'm new to PostGIS and am wondering whether ST_ConvexHull will be of use in a particular work problem. Trying out some simple cases to make sure I understand what it's doing, I didn't expect this: ...
1
vote
0answers
18 views

function ST_Line_Interpolate_Point with multilinestring

Is there a function like ST_Line_Interpolate_Point but using a multilinestring?
3
votes
2answers
91 views

Importing .shp to postgreSQL

I want to import a shp file to postgreSQL. First I create sql file and then run PostgreSQL. To create sql file, I run this command in windows cmd: shp2pgsql -s 4326 worldCountries.shp worldcountries ...
2
votes
1answer
44 views

How to calculate the shortest distance for multiple source and targets using PgRouting?

I have a table with points and a road network which includes driveways (where you enter the highway). I want to find the point which is closest to a driveway. So I was thinking I can calculate the ...
3
votes
1answer
49 views

Moving SpatiaLite Table into PostgreSQL using ogr2ogr?

How can I move a Spatialite table from a Spatialite db to a PostgreSQL db using ogr2ogr?
2
votes
0answers
46 views

Rotation by attribute in Geoserver SLD style

I have a table with field calculated by function: NEW."rotationAngle" := degrees( ST_Azimuth( ST_StartPoint(NEW.the_geom) ...
2
votes
1answer
58 views

nearest facility with pgrouting

I have a postgres table of students with lat, lon and geom, , and a table of schools with the same, and a table of roads that has been converted to nodes. I'm trying to find the driving distance to ...
3
votes
1answer
32 views

How to quickly extend PostGIS's R-Tree implementation?

I am working on a problem where along with data points location, I also have information about the connectivity between points.(Think a graph of points, where an edge denotes some relationship) My ...
1
vote
1answer
44 views

Postgres/PostGIS: Dissolve multiple fields with COUNT (Point shape)

I have loaded point .shp feature classes into Postgres 9.3 db, and enabled postgis,plpgsql,postgis_topology extensions. I'm looking to dissolve multiple fields within a single table 'TABLE1' and add ...
2
votes
1answer
40 views

Delete duplicate polygon nodes with PostGIS

I'm trying to delete duplicate nodes from a shapefile with QGIS, but after running the tool to delete it, nothing happens and shows the same errors. I thought that maybe importing to postgis could be ...
7
votes
1answer
180 views

How do I calculate Manhattan distance with PostGIS?

I am using the ST_Distance function to calculate the distance between two geometries (a train station and a building) Since I know that all buildings and all train stations are in Chicago, which has ...
1
vote
1answer
18 views

Error inserting GeoJSON in PostGIS

I know there is a similar question but I am getting a different error and none of those answers have helped. I am trying the following query (the GeoJSON itself is from the PostGIS website. INSERT ...
2
votes
1answer
45 views

How to find a nearest line to a point

I have a table with many points that need to be associated with street segments to calculate an average value. should I do a relationship for all points to a street segment that is closest. I have ...
2
votes
0answers
32 views

How to get the nearest points from pgrouting linestring result?

I'm trying to get the points or landmarks near from the result of pgrouting linestring( the shortest path ). I'm using OSM map entities and working with planet_osm_point. Here's my codes. SELECT ...
1
vote
1answer
30 views

Adding SRID 3857 to spatial_ref_sys

My application is throwing the following error: DatabaseError: GetProj4StringSPI: Cannot find SRID (3857) in spatial_ref_sys I'm guessing (as stated above) that I need to add the SRID 3857 to the ...
2
votes
0answers
45 views

Weird-looking France after OSM import with osm2pgsql

After importing france-latest.osm from Geofabrik, using osm2pgsql, it seems that the polygon attributed to Metropolitan France (osm_id = 1403916) is a bit odd: I'm far to be a geography expert, but ...