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

learn more… | top users | synonyms

1
vote
1answer
46 views

PostGIS/QGIS: Update polygon attribute based on the mode value from a cluster of points

I'm updating a PostGIS table of polygons denoting property boundaries with some values that form part of a code for sites scattered across the properties. Neither dataset is 100% accurate so I can't ...
0
votes
0answers
44 views

Postgis poligonize. How to create polygon in postgis from linestring

I have a problem with the poligonization. I have a table that contains the my borderstones. The second table defines the next and previous point. It is important because these are attribute datas. ...
0
votes
1answer
50 views

TypeError: a.geometry.getBounds is not a function in OpenLayers.js (line 611, col 334)

I'm using OpenLayers 2.13 and Postgresql 9.3 for my development activities. I want to load region data from database and load into openlayers. Below result i'm getting from St_astext(geom) in ...
2
votes
2answers
84 views

How to create a PostGIS table with arc support compatible with QGIS?

In postgis database I have two tables - let's say 'polygons' (gid, the_geom,MultiPolygon,srid=2180) and 'lines' (gid, the_geom,MultLineString,srid=2180). I'd like to use "Add circular string tool" ...
2
votes
1answer
63 views

BBox select accuracy

I have an Openlayers 3 application. When using a box to select features from Geoserver WFS layer (request=GetFeature) I get inaccurate results see image below. The layer is served from a PostGIS DB. ...
1
vote
3answers
84 views

Editing vector layers

I wish to edit and remove qgsfeatures in qgsvectorlayer. Vectorlayer contains postgis table. QgsVectorDataProvider::capabilitiesString() returns the folowing string: Add Features, Add Attributes, ...
1
vote
1answer
34 views

Display simple raster file in openlayers

I have raster files (one sample can download from here) just have values for points and in beside i have top-left and bottom-right geo data and pixel size of file. so i want to just simply display ...
4
votes
3answers
159 views

How do I select points within a specified distance of a polygon's border?

I have a table with points and another table with polygons (multipolyons to be more accurate). How do I find the points that fall within a specified distance of the polygon's border? Most of the ...
1
vote
1answer
39 views

postgis - wrong ST_Distance with geography points [closed]

I'm trying to calculate the distance between to geographical points, but the calculated distance is bigger than the real one (from Google Maps). The location column in postgresql is define as ...
2
votes
1answer
295 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 ...
0
votes
1answer
57 views

Generating pivot table in PostgreSQL that ties cities to counties using QGIS (or PostGIS)?

I have a cities shapefile and a counties shapefile. I have the counties shapefile imported to a PostgreSQL table. I haven't transferred my cities to PostgreSQL yet, but the issue I really want to ...
2
votes
2answers
67 views

How to add temporary PostGIS table to canvas?

I'm working with PostGIS database. I would like to create temporary table with geometry and add it as a layer to QGIS. There is no problem with regular tables, but I can't figure out how to add ...
1
vote
1answer
33 views

Sum and groupby several conditions

I have a road network where each link is part of a reference number. I am trying to sum up the length of roads per reference number and status. My nested query fails and just sum the total length of ...
2
votes
0answers
130 views

Compiling Postgis 2.2.0 on Raspian error doesn't install postgis extension

Installed postgresql 9.4 following this tutorial using the method of already compiled pkg. All seems fine with postgres installation. testdb=# SELECT name, setting FROM pg_settings where ...
4
votes
2answers
81 views

Identifying “chains” of adjacent polygons with PostGIS

I have a table of polygons (land parcels in a city) and I am trying to identify "chains" of 5 or more adjacent polygons. For example, if each letter is a polygon and each . is empty space, ...
2
votes
2answers
77 views

What is the SRID for EPSG 102743?

I am trying to create a table in PostGIS for some LiDAR data and I need to set the the_geom column to my data's SRID. My data is in EPSG 102743, but when I try to use 102743 as my SRID as the_geom I ...
1
vote
0answers
45 views

refine nearest_node with radius-distance ( ST_Distance, ST_DWithin )

i am a hobby-IT-person and currently stuck with some simple problem, maybe somebody can help me: This is my working POSTGIS-function, source by underdark: ALTER TABLE distance_graz ADD COLUMN ...
1
vote
1answer
64 views

