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

learn more… | top users | synonyms

1
vote
1answer
54 views

Saving Edits on a WFS layer by using OpenLayers

So with an app that I've produced by taking this into account, I've managed to create a web map with editing function using a WFS layer from Geoserver. Problem is that, unlike in the working example, ...
1
vote
0answers
50 views

Counting nodata and data pixels using PostGIS

I'm using PostgreSQL 9.2.4 and PostGIS 2.0.3. I have some raster layer and I'm trying to get the count of all pixels (including nodata), cliped by polygon. Raster was imported by raster2sql: ...
3
votes
2answers
121 views

Measuring length through a polyline in QGIS.

I'm working on a fiber optic project. I want to measure the length through a fiber optic cable (polyline) from a point. Does anyone have an idea to help me? For example, I'm at the point 082 CTO and ...
0
votes
0answers
33 views

Postgis Database: How can I get all gps points between specified timestamps and specified region?

I am totally new to DBMS. I have traces of vehicles in different csv files for each user. Format: name,timestamp,latitude,longitude. 1) How to implement RANGE Query which asks for all the gps points ...
0
votes
1answer
25 views

PostGIS query with external bounding box

I am editing a shapefile as wide as an island. The data are stored in a Postgres/PostGIS database. I want to display only features from my defined bounding box. The bounding box itself is a custom ...
1
vote
1answer
74 views

How to add more vertexes to a LineString

I created a map of LineStrings using QGis and then it was exported to a Postgis DB, then I used the query below in order to create the vertexes in the map so it could be used with the functions of ...
1
vote
1answer
45 views

Why missing address IDs in postgresql/postgis query results?

