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
0 answers
20 views

How can I access PostGIS Topologies with C#?

I would like to access a PostGIS Topology with C#. I looked through the nPgSQL PostGIS/NetTopologySuite Type Plugin but didn't see anything. With the word topology appearing in so many places, I may ...
user avatar
1 vote
0 answers
15 views

Import Curves via NPGSQL

I'm importing geometries from Oracle to Postgis using NpgsqlBinaryImporter. In case of CurvePolygons and CircularStrings I get the error Geometry type not recognized. GeometryCode: 963 Directly in ...
user avatar
  • 1,196
3 votes
0 answers
32 views

Using the "System" database on Postgis -> ArcGIS

I've been evaluating ArcGIS at work as a possible sollution to working with some .kmv files coming from a supplier that seems to be incompatible with QGIS. QGIS thinks they are corrupt, I suspect due ...
user avatar
  • 131
4 votes
2 answers
158 views

PostGIS Maximum Inscribed Circle

I'm attempting to utilize the PostGIS function ST_MaximumInscribedCircle() but having some trouble interpreting the example. How can I feed the geometry into a from clause to retrieve the center and ...
user avatar
  • 1,051
1 vote
0 answers
16 views

Authentication problem PostGIS - QGIS

I am using PostGIS as the main data storage for QGIS with stored login credentials. This works great, with one exception: For some layers, QGIS starts asking me for login credentials to the QGIS ...
user avatar
  • 2,777
4 votes
1 answer
71 views

PostGIS Nearest neighbor really slow

I'm trying to set a link between two tables (db1 and db2) with a nearest neighbor approach and some condition checking. SELECT id, label_shop, linked_rows.* FROM shopitem.shopitem_database shop LEFT ...
user avatar
  • 71
2 votes
0 answers
11 views

How to derive raster values fast into the gird?

I have a grid that has the same dimension as a raster (Sentinel 2 imagery) which is 10 x 10 km. In addition inside the grid, I have 1000 rows and 1000 columns which make each cell 10 m resolution. ...
user avatar
0 votes
0 answers
20 views

How to correctly/efficiently store Sentintel-2 imagery with 100 x 100 km dimension?

I am trying to store 100x100 km Sentinel-2 tile imagery into the PostgreSQL table. I have only these bands: B2, B3, B4, B8, and B11, resulting in a 2.5 GB GeoTIFF file. Consequently, due to the large ...
user avatar
0 votes
0 answers
32 views

Postgis 3.0: How to convert liblwgeom to librttopo? [closed]

We want to upgrade from PostGIS 2.x to PostGIS 3.x and take over a self-written library (.so). This library was compiled with liblwgeom of PostGIS 2.x. liblwgeom seems to be not part of PostGIS 3.x ...
user avatar
  • 177
2 votes
0 answers
34 views

Deduce Generalized/Simplified Centerline of Polygon