Join two tables completely on geometry (postgis)

I have two tables with the same street network as geometry (but not a same id). What I want to do is to join both tables with all attributes to one for all geometries which overlap exactly. ...
2
votes
0answers
27 views

Creating lines from lonely nodes in a linestring table to closest point on another linestring table

I want to segmentate a country (denmmark) by using barriers such as larger roads, railroads and the border/ coastline as the delimiting lines of the polygonise function in QGIS. But as most roads and ...
1
vote
2answers
94 views

PostGIS: ST_Within returns “t”/“f” letters instead of “true”/“false” booleans

I have simple query which contains among others: SELECT ST_Within(ST_GeomFromText('POINT(lon lat)', 4326), buildings.geom) AS is_within So I expect the result column is_within to be Boolean value. ...
2
votes
0answers
26 views

Performance of 'extract by mask' tool in PostGIS?

Context: A large raster is clipped to create a bunch of smaller rasters based on a bunch of shapefiles. I've used st_clip() which seems to take forever looping through the different shapefiles, so ...
2
votes
1answer
39 views

PostGIS: Duplicated Rows when Drawing State Boundaries

I have two shapefiles. One is the DMA and another of states. What I'm trying to do is to draw a state boundary on DMAs (which can cross state boundaries). I've asked this question and I recieved an ...
0
votes
0answers
46 views

JSF2Leaf - JSF page parameters to bean

I'm using jsf2leaf framework to draw trajectories between two markers, like example. I need to send two parameters (id of point) to search possible trajectories between both. At the moment the ...
0
votes
2answers
36 views

Viewing result query in PostGIS? [duplicate]

I have some queries which clip rasters from polygon. So how I can see my result query in postgis or How I can check my query true or false ?
1
vote
1answer
27 views

String quoting issues with sql using ST_PointFromText in psycopg2

