Questions tagged [postgis]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
31 views

Does the projection of a PostGIS table affect the rendering speed in QGIS

I am interested to know whether changing the projection of a PostGIS table will affect the rending speed when viewing it in QGIS. I have two layers coming from QGIS which are exactly the same and ...
5
votes
4answers
277 views

Finding truly intersected polygons

Intro Short version: My goal is to find geometries intersected by a target polygon. To find overlaps - the most straightforward choice is to use ST_Overlaps or ST_Intersects. But this method will ...
1
vote
1answer
124 views

Unable to add PostGIS to database due to undefined symbol: proj_get_type

I am setting up a PostgreSQL10 server with pgRouting on Fedora 30 VM. by running these command as root: dnf install https://download.postgresql.org/pub/repos/yum/reporpms/F-30-x86_64/pgdg-fedora-repo-...
1
vote
2answers
44 views

PgRouting coverage area with node restrictions

I have a water network in which there exist valves at nodes between two edges (pipes). When the valve is open water can flow, if not, it can't. How can I calculate the catchment area from a start ...
0
votes
1answer
258 views

How best to divide line features into equal parts and create continuous buffer zones for them using Postgres/PostGIS and QGIS [closed]

Having familiarized with an similar question specified on the link Dividing a buffer into segments based on path and distance, the author asked an analogous question whether it is possible to solve ...
1
vote
0answers
14 views

st_3dshortestline equivalent in Python 3

I have two geopandas Dataframes with 3D geometry. I could transform it in any other data type it could be more easy to use. I would like to know if there is something similar to the st_3dshortestline ...
0
votes
0answers
22 views

PostGIS with GeoJSON: `geometry` v. `geography`

Does the GeoJSON spec imply or strongly suggest that PostGIS geometry type should be used over geography? Looking at section 3.1.1 I am seeing that In other words, every point on a line that ...
5
votes
0answers
411 views

How to add geometries using EntityFramework 6, EF designer from database, npgsql and postgis?

I have a postgre database with postgis geometries that i would like to access using Entity framework and npgsql. I tried to go for the "EF designer from database" , but when doing so i only get the ...
0
votes
1answer
47 views

ST_Intersect is giving wrong polygon back

I imported the french IRIS dataset by shp2pgsql. Added LAMB93 to the PostGIS spatial_ref_sys. shp2pgsql -W latin1 -I -s 97527:4326 CONTOURS-IRIS.shp iris20 | psql -d iris20 -v ON_ERROR_STOP=1 So ...
2
votes
1answer
76 views

How to increase a PostGIS query efficiency when querying OSM information

I have this SQL query to get roads from my PostGIS server. WITH boxed_roads AS (SELECT * FROM "planet_osm_line" WHERE ST_Within(way, ST_MakeEnvelope(xmax ,xmin, ymax, ymin, 4326)) ) SELECT ...
1
vote
0answers
25 views

Tenant isolation in SaaS product based on PostGIS - do the same concepts as PostgreSQL apply?

We're working on two different GIS apps and we're a bit torn around how to provide a level of tenant data isolation on our GIS systems. System A would need to have strong tenant data isolation where ...
5
votes
1answer
50 views

Calculate volume of MultiPolygon Z using Postgis

I am trying to calculate the volume of a multipolygon z using Postgis. SELECT ST_Volume(geom) from grb; And I get this error: MultiPolygon is invalid : Polygon 0 is invalid: points don't lie in ...
4
votes
1answer
51 views

Performing Esri NAD27 to WGS84 datum transformations with ST_Transform in POSTGIS

I am trying to align with some data points that have been projected in Esri from NAD27 State Plane feet (SRID=32026) to Lon/Lat using the "NAD_1927_To_WGS_1984_6" datum transformation using ...
1
vote
1answer
36 views

Layer is being add to 2 groups instead of 1

I'm trying to create 3 group layers, depending on parameters of two lists, but reg_imobiliarios layer is added to auxiliar and referencia groups. In short, all the layers are in the correct group, ...
0
votes
1answer
412 views

Edit a view of a PostGIS table in QGIS

I have a simple layer in PostGIS created as follows: CREATE TABLE layer ( id serial PRIMARY KEY, geom geometry(LINESTRING, 31370), ... ) To avoid duplicate information, I created a view ...
3
votes
3answers
86 views

Find islands using PostGIS

I'm trying to find islands (type not water, completely surrounded by water) in a polygon table. The polygons are not overlapping. Data: CREATE TABLE islands ( ID serial PRIMARY KEY, type ...
1
vote
1answer
37 views

