Tagged Questions

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

learn more… | top users | synonyms

2
votes
0answers
53 views

PostGIS “Overlay” Style Union, not “Dissolve” Style

I'm trying to use PostGIS to do a 'union' of polygons. When I Googled "PostGIS Union", I found the ST_Union function, which performs what I would call a 'dissolve,' not a Union. What I actually want ...
0
votes
0answers
21 views

PostGIS commands in GRASS

How does the geometry get referenced in GRASS when using a PostGIS command like st_within? e.g: echo "UPDATE file SET within=(select file2.name from file, file2 where st_within(file.geom,file2.geom) ...
1
vote
1answer
50 views

Postgres Performance with Radius Searches

Im porting an application from mysql to postgres, and have several tables with 500k+ rows in each of geo points (lat, lon). In mysql i used a bounding box query with haversine to select rows within a ...
0
votes
1answer
72 views

Cannot load postgis layer from sql string in pyqgis

I'm trying to load a layer using the following code in qgis python console: sql = "(select the_geom, ID from mytable)" uri = QgsDataSourceURI() ...
0
votes
0answers
42 views

insert row into postgis query table in QGIS

I find I am using QGIS (2.4) more and more as a client for PostGIS database tables with geometry, but also for tables without geometry, partly because it's good just to use the one application and ...
1
vote
2answers
91 views

Split lines into non-overlapping subsets based on points

Given a table with line geometry, and one or more points that are snapped to this line in a separate table, I would like to split each line with one or more intersecting points at each of the ...
2
votes
1answer
80 views

PROJ4 / PostGIS transformations between WGS84 and NAD83 transformations in Alaska

I'm trying to implement the recommended WGS84 - NAD83 transformation for Alaska using PostGIS. This post: Geographic Transformations in Alaska Between NAD83 and WGS84 indicates the proper ...
1
vote
3answers
358 views

postgresql export database with command or pgAdmin III

I want to export my postgresql db with pgadmin. I search all of its GUI, I also searched the web and I don't find some sueful information. I know how to import the db into postgresql: create a db with ...
3
votes
2answers
79 views

Which one of these azimuth values is the right one? And why?

First of all, let's make clear that I want the Azimuth on the surface of the Earth, i.e. the angle between two locations, for example New York and Moscow. I am testing some azimuth calculations with ...
3
votes
1answer
212 views

SQL query to have a complete geojson feature from PostGIS

I would like to get a geojson feature with properties from PostGIS. I have found an example to have a feature collection but I can't make it works for just a feature. so far I tryed to modify the ...
1
vote
1answer
64 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
1answer
79 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
20 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
23 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
12 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
42 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
36 views

Query PostGIS database without creating primary key [closed]

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 ...
5
votes
2answers
125 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
45 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 ...
3
votes
1answer
58 views

<#> doesn't give a useful distance [duplicate]

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
70 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
112 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
80 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
63 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
20 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
59 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
67 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
57 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
2answers
106 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
24 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
40 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
17 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
35 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
86 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
3answers
200 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
46 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
36 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
59 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
86 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
41 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
97 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
290 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
78 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
59 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
38 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
1answer
38 views

function ST_Line_Interpolate_Point with multilinestring

Is there a function like ST_Line_Interpolate_Point but using a multilinestring?
3
votes
2answers
388 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
102 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
85 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
98 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) ...