I am trying to simplify or generalize this line so that I can hopefully measure the distance of it to the edge of the polygon. select ST_ApproximateMedialAxis(st_geomfromtext('MULTIPOLYGON(((-80....
user avatar
  • 1,051
-1 votes
0 answers
13 views

Package postgis32_14-devel-3.2.1-1.rhel8.x86_64 contains no files [closed]

After installing postgis-devel on Unix (AlmaLinux 8.6) via rhel, there are no files (header files, binaries, ...) installed. What could be the reason? See details below. Installed Packages ...
user avatar
  • 177
1 vote
1 answer
27 views

Calculating fraction of line segment point is on using ST_LineLocatePoint [closed]

I have a points table and would like to calculate the fraction of the line the nearest point is on: SELECT ST_LineLocatePoint( ST_LineMerge(public.streams.geom), control_pts....
user avatar
  • 203
0 votes
0 answers
18 views

Multiple selected values QGIS form save to PostgreSQL

I need save multiple selections in QGIS form to PostgreSQL table. My form is: How could I save the selected values ​​in the PostgreSQL table?
user avatar
2 votes
1 answer
27 views

Reducing shapefile size from PostgreSQL using ogr2ogr

I have a PostGIS database created from an old AutoCAD system. Because of this, every column is type varchar(254), even though actual data lengths are small. I need to export tables as shapefiles, and ...
user avatar
  • 21
-1 votes
0 answers
12 views

Linestring that crosses a polygon the points where the line length intersects with the polygon in km + m

I have to identify a linestring that passes through a polygon and when the linestring intersects the polygon boundary at the input and output I have to give km + m input and km + m output from the ...
user avatar
0 votes
0 answers
25 views

PostGIS error execute query [closed]

I'm trying to run a Query that does a larger operation in the PostGis database: The code is: $q = "SELECT ply.ogc_fid AS pid, lns.ogc_fid AS lid, ST_LineSubstring(...
user avatar
3 votes
1 answer
26 views

How can I get the closest linestring in my database to the linestring drawn by some user, following a path?

I have to take a geometry drawn by an user and return the geometry in my database that represents the drawing. I tried in PostGIS In my database I have a column 'way' with the geometry that I want to ...
user avatar
0 votes
1 answer
21 views

Process for Determining Accuracy of Polygon [closed]

What tools/processing/decision trees would one use to get a base line of the accuracy of a polygon? I'll explain below. In my line of work, I deal with buffered lines (polygons) and I'd like to create ...
user avatar
  • 1,051
4 votes
1 answer
30 views

Pass a variable parameter to pgr_dijkstra (pgRouting) Edges SQL

I need to pass a parameter to Edges SQL in a pgRouting function, for example pgr_dijkstra. I try something like: PREPARE test (int) AS INSERT INTO elab.test_f SELECT * FROM pgr_dijkstra( 'SELECT id,...
user avatar
  • 513
4 votes
2 answers
130 views

Order of latitude and longitude in EPSG:4326

I recently started working with GPS data in PostGIS and am very confused about the order of latitude and longitude. I'm from Europe, and here everyone I know uses latitude first, longitude second, e.g....
user avatar
  • 151
0 votes
0 answers
15 views

Delete an imagemosaic with PostGIS index with REST API on Geoserver [closed]

I have a imagemosaic datastore on Geoserver, that uses a PostGIS database to index the granules, with the following datastore.properties : SPI=org.geotools.data.postgis.PostgisNGDataStoreFactory host=...
user avatar
0 votes
1 answer
26 views

Deprecated function st_intersection_deprecated_by_postgis_301 problem

I was just trying to update postgis after also updating postgresql however I have received the notice that this function, which I use, is now deprecated Is there a way to keep using it without having ...
user avatar
  • 2,190
1 vote
0 answers
27 views

Merging S57 NOAA ENC Depth Contours (DEPCNT) for Different Scale Level Maps

I have a challenge merging ENC map data from S57 to derive single maps comprising the most accurate data available. For example: I have a scale level 5 map US5FL25M which holds more accurate data than ...
user avatar
1 vote
0 answers
15 views

Saving PostGIS raster as netCDF from SQL Error

I am trying to save a raster table in PostGIS as a netCDF file. When doing so, I get the following error: rt_raster_to_gdal: Output GDAL driver does not support CreateCopy and/or VirtualIO. Reading ...
user avatar
  • 43
1 vote
0 answers
35 views

pg_tileserv much slower than pg_featureserv?

I'm serving data where the geometry is very simple (a grid of squares, about 1500 of them total, no big deal) but the attribute data would be a json object, quite big (about 3000 characters). I'm ...
user avatar
1 vote
0 answers
21 views

How to identify upper left point from column of points? [duplicate]

I have a column that contains points (all they make one tile) and I need to extract the upper left point based on point coordinates. Is there any built-in function in PostGIS to find? Otherwise, I am ...
user avatar
2 votes
0 answers
47 views

Closest location using pgr_withPoints for two points tables

I would like to manually enter the (lat long) value into my sql code that then finds the shortest path via a line network to the closest points from an existing points table. I have been looking at ...
user avatar
  • 203
2 votes
1 answer
53 views

PostGIS st_intersection returns only the lines that are inside the polygon

I have two polygons called 1, 2. I have a linestring that crosses the two polygons but does not remain only inside them. What I'm trying to do: Find the linestring that is from A to D in the case of ...
user avatar
1 vote
0 answers
39 views

Missing fields when importing shapefile to PostgreSQL/PostGIS using Geotools

I want to import shapefiles to database using geotools , the code below worked for only one shapefile ( which was imported successfully ) , so I supposed my code was working fine , but when I ve tried ...
user avatar
3 votes
1 answer
51 views

MapServer 7 arithmetic expressions do not work on STYLE attributes

I am trying to port my code from MapServer 5 (Oracle) to MapServer 7 (PostgreSQL), but I am encountering a issue when trying to apply arithmetic expressions in the style class. So previously in ...
user avatar
  • 131
3 votes
1 answer
32 views

GRASS GIS: Execute SQL query and save output

I'm trying to find a way in GRASS GIS to execute a complex SQL query (with JOINs) and save it. SELECT a.id, a.geom FROM schema01.table01 a JOIN schema01.table02 b ON a.geom && b.geom AND ...
user avatar
1 vote
1 answer
47 views

Import data to PostGIS DB via QGIS DB Manager is very slow

I am wondering why importing a large vectorlayer (700.000 Polygons) with ogr2ogr tool takes only a few seconds and via QGIS DB Manager more than 1,5 hours. Why is DB Manager so slow with large layers? ...
user avatar
  • 1,943
3 votes
2 answers
34 views

Convert linestringz to linestringm using alter column?

I am attempting to import linestring data with or without m values, then test whether the data has m values, then add m values to the geometry if they are missing. So far, I have working tests for ...
user avatar
  • 6,400
0 votes
0 answers
17 views

Registering raster layers in Amazon RDS PostgreSQL using enable_out_db parameter

I have an AWS RDS PostgreSQL instance (v.11) that I'm currently storing vector data in. I also have a lot of raster layers in AWS S3 that are COG geotiffs. I'd like to register them in the database to ...
user avatar
5 votes
2 answers
72 views

Calculating cost values in pgRouting using ST_DWithin

I have a table where there are two geometries: geom_way (for routing roads) and (osm_meta) which is a triangulation from polygons. I use ST_DWithin function (between both geometries) with a distance ...
user avatar
2 votes
1 answer
85 views

Merge multiple tables (100 tables) into a new table in PostGIS

I am looking to merge a large number of individual tables into a new table in PostGIS. I have almost 100 "identical" tables so I wanted to do it automatically. There is a good answer here ...
user avatar
1 vote
1 answer
34 views

Leaflet.js: draw objects into PostGIS database, through Leaflet.draw, WFS-T plugin, GeoServer

I'm trying to draw objects from Leaflet (Leaflet.draw) into a PostGIS database. From https://www.npmjs.com/package/leaflet-wfst it's the Flexberry one if I'm right I enabled JSONP in GeoServer, I ...
user avatar
0 votes
0 answers
42 views

PgRouting withPoints from point to point

How create points_table for pgr_withPoint function? I know that table must have: pid, edge, fraction, side. For example I have point A(lat,lon) and point B(lat,lon), and I want to get route from A to ...
user avatar
  • 1
3 votes
3 answers
99 views

Remove only certain squares from grid in PostGIS

So I have this grid (I create this from oriented enveloping the brown polygons and then buffering) create temp table test_squares as select test_fishnet.poly from test_fishnet, polys where ...
user avatar
  • 161
1 vote
0 answers
27 views

Merge lines that are aligned PyQGIS 3

I'm looking for a function that would merge lines if they are both parallel and lie along the same line, in other words they are in alignment. This picture shows an example of some of the line data I'...
user avatar
  • 161
5 votes
3 answers
225 views

Detecting overshoot lines in road network (flyovers, over/underpasses) in PostGIS

I'd like to know a way to detect overshoot lines (such as flyovers, over/underpasses) in road network through queries in PostGIS to validate topological connections. This is a sample network: CREATE ...
user avatar
  • 305
4 votes
1 answer
77 views

Merging lines of which ends are not connected but close in PostGIS

I have a sample network as shown below. CREATE TABLE sample (id integer, geom geometry(MultiLineString, 4326)); INSERT INTO sample (id, geom) VALUES (1, ST_GeomFromText('MULTILINESTRING((136....
user avatar
  • 305
0 votes
0 answers
33 views

QField Cloud-PostgreSQL, Cloud not syncing back to PostgreSQL

I am trying to set up a project with QField Cloud where when you get back to the office and hit sync on the phone/tablet it goes to our PostGIS database. I have gone through the workflow in the ...
user avatar
0 votes
0 answers
46 views

Unable to connect to a PostgreSQL database

I've been accessing a PostGIS database in QGIS I created on an old laptop and now trying to reconnect to it with a new laptop. I've installed PostgreSQL 14 whilst the database I want to connect to was ...
user avatar
  • 2,089
-1 votes
0 answers
29 views

Simplifying road network with PostGIS [duplicate]

I am trying to simplify road network with PostGIS. The original network and desired network are illustrated below. I think I need to do the following manipulations to obtain the desired result: ...
user avatar
  • 305
1 vote
0 answers
59 views

Simplifying road network with PostGIS

I am trying to simplify road network with PostGIS. The original network and processed network are illustrated below. I need to do the following manipulations: Split links which has intersection(s) ...
user avatar
  • 305
1 vote
1 answer
15 views

Cannot invoke "org.geotools.data.DataStore.getTypeNames()" because Datastore is null

I would like to import shapefiles to PostGIS. the method I used to work with takes as argument the path of the shapefile ( a string ) , but since I need to link this to my frontend , I can only work ...
user avatar
0 votes
0 answers
23 views

How to get all the points ina bound from PostGIS

I have a table that consists a column names geos and is of Linestring field but I need to fetch the data using bounds. But not sure how to do it. I tried below query but nothing is coming. SELECT NULL ...
user avatar
  • 101
5 votes
2 answers
59 views

Removing certains routes from pgrouting output table

I have used pgRouting to generated multiple many to many traffic routes different points of interest. I have used st_Dwithin to put a catchment area on the routing alogirthm, however the agg_cost(...
user avatar
2 votes
0 answers
17 views

Retrieve properties for a feature in MVT from JSONB column?

TL;DR Check the last UPDATE section. We store all of our geometries in a single hybrid PostGIS table and corresponding properties in a single JSONB column. Properties can be anything and differ for ...
user avatar
  • 307

1
2 3 4 5
174