Calculating list of existing polygons with distances from newly created QGIS/PostGIS

I have two polygon tables (SRID=4326) in postgres: t_areas and t_sites. Once I insert through QGIS 3,8 a new area in t_areas I'd like PostGIS (by a trigger) to list all sites within a certain km range ...
6
votes
6answers
444 views

Determine if a polygon is not enclosed by other polygons

Does anyone know of a routine/function or transformer that would identify if a polygon is not fully enclosed/surrounded by other polygons? The polygons have no gaps or slivers between them so if a ...
3
votes
1answer
151 views

Loading vector layers from database/ schema using login username and password in QGIS?

I have a QGIS setup with a PostgreSQL / PostGIS database on a server and multiple clients. I have created schemas in the database for each user. With a username password combination, each user is ...
2
votes
1answer
40 views

PostGIS: Extract intersected areas with their related column values

I have inserted a MultiPolygon table in PostGIS with the following columns: id, e_id , p_id, com, geom Assume that I have 4 polygons with overlapped areas with the following values: id com geom 1 ...
2
votes
1answer
24 views

Calculating Geoid Height (e.g. EGM2008) for Lat/Lon in PostGIS

Is there an existing method or best practice for calculating Geoid height for a lat/lon location in PostGIS? I don't believe there is an "ST_" function. I know that PostGIS makes use of ...
5
votes
1answer
260 views

Are there any QGIS tools or plugins that can display photos stored in a database?

A colleague's team has been using the eVis plugin in QGIS to store research photos. eVis relies upon a filepath or URL stored in the data source (shapefile, Spatialite db, etc.). They are using a ...
2
votes
1answer
80 views

Invalid Geometry - Which column can I change to geometry?