I've been banging my head against this for a while, and am seeking some insight into what I'm doing wrong. I have the following snippet of code: params = [PlaneRep.hex, PlaneRep.squawk, ...
1
vote
3answers
50 views

How can I draw the results of a PostGIS query?

Reading the solution to PostGIS > Intersect two circles. Each Circle must be built from Long/Lat degrees plus radius got me thinking. How can I graphically display a SQL query? It doesn't need to ...
2
votes
1answer
92 views

How to convert multilinestring and multipolygon to multipoint in postgis?

In postgis I have 2 layers:'lines' (multilinestring, public, gid, geom) and 'polygons' (multipolygon, public, gid, geom). I try to find how to convert them to multipoint (or point). I suspect that ...
1
vote
1answer
74 views

Unable to edit PostGIS DB using QGIS 2.10, works on 2.8

I have data in PostGIS DB which I need to edit with QGIS. I created a project file with QGIS 2.10. I was able to connect and open the PostGIS database, but ran into problems when I tried to edit DB ...
3
votes
2answers
215 views

Is there a way to change ST_asGeoJSON return values?

The function ST_asGeoJSON returns something like: "st_asgeojson": { "type":"MultiLineString", "coordinates":[ [ [-3.13512629299993,39.7174353130001], ...
1
vote
0answers
61 views

clip raster with polygon in postgis

I am newbie in postgis. I have a raster landsat images in table "ras" and a polygon shapefile image in table "shp". Now I want to clip raster with polygon using postgis, but I have a problem The ...
3
votes
2answers
81 views

PostGIS does not find intersection between line and polygon

I have a line and polygon: I would like to programmatically figure out whether they intersect or not. So, I do: select ST_Intersects ( ( select ...
2
votes
1answer
48 views

Bounding box along parallels and meridians

I have a PostGIS table with a column location geography(Point,4326). To select data from a specific region I use location && ST_MakeEnvelope(65,-77,120,-75). This may work well for most ...
0
votes
0answers
38 views

Positioning new point on line with OSM routing?

I have three tables: ways_vertices_pgr (from OSM Routing, contains road vertexes I use for creating routes and among other things their geometry), routes (geometry) and a table which holds the order ...
2
votes
0answers
54 views

Cannot open QGIS form from PostGIS Layer with bigInt datatype for my primary keys?

Using QGIS 2.10.1 Pisa / PostgreSQL 9.4 with PostGIS. In PostgreSQL I have column oid with datatype is bigINT as primary key. These are 16-digit numbers. In QGIS I can read the table as a layer and ...
1
vote
1answer
28 views

counting values in an update statement postgres [closed]

I have a repetitive method I want to execute and I expected underneath script to work. I found out the count() function is not allowed in postgres update statements. What is the most logical and ...
1
vote
1answer
54 views

OpenStreetMaps: what are the !pixel_width! and !pixel_height! in the queries

The Github repository containing the CartoCSS styling for the OpenStreetMaps dataset also defines queries for the different layers (see this file). An example of such a query is SELECT way, ...
2
votes
1answer
113 views

GeoJSON: PolyhedralSurface geometry type not supported

I am trying to make a 3D web application which should be able to render 3D buildings (I will be using Cesium, but that is not that important for now). I basically have a database consisting of the 2D ...
0
votes
0answers
36 views

Receiving -infinity in geoserver wfs GetFeature result

I'm currently using: - Geoserver 2.7.2 - PostgreSQL 9.4.4 - PostGIS 2.1.9 When I submit the following wfs GetFeature request: ...
1
vote
0answers
26 views

PCA on correlation matrix in PostgreSQL

Does anyone know how to perform PCA using PL/pgSQL in a PostgreSQL function, considering correlation matrixes of potentially high order? Maybe a specific library for this problem... Thanks.
2
votes
2answers
59 views

Speeding up PostGIS query

I'm trying to do a spatial join on a PostGIS table that has a bunch of hexes and each hex has an ID. I have a separate table withs points in lats and longs and I want to know which hex each point ...
2
votes
2answers
51 views

PostGIS - Merging linestrings into multilinestrings in a particular order

I have a set of linestrings, which I want to group into a single multilinestring, and in a specific order. However, when I use ST_Collect, it merges them out of order, like this: Geometries as ...
4
votes
1answer
60 views

PostGIS > Intersect two circles. Each Circle must be built from Long/Lat degrees plus radius

I'm trying to figure this out, so I wanted to try asking to the experts. This question is related to PostGIS (from postgresql). What I want is: 1) Based on a longitude and latitude I want project ...
1
vote
1answer
24 views

How to update a DATE field when moving PostGIS geometry in QGIS?

I've been correcting our address point file using various methods to identify points that need to be corrected, with the final step being a manual move the point (or by the Numerical Vertex Edit) to ...
1
vote
1answer
45 views

Applying OSM z-order after osm2pgsql with qgis

I've trying to find a solution to applying the OSM z-order in qgis after using osm2pgsql. Everything is working perfectly, until I add the each layer to the canvas, where the z-order is not being ...
0
votes
0answers
45 views

Fulltext Search with Spatial Search with pagination

We tried to use postgresql+postgis to save our spatial data with points/lines/polygons. Though the postgresql have a built-in full-text search engine, we have to use lucene for some reasons, and ...
1
vote
0answers
45 views

How to get azimuth and altitude from a 3D surface in PostGIS?

I would like to know the azimuth and tilt of a polygon / surface in a PostGIS database. The azimuth should be given e.g. from 0° to 360° degrees. The altitude should be between 0° to 90°. An example ...
2
votes
0answers
27 views

Merge curved polygons with Postgis

is there any way to merge/union curved polygons in Postgis? "SELECT ST_UNION(the_geom) from public.polygons" can be executed, if the type of the_geom is Polygon, but doesn't work with the type ...
1
vote
0answers
49 views

raster2pgsql stops at line 53 at RETURN

I am importing some very large rasters (in the tif format) into Postgres SQL (9.3) using raster2pgsql on the command line. Most of the rasters imported fine, some had to be converted to the img format ...
1
vote
1answer
28 views

PostgreSQL - PostGIS linkup error

I have a database that I viewed in QGIS using PostGIS. I managed to link them up using the correst host, database combination last year. I am now revisiting the work and am unable to link them ...
0
votes
0answers
49 views

TileMill / Mapnik with Postgis datasource

I'm having some problems getting a full features (roads, rivers, buildings, parks, etc) map to show on TileMill. The steps I taken so far: Mounted a PG9.4 with Postgis 2.1 database Downloaded the ...