I have two tables "ad" and "st" in my postgres DB. Table ad has 87 rows while st has 16,060 rows. Following code works perfectly to select st.geom (streets' geometry) within 50 meter radius with ...
1
vote
1answer
43 views

Correctly querying a raster mask only

I have a rasterA (whole Scandinavia, with values from 0-255) and a rasterB (in blue, a small part of south of Norway, entirely inside rasterA). I want to query the pixels of rasterA which are inside ...
4
votes
1answer
181 views

PostGIS Out of db VRT containing JPEG2000 GDAL 2.1 OpenJPEG

Build GDAL 2.1 with OpenJPEG Build PostGIS with above GDAL build Created VRT file with SENTINEL2 Driver / JP2 files. gdal_translate SENTINEL2_L2A:...
1
vote
1answer
47 views

Weird behavior with st_clusterwithin

I'm not sure I'm doing this right, I've two locations, one a point and one a point within an area. I'm running them through st_clusterwithin, and they both create 2 individual cluster groups (which is ...
1
vote
0answers
61 views

Mapnik3 + python3 + Postgis

I've installed mapnik3, python bindings, and postgis (and imported a pbf file into postgis), and can't seem to even make it generate a simple map as a png file. Specifically - where can I find ...
0
votes
0answers
23 views

Inserting markers coordinates into postgis table with one row per marker via php

I have a leaflet map with some markers (coming from a .gpx) and I’m trying to send them in a postgis table with one row per marker. For the moment it works but only for the first marker. Here is how ...
0
votes
1answer
47 views

How to create a line into a table in Postgis?

I need to draw a line and create a new entry on an existing table in Postgis. Say I have a table called myTable and two points with coordinates 528115,181037 and 528115,181037 using the EPSG:27700 (...
3
votes
2answers
67 views

How do partition tables improve query performance in PostGIS? [closed]

I have static road, country and state datasets in my PostGIS database. Road networks are partitioned by their containing country. Countries, States and other areas reside in their own table and are ...
1
vote
0answers
30 views

Interative raster with PostGIS

I'm searching some solution to show raster layers from PostGIS on a Web Page. I need a solution to build a interactive map showing the values of my raster data when the user to click on pixel of the ...
0
votes
0answers
22 views

Database modeling for big data (big set of points X big sets of possible values for each points)?

I'm building a PostgreSQL database with the intent to host modelisation results for different projects. Each project has a set of receptors points (~5000-10000 receptors) and have many results sets (...
0
votes
2answers
52 views

How to solve Geoserver editing in QGIS returning read only error?

After creating a table in Postgis, making it available in Geoserver and then creating the necessary stores and layers, I loaded the resulting WFS file in QGIS. When trying to populate the features ...
0
votes
1answer
30 views

Delete tags from planet.osm with osm2pgsql and minimize size of database

I want to import into PostGIS the whole planet but I am interested for certain tags. Specifically I am not interested in nodes, ways and areas which are related with the land. Below is a small part ...
0
votes
0answers
13 views

Alignment in ST_Intersection with PostGIS raster

Trying to intersect two rasters, but they don't have the same scale. I have to do everything in one query. The query below gets the following error: The two rasters provided do not have the same ...
1
vote
1answer
32 views

Filter geoserver layers based on postgis geometry

I am wondering how, and if it is possible, to filter a geoserver's layer (from a large shapefile) on a specific geometry coming from a postgis table. I have a huge shapefile for a country. I'd like ...
0
votes
1answer
24 views

How can I use ST_Intersection with two rasters?

I need to query all values in raster A which intersect with raster B. Found this, but it's not accurate, and I'm getting ERROR: column reference "rast" is ambiguous. WITH first AS ( SELECT id, (...
0
votes
0answers
49 views

Is it possible to use pgsql2shp utility in PL/pgsql environment?

I intend to use PL/pgSQL to generate calculation points on streets with respect to address locations. I am aware that using pgsql2shp utility, a shapefile can be generate using postgis query. I was ...
1
vote
2answers
99 views

Creating weighted lines on map in CartoDB

I am trying to illustrate global trade flows within CartoDb. Flows are visualized by a line connecting two lat/long points on a map. The size of the flow would be represented by the width of the line. ...
2
votes
1answer
41 views

To check if a geometry is contained in a geomtery collection in postgis

How can I check if a geometry is contained in a geometry collection ? Specifically , I am using ST_ClusterWithin in PostGIS to get a cluster which returns each cluster as a geometry collection. Now I ...
2
votes
2answers
44 views

postgis How can I obtain directional buffer?

I have a geometry (polygon) which I want to extend with a buffer while testing on it in a where clause. The problem is that I would like the buffer to be only applied according to one or more ...
3
votes
1answer
50 views

Selecting polygons not covered by any other polygon (or BBox) in table in PostGIS?

In a table where many of the geometries might be completely covered by other ones, is there a query that selects only geometries that are not covered by any other geometry in the same table (excluding ...
3
votes
2answers
57 views

How to optimize QgsFeatureRequest with filter expression

I have a point PostGIS layer (my_layer) which has more than 66000 features. I am getting the features I want but it takes too long. My code is: resultList = [] req = QgsFeatureRequest()....
0
votes
0answers
50 views

ST_Distance between ST_Centroid and ST_Y

I'm trying to make a ST_Distance between a ST_Centroid and a ST_Y... But ST_Centroid is a geometry and ST_Y is a float. How can I make this? My query: SELECT ST_Distance(ST_Centroid(ST_Collect(...
2
votes
1answer
59 views

ST_LocateAlong interpolation: difference between PostGIS and Spatialite

In a previous question, I discovered that ST_LocateAlong along a LineStringM is not implemented the same way in Spatialite than in PostGIS. While PostGIS interpolates between measures, this is not ...
3
votes
1answer
72 views

Dynamic Linear Referencing of events in QGIS from Excel or CSV using virtual layer

I have a PostGIS table with a geometry type LINESTRING M to represent routes. Here is the table specification: CREATE TABLE routes ( fid serial PRIMARY KEY, r_name text NOT NULL, geom geometry(...
1
vote
1answer
68 views

In Postgres how to create columns with geometry?

I have point data stored in the postgis server and I need to create a new table with their geometry values. How can I extract their coordinates and translate them into a table. Something like: ...
0
votes
1answer
117 views

Parse and load GPX into database? [closed]

Having a PostgreSQL database, with the following tables: CREATE EXTENSION postgis; DROP TABLE IF EXISTS trips CASCADE; DROP TABLE IF EXISTS locations CASCADE; CREATE TABLE IF NOT EXISTS trips ( ...
2
votes
2answers
134 views

How to convert .csv with WKB to shapefile (.shp) using open source solutions?

I have a .csv file with hundreds of rows pulled out via PostGIS. The geospatial information is in "the_geom" field which seems to be in WKB-format. How can I convert this to shapefile using simple ...
1
vote
1answer
111 views

How to add X/Y coordinates and count of overlapping points in a postgresql table?

How to add to my postgres/postgis table the following columns X coordinate | Y coordinate | count (number of points in same location) from an existing table populated with geometries type POINT
0
votes
1answer
44 views

Writeogr to PostgreSQL/PostGIS database with R

I'm producing some Spatialpolygondataframes with R that I would like to upload to my PostGIS Database. I've found out that the way to do this is via the writeOGR() function using the PostgreSQL driver....
0
votes
0answers
34 views

Look Up table from (Latitude,Longitude) to country, city etc. boundaries (Bounding Box)

I'm looking for "Standard" assume file (?) containing best practice used simple "approximately squared" boundaries of countries, major cities etc. The use case is getting (Lat,Lon) and perform look ...
1
vote
1answer
47 views

What needs to be installed, to use ST_ClusterDBSCAN?

I have working PostgreSQL 9.5.3 with PostGIS. I have sucessfully created table and column with geom data type. I am able to execute geometry queries, namley ST_Transform without problem. # SELECT ...
0
votes
1answer
30 views

connecting Postgis, Python, Openlayers

I'm in the process of learning Geo-mapping and I'm curious to create a web-application Python-Django, Openlayers 3 and PostGIS. I need to know whether Django can be combined with PostGis and ...
1
vote
2answers
87 views

How to split a large point vector layer in QGIS?

I need to split my shapefiles into much smaller pieces so that I can upload them onto the Postgis server. Shapefiles have DBF files with 14 Go (1,000,000 rows) and I need them to be under 2 Go. I've ...
3
votes
1answer
86 views

PostGIS crosstab on multiple point tables

I have several point tabels, lets say 3. Tables are alike with two columns: a integer value and a geometry like: table sand1 (value int, geom geometry) table sand2 (value int, geom geometry) table ...
2
votes
1answer
120 views

How to use shp2pgsql to import a very large shapefile into PostGIS?

I need to import very large datasets into the Postgis server so I need to use the -D option in the prompt. Problem is that I'm getting an error no matter what I do. The command lines I'm using are: ...
0
votes
0answers
32 views

run shp2pgsql command in c# application

I worked for a month on this command but in vain ; really if someone already tried to help me find the error , because when I load the application displays the message to me as the shapefile was ...
3
votes
1answer
31 views

Converting PostGIS point to text causing loss of data?

I have a road network and want to test connectivity between the features. I am having trouble with two specific features, the rest of the dataset is functioning just fine. When I get those 2 links' ...
1
vote
1answer
48 views

PostGIS raster to UTFGrid

I am trying to create a UTFgrid JSON with a Raster in PostGIS. The goal is to provide weather data for web maps. I found some libraries: https://github.com/Ecotrust/create-utfgrids https://github....
1
vote
2answers
59 views

Backup GIS data on postgis database from pgadmin3

I am using a postgis database with qgis and managing it with pgadmin3 I have already investigated the backup/restore options within pgadmin 3 and done one test run on one database I am wondering if ...
1
vote
1answer
65 views

QGIS 2.14.3 export PostGIS layer to dxf issue

I am trying to export a PostGIS layer to dxf in QGIS (2.14.3) via Project>DXF-Export using the following settings (German GUI): When I open the resulting dxf in DWG TrueView 2016 I see nothing, but ...
1
vote
1answer
67 views

How can I change start and end point of a linestring?

I have a linestring from a pgRouting query. The start point and/or end poit of this line does not connect exactly the points I've clicked on the road and give me all the road segment of that edge (...
4
votes
2answers
91 views

PostGIS treating unique geometries as equal

I have two different geometries (albeit very closeby) that Postgres is treating as equal. db=> select '0101000020E6100000C5BCD8C5FEF45DC0AFE29EF87B584740'::geometry = '...
5
votes
3answers
63 views

Different values while calculating distance

I'm developing a project using LeafleatJS and PostGIS. Currently I'm getting trouble while calculating distance between two coordinates. For example: Point 1 - lat: -12.99835864475412, lng: -38....
1
vote
1answer
58 views

Creating shapes/lines from geo coordinates in postgis

Following the suggestion from this topic I'm posting my question here. I have a table in postgres/postgis with geo data and I want to show them on map via qgis. Here is the table: city | street ...