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

learn more… | top users | synonyms

2
votes
0answers
67 views

Is it possible to create an ellipse around a line in 3D space?

In Postgis 2.1.1, I have a line in 3 dimensional space connecting two antenna points on the earth's surface. Is it possible to create an ellipse around that line? I have a formula to compute the ...
1
vote
1answer
46 views

Copy tables from one server to another in PostgreSQL

I am trying to copy a number of tables from one server to another using PostgreSQL as part of reorganising our data structure. I am pretty new to PostgreSQL so haven't much experience with it. Is ...
2
votes
1answer
46 views

Polygon from line creation problem

I have a problem transforming a linestring into a polygon. The error is: ERROR: lwpoly_from_lwlines: shell must be closed So I checked but firstpoint and endpoint are the same. I tried to use ...
0
votes
2answers
150 views

How do I install PostgreSQL + PostGIS + MapServer + Python-MapScript on Ubuntu 12.04 LTS w/o compiling from source?

This question is similar to the one posted here... How to have PostGIS 2.1 and the Python osgeo library installed together without compiling from source? ...but since I'm new GIS Stack exchange, I ...
1
vote
1answer
41 views

PostGIS - ST_Difference query returns a dissolved result

I am using the ST_Difference to erase multipolygon feature by a mask. However, the query returns a dssolved multipolygon. The query is the following: '''SELECT ST_AsGeoJSON(ST_Collect(geom))::json ...
2
votes
0answers
154 views

How to correctly import GeoJSON in PostGIS? [closed]

I'm trying to migrate GeoJSON data to PostGIS database and I thought that ogr2ogr is the tool: ogr2ogr -f PostgreSQL PG:"host={} user={} port={} dbname={} password={}" test.geojson -nln ogr_test ...
2
votes
1answer
50 views

Problem when trying to style negative values in Geoserver via SLD

I have a PostGIS table that holds (numeric) values from -1 to +1. I would like to style these values in Geoserver so I created an SLD file in QGIS which looks like this: ---snip--- <?xml ...
1
vote
1answer
37 views

Different ST_AZIMUTH results for ST_PROJECT points along the same original bearing

I'm trying to develop some way of determining line of sight (LOS) between two geographical points about 1km apart or less using ST_3DINTERSECTS or something similar. BASIC PROBLEM: Along the way, ...
0
votes
0answers
25 views

Bulk insert geometry in PostGIS inserting geom from an already existing table in database

My goal is to bulk insert original data into a table I created within PostGIS. I want to insert geographical data into this same table as well; this geographical data already exists within my ...
2
votes
1answer
92 views

Installed PostGIS extension not listed for database

I have a PostgreSQL database with the PostGIS extension enabled. I know that this extension is enabled, since I am using PostGIS functions, and I can actually see the PostGIS functions. However, ...
2
votes
1answer
46 views

Find nearest distinct features to a point

I am trying to select a single distinct features closest to an XY point in PostGIS. So I can find a single record for each distinct code by using: Select Distinct ON (code) * FROM table; Which ...
2
votes
0answers
43 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
45 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
63 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
35 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
70 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
59 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
179 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
78 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 ...
2
votes
1answer
111 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
62 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
73 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
19 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
22 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
36 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
33 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
114 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
43 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
54 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
65 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
89 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
56 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
54 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
19 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
49 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
61 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
48 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
90 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
21 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
36 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
34 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
72 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
170 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
38 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
32 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
52 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
69 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 ...