I have a csv file with thes two columns (amongst others): localisation and geo_point_2d. Here is the content of one cell of localisation : {"type": "MultiPolygon", "coordinates": [[[[-53....
4
votes
1answer
68 views

What is being filtered?

I have a Postgres/postgis table of polygons. When added to QGIS the total feature Count is 64671 in layer tree and attribute table. But the attribute table also says Filtered: 43573. I have not ...
1
vote
1answer
43 views

Convert a SQL Server Geometry into PostGIS spatial data with Python and shapely

I'm trying to migrate spatial data from a SQL Server database to a PostGIS database with Python. I need this to be automated since its not just one table, but a lot tables in a lot of databases. I am ...
0
votes
0answers
20 views

pgr_dijkstra ERROR: invalid memory alloc request size 1080000000

I am using pgr_version 2.6.3 I tried googling, most of the posts suggest the data is corrupted. So I tried pg_dump and select row by row to try finding the corrupted row, but did not encounter any ...
1
vote
0answers
51 views

QGIS cannot see PostGIS empty tables

QGIS didn't load empty tables with geometry columns from Postgresql, showing this error message: "invalid PostgreSQL layer", but when these tables have data it shows it without any problem. Is it ...
5
votes
5answers
2k views

How to easily remove loose/isolated edges from pgRouting network?

I wondered if there's an easy way to 'clean up' a pgRouting network by removing those edges that do not connect with the global network. Otherwise you risk to end up with cost values of -1, meaning ...
-1
votes
0answers
24 views

I got this error : elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison [closed]

rint(sf.columns) se=float(numb1.get()) cur.execute("select distinct nassereddine_carte_gouv.c_gouv from nassereddine_carte_gouv,disshp where nassereddine_carte_gouv.c_gouv=disshp.id and Shape_leng &...
27
votes
3answers
28k views

Performing bounding box query in PostGIS?

I have a PostgreSQL table, with almost 2 million rows, with a long-lat coordinates field in the form POINT(-73.4938 33.2405). Supposing there's a geospatial index on that field, what's the most ...
6
votes
2answers
141 views

QGIS and PostGIS, dimensions problems

I have a point-layer i Postgis v12 which is ST_point, ST_NDims = 3. When creating a new point i QGIS and then tries to save it, I get an error: Column has Z dimension but geometry does not When ...
0
votes
1answer
50 views

Verify PostGIS connection, username and password

I wrote the code below, but I need that the PostGIS connection to be verified, to be sure that the username and password are right. I tried this: How to access user credentials in database connection? ...
7
votes
3answers
384 views

Looping through table to get single intersection from N>2 geometries using PostGIS?

It's really clear how to apply ST_Intersection when you have only two geometries. But I am struggling with the situation where you have N>2 shapes and you want to compute a single one that represents ...
0
votes
1answer
41 views

How to check “simplification sensibility” of a geometry?

It is expected that a "geometry simplification" is a good practice to preserve stable versions of a geometry, avoiding minor and non-relevant changes (side effect of geometry-editors and other "false ...
1
vote
1answer
75 views

sfcgal ST_Volume Issue

ST_Volume works with shape data pasted into the query in this form: SELECT (abs(ST_Volume(design)) - abs(ST_Volume(ST_3DIntersection(design,scan)))) FROM (SELECT (ST_MakeSolid('...
1
vote
0answers
21 views

Using Odoo as a database for QGIS

Is it possible to link an Odoo database (CRM) into GGIS? I have an online Odoo Studio account with lots of data including long/lat data etc. Is it possible to link the Odoo database directly with Qgis ...
2
votes
1answer
32 views

Find path containing point

In Postgres with PostGIS extension, I try to figure out to find the path containing a specific point: table A contains POINT table B contains PATH My code returns 0 rows when it should select * ...
1
vote
1answer
47 views

Finding points closest to latitude longitude point using PostGIS

Right now I have a data base with PostGIS. Several of the data sets contain different locations at latitude longitude points. I will be doing several queries based at different latitude longitude ...
1
vote
1answer
395 views

Building orientation and simplification using Opencarto Java library

I need to find out orientation of buildings and perform simplification of sides of buildings with a tolerance. I came to know from Stack Exchange that OpenCarto has useful libraries for geometrical ...
0
votes
2answers
81 views

PostGIS Tiger Geocoder Not returning, stno, street, styp for geocoding

I recently loaded TIGER 2018 data for California. After fixing all the errors I have loaded all the data into the database. I checked each of the tables and all of them contain data. From this ...
0
votes
1answer
47 views

Calculate average of the temperature value from 4 surrounded points in PostGIS [closed]

There are two-point tables. One includes temperature value and the other does not have this information. I would like to calculate the average of the temperature for the 2nd table based on the four ...
4
votes
1answer
85 views

How to create Polygons of a specific size?

I'm trying to create polygons of specific size in square meters that represent the areas surrounded by roads. The roads are stored in PostGIS as points / lines. If required, I can convert the data to ...
3
votes
2answers
141 views

Query Z at intersecting point locations from a MultiPolygonZ?

I create a MultiPolygonZ geometry with ST_DelaunayTriangles(). select st_setsrid( ST_CollectionExtract( ST_DelaunayTriangles( ST_GeomFromText('MULTIPOINT ...
2
votes
1answer
169 views

GeoPandas: Get distance from geom in tableA to a geom in tableB that matches attribute from tableA

UPDATE WITH SOLUTION (at bottom) Using GeoPandas I am trying to identify the distance between an election candidate's home address (Point) and the electoral district they are running in (Polygon). ...
1
vote
1answer
205 views

Generating regular points on 3d polygon surface?

I have some CityGML buildings and I imported them into postgis database using 3d citydatabase. I want to generate points on buildings surfaces just like in the shown image. Building surfaces are ...
9
votes
1answer
474 views

How do I select the longest connected lines from PostGIS ST_ApproximateMedialAxis?

I used PostGIS ST_ApproximateMedialAxis to transform polygons representing mountain ranges into a series of lines. Now, I'd like to select only the "longest" line segment for each group, so that I ...
0
votes
0answers
24 views

How to create a clean-graph/network layer to be used in Offline Map-Matching algorithm in QGIS

I want to use the Offline Map-Matching algorithm in QGIS to match GPS trajectories with a road network. This road network layers needs to be "a clean graph following a node-edge-model, i.e. different ...
0
votes
1answer
42 views

Load all SRTM data into PostGIS

I am trying to load all the SRTM data into a PostGIS database. I tried the process described here: https://postgis.net/docs/using_raster_dataman.html It created a giant SQL file. When I tried ...
0
votes
1answer
36 views

Importing Shapefile to PostGIS using QGIS DB Manager

I am trying to import a shapefile from my QGIS project to my PostGIS schema using DB manager. I want to create a new table in my public schema and I have an ERROR: relation "spatial_ref_sys" does ...
0
votes
1answer
55 views

QGIS 3.10.2 - Install PostgreSQL and PostGIS

QGIS 3.10.2 in Ubuntu 18.04. I'm having problems installing PostgreSQL and PostGIS following the instructions here: Installing PostGIS under Ubuntu. This doesn't work, 'postgresql-9.1-postgis' isn't ...

1 2 3 4 5 146