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
1 answer
58 views

GDAL og2ogr: insert/update existing PostGIS table from shapefile [closed]

I work with Windows, PostGIS and GDAL (I use gdal/ogr2ogr from the command prompt. Version of GDAL available under C:\Program Files\QGIS 3.16\bin). Up to now, within my PostGIS database, I was ...
user avatar
  • 731
2 votes
0 answers
35 views

Store QGIS annotations in PostgreSQL/PostGIS database

I have a multiuser QGIS project stored on PostGIS database. Is it possible to store annotations in a PostgreSQL/PostGIS database so that every user can add annotations directly on the map?
user avatar
  • 329
1 vote
1 answer
34 views

QGIS crashed when QgsVectorFileWriter.FieldValueConverter() was used as fieldValueConverter option

I want to export the PostGIS layer as a shapefile. I need to use replace all selected raw field values with displayed values in QGIS. To do so, I follow PyQGIS Export table with Replace all selected ...
user avatar
0 votes
0 answers
61 views

GeoServer + PostGIS performance

Testing a GeoServer performance. Using a Kartoza docker image and data is under AWS RDS instance for PostgreSQL. The size of the PostgreSQL materialized view is Size 3,666 MB. Spatial indexes and ...
user avatar
1 vote
0 answers
34 views

MapServer create multitemporal WMS with TIME enabled from raster in PostGIS

The goal in my current project is to create a WMS from a GeoTIFF raster layer that was previously uploaded to a PostgreSQL database with PostGIS enabled via "raster2pgsql". That worked out ...
user avatar
1 vote
1 answer
28 views

Clip WFS layer with QGIS on import

I have a large WFS polygon layer and I want to use query builder to clip it before importing to desktop app. To do this, I have created predefined polygon ( QGIS layer named: clip_boundary ) which I ...
user avatar
4 votes
1 answer
117 views

Convert bytea to geometry column with PostGIS

I am trying to create a geometry column from bytea. I imported OSM data using ogr2ogr using the command ogr2ogr -f PostgreSQL -nln bahamas_multipolygon PG:"dbname=openstreetmap user=postgres ...
user avatar
0 votes
0 answers
33 views

Update OSM database failing

I'm trying to udapte a OSM database that I just imported. After following the steps https://ircama.github.io/osm-carto-tutorials/updating-data I don't manage to pass the first udpate. I always get the ...
user avatar
0 votes
0 answers
47 views

Connection errors with PostGIS database

I am trying to import vector data into a managed PostGIS database with QGIS and I get this error: server closed the connection unexpectedly This probably means the server terminated abnormally before ...
user avatar
  • 1,943
0 votes
0 answers
20 views

Extend a line network from only its open ends [duplicate]

I want to extend a dissolved (one single feature) line network from its open ends with the help of either QGIS, PostGIS or any other python package available to use. Edit: When I run extend tool in ...
user avatar
  • 91
0 votes
0 answers
25 views

Can't zoom to current layer from reprojecting geometry

We have developed GIS software based on QGIS and PostGIS. The geometry has been stored in the projection 29702 and all functions work wonders zoomToCurrentLayer Now we have imported geometric data ...
user avatar
0 votes
0 answers
36 views

Publishing PostGIS Rasters to GeoServer

I am attempting to publish PostGIS rasters to GeoServer, but am having difficulty figuring out the correct way to do that. I am a newbie (< 100 hrs) -- Could point me in the right direction? I ...
user avatar
0 votes
0 answers
30 views

Extend a line network only when one end is not connected to any other line

I'd like to extend a connected line network (which means that all the lines are definitely connected to each other) by a few meters by using QGIS or PostGIS from only its open ends. Is it possible to ...
user avatar
  • 91
1 vote
1 answer
30 views

Save xml CityModel files to PostGIS

I'm trying to save CityModel xml files to our PostGIS Database with the files looking like this: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <core:...
user avatar
  • 151
1 vote
0 answers
19 views

PostGIS is_simple doesn't work for 3D linestring

I would like to check linestring-z validity with PostGIS. Specifically, to check whether the features are "Simple" (not self-intersect). My linestring contains X,Y,Z which looks like the ...
user avatar
2 votes
0 answers
37 views

Seeking PostGIS equivalent of Geopandas dissolve method

Suppose I have a multiline string feature that I have brought into PostgreSQL as a table called nld_table with the following columns: 'SystemID', 'SystemName', 'Location', 'Accred', 'NLD_Access', '...
user avatar
  • 1,679
2 votes
1 answer
24 views

How to map a single PostGIS function to multiple Spatialite functions with GeoAlchemy2

In PostGIS we have ST_Affine(geom, a, b, d, e, xoff, yoff) but in Spatialite this functionality is split across 2 functions: ATM_Transform( geom , affine_matrix ), and ATM_Create(a, b, d, e, xoff, ...
user avatar
2 votes
1 answer
107 views

pgRouting computation time & code efficiency

I am trying to find the closest landfill by distance from various locations, however, the computation time is 8 hr 36 min to find the shortest path from 3602 locations to 5 landfill locations. Before ...
user avatar
  • 203
2 votes
1 answer
35 views

Showing Origins on ARRAY multiple routes - pgRouting

I have routed between multiple points using pgRouting. I have aggregated the total cost of each route (length) into a new table using edge = -1 to be imported into an inverse distance weighting ...
user avatar
0 votes
0 answers
18 views

Storage needed on a VM learning GeoServer

I want to learn GeoServer. How much storage space should I allocate when I create the VM? I'll be using Ubuntu 20.02 server and following the instructions here This guide doesn't give details about ...
user avatar
3 votes
1 answer
56 views

Grouping polygons by similarity keeping records of ids

I have a layer made with overlapping polygons, some areas has the same feature overlap 100 times. What I want is to aggregate all the ids for those features which I have determined they have ...
user avatar
2 votes
1 answer
59 views

Creating a grid which takes coordinates as an input

I need to create a grid, based on parameters. Dimensions of the grid (10 km x 10 km) Upper-left coordinate, which defines the start of the grid (upper-left corner) I was reviewing the following ...
user avatar
1 vote
0 answers
39 views

Load shapefile from local machine to database PostgreSQL

I have a method that imports shapefile to PostgreSQL (using GeoTools), it takes as arguments the path of the shapefile (it's working fine). The problem is I want the user to select a shapefile from ...
user avatar
2 votes
0 answers
47 views

Finding and removing overlaps in a shapefile using PostgreSQL

I was wondering if it's possible to remove any overlapping areas that occurs in a column based on a sample of the table for the shapefile with 2 important columns: Shape area Geom I'm trying to find ...
user avatar
  • 21
3 votes
1 answer
88 views

Want to use PostgreSQL db and ST_AsMVT() to develop a tile server, assuming my start point is a GeoTIFF [closed]

So basically I want to use ST_AsMVT() function to generate a web server that generates vectors tiles for me, which can then can be accessed through a link like "http://localhost:8080/{z}/{x}/{y}....
user avatar
  • 63
11 votes
4 answers
549 views

Deleting small holes in polygons specifying the size with PostGIS

I have a big MultiPolygon layer in which I want to delete holes smaller than 100m². QGIS do it well and fast with the algorithm "native:deleteholes", but I need to use it as part of a SQL ...
user avatar
  • 634
2 votes
1 answer
44 views

st_dump - why is the "path" an array?

Looking at the postgis documentation, I read: For an atomic geometry type (POINT,LINESTRING,POLYGON) a single record is returned with an empty path array and the input geometry as geom. For a ...
user avatar
  • 1,121
1 vote
0 answers
28 views

Coverage concept and PostGIS [closed]

I'm trying to understand the implementation of the interplay of raster and vector data in PostGIS. In this article Coverage Concepts and PostGIS on the PostGIS wiki page the concept of vector and ...
user avatar
2 votes
1 answer
57 views

Why is h3.polyfill(geojson, 15) returning empty list for this polygon?

I have a polygon the size of an office block in WGS84 coordinate system. When I run h3.polyfill at resolution 15 it should return a large number of h3 res15 addresses whose centroids are contained in ...
user avatar
0 votes
0 answers
13 views

Qualified KNN query on SpatiaLite

Is there a way to do a qualified KNN query on SpatiaLite? I want to do a KNN search but specify some criteria on the table. For example, if I had a table of cities I want to return the K cities ...
user avatar
2 votes
0 answers
32 views

Generating cluster counts for map rendering using PostGIS

Each row in my table (1m+ rows and growing) has a field location containing the lat/lng Point coordinate. These points are rendered in a map. At higher zoom levels I am using Supercluster to cluster ...
user avatar
  • 21
1 vote
1 answer
55 views

Getting base Line of PostGIS skeleton

I'm interested in using OGR/GDAL, PostGIS, or QGIS in order to achieve the following: Working from the PostGIS docs, how would one further simplify this line to the middle line? I've tried utilizing ...
user avatar
  • 1,061
3 votes
1 answer
71 views

How to make column in view to have correct srid of origin table

I have the following view CREATE OR REPLACE VIEW myview AS SELECT a.id, st_setsrid((st_dump(a.geom)).geom, 25832) AS geom FROM mytable a; on a table mytable with a geom column of the following ...
user avatar
  • 1,121
3 votes
1 answer
64 views

Get geohash neighbors with PostGIS

I’d like to get the 8 neighbors of the geohash grid. For example, the neighbors of the hashcode dqcjqc are dqcjqf,dqcjqb,dqcjr1,dqcjq9,dqcjqd,dqcjr4,dqcjr0,dqcjq8. I wonder how to do it in PostGIS? ...
user avatar
  • 267
5 votes
2 answers
65 views

Adding a polygon to a multipolygon column

I have a table that contains a multipolygon column. In my application, I use a view on the table which splits the multipolygon in several polygons: CREATE VIEW myview AS SELECT a.id, ST_SetSRID((...
user avatar
  • 1,121
3 votes
1 answer
58 views

Area calculation for non-planar surfaces

I am looking for a way to calculate the area for a big set of 3D-surfaces. I know, that some of those surfaces are slightly non-planar, which means that the coordinates got somehow "rounded" ...
user avatar
  • 31
0 votes
0 answers
60 views

ora2pg SDO_Geometry to st_geometry

I am trying to migrate my database (Oracle) to postgres using ora2pg (v.23.1). Unfortunately the script converts our SDO_Geometry datatype into shape geometry(GEOMETRY,32632) instead of shape ...
user avatar
  • 2,534
2 votes
1 answer
77 views

How to get a list of lines, with a list of polygons that they intersect? [closed]

I am a new user in a PostGIS environment and don't even know where to start. I have two tables, one storing lines and the other storing polygons. I to create a query that can be used to get a separate ...
user avatar
3 votes
1 answer
131 views

In PostGIS, how to identify intersecting line segments, but not matching start and end nodes

I have a PostGIS table of thousands of linestring segments wherein each line segment has only two nodes, start and end. All of the lines have a start and/or end node that matches another line segment ...
user avatar
  • 1,349
2 votes
0 answers
21 views

Interpolated for every point in the raster space

I have here made a demo of my attempt turn points on a map into a with values raster then use St_interpolateraster and than send it back as geojson. It returns values and they are interpolated well. ...
user avatar
  • 51
2 votes
0 answers
36 views

POINT and VALUE to Multipoint

I have a table of geom(POINT) and a value. How can I turn turning this into a Multipoint geometry so I can use it in interpolate? The end goal is to use this just using my Points and values. SELECT ...
user avatar
  • 51
0 votes
0 answers
33 views

PostGIS function ST_MakeEmptyRaster does not exist [closed]

First time using InterpolateRaster and it tells me Select ST_InterpolateRaster((ST_DumpPoints(st_collect(geog::geometry))).geom,'invdist:smoothing:2.0',ST_AddBand(ST_MakeEmptyRaster(200, 400, 10, 10, ...
user avatar
2 votes
0 answers
39 views

IDW inpterpolating PostGIS

I have a bunch of points with a temperature value in PostGIS stored as geom. How can I IDW interpolate between these and return a GeoJSON? I know how to return a GeoJSON from my points but I have no ...
user avatar
0 votes
0 answers
17 views

ST_AsRaster equivalent function in Python

I have a table in PostgreSQL such as the one below. fid name rating geometry osgb43210 Smith Street 1 POLYGON ((507300.52 428808.91, 507299.2 428814.15, 507298.48 428813.98, 507299.37 428808.68, ...
user avatar
  • 37
1 vote
1 answer
39 views

Can't import a shapefile with different SRID in a geometry column

PostgreSQL 13, PostGIS 3, QGIS 3.22 In a table, I had a geometry column geom with a SRID 2154. Now I have to store geometries with different SRIDs in geom. So I did : alter table activite.prescription ...
user avatar
  • 1,045
0 votes
0 answers
176 views

Mapbox layer doesn't update on variable change | react-map-gl

I have a map with a custom layer. Right now I have a problem that when points state get updated the map doesn't rerender. How can I force a rerender of the map layer when points changes? Codesandbox: ...
user avatar
  • 51
1 vote
1 answer
36 views

Use PostGIS to find all the most outer points

I am trying to use POSTGIS to find all the outer points when I have alot of points? How would I go about doing this and and I cant seem to find a command for it.
user avatar
0 votes
1 answer
36 views

Insert a waypoint into a POSTGIS table with psycopg2 and ST_GeographyFromText

I am trying to insert a waypoint into a table with 1 foreign key refererance and a geography point in PostGIS. I am having no luck. The table structure is CREATE TABLE route (id serial ...
user avatar
  • 11
0 votes
0 answers
28 views

How to import shapefile to PostgreSQL via PostGIS Shapefile Import/Export Manager?

When I after opened shapefile and click to button Import Log Window gives back error message: dbf file (.dbf) can not be opened. Shapefile import failed. I try to open the dbf file and still repeat ...
user avatar
1 vote
1 answer
63 views

Geometry Viewer in pgAdmin 4 displays a straight line instead of polygons of European union countries

Via PostGIS I import a shapefile layer with polygons of EU countries. I try select all rows and after still display blue straight line without the end. Where is the problem?
user avatar