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
3
votes
0answers
59 views

Creating Great Circle Line from Two Points

I am trying to create a great circle line in order to ascertain if one was looking 'straight-out' from the end of a pier what country/place they would be viewing. I have the below PostGIS code written:...
9
votes
1answer
96 views

Calculating length of each polygon side in PostGIS

In PostGIS, I want to calculate the length of different sides of a polygon. I know how to calculate a perimeter but how to calculate length side by side? Perimeter is as a sum of side's length so I ...
0
votes
1answer
36 views

How to increase tilesize for OSM database

I'm trying to create a custom tileserver with express and Postgres. I've imported the OSM planet.pbf file into a Postgres database with PostGIS installed and I can currently serve tiles in 256x256, ...
1
vote
0answers
40 views

Finding all points within some circles using PostGIS

I've been given an array of center points(longitude and latitude) and corresponding radius, and try to find all points in these circles. I know how to find points in the specified circle (the center ...
1
vote
0answers
33 views

How do I aggregate grouped point geometries with a fixed point in a virtual layer?

I am creating an atlas for viewpoints (point layer) looking toward a site (polygon layer, one feature only). Each page of the atlas must show the site and either 1 or 2 of the viewpoints. The ...
0
votes
2answers
51 views

OpenStreetMap: find public transportation belonging to a road - Tools ot algorithm

I'd like to find the public transportation lines (bus, tramways) that operate on a particular road. Do you know any tool doing that? If not, do you know any algorithm doing that? The only generic ...
0
votes
1answer
59 views

Querying by polygon boundary using Geopandas and PostGIS

I am really new to PostGIS (and PostgreSQL, for that matter) and I am having trouble figuring out how to query an existing table in a PG database with a polygon. I think I have identified the ...
3
votes
2answers
105 views

PostGIS query to select number of points per polygon and year

I have two tables in a PostGIS database: rides, containing about 3 million datasets: ride_uid (unique integer) start_geom (point geometry with index in 4326) end_geom (point geometry with index in ...
2
votes
1answer
45 views

st_intersects with ST_Dump throws PostGIS exception

I have a query in my lines and points table. My lines table includes MULTILINESTRING, MULTILINESTRING Z, LINESTRING geometry type data. select * from sde.line h2 left join sde.points b on ...
1
vote
0answers
24 views

tegola viewer nothing shows up

trying to use tegola on my local and the viewer page there is nothing showing up just this screen here is my config file [webserver] port = ":9090" Access-Control-Allow-Origin = "*&...
1
vote
3answers
106 views

Postgres/PG_Tileserv increase speed

I need to increase the drawing speed of the tables/functions served up by pg_tileserv for a leaflet map. I am running pg_tileserv on a digital ocean server with 2cpus, 4GB memory, 25 GB SSD and 4TB ...
0
votes
0answers
24 views

MapServer raster from PostGIS fails to load

I have a PostGIS with a raster stored in a table (solardensity.density). I want to create a map service with MapServer like this: LAYER NAME "raster" TYPE raster PROJECTION "...
0
votes
0answers
40 views

Proj Error when trying to save data in PostGIS database from geodjango

I want to store my raster image(tiff) in my PostGIS database I have a Django model ndvitime and I want to store my tiff image from earth engine to my database. The error arises when I want to save the ...
1
vote
0answers
75 views

Seeking PostGIS equivalent of ArccGIS Desktop Integrate Tool

Is there a PostGIS equivalent to the ArcGIS "Integrate" tool for (multi)polygons? Basically it would be an extension of ST_SimplifyPreserveTopology, which instead of considering each feature ...
1
vote
0answers
25 views

Approaches to load and serve rasters dynamically with GeoServer

I have a considerable number of rasters to serve via GeoServer. These raster are mainly representing farms not close to each other. At the moment I'm serving them as GeoTIFF. The only problem is that ...
0
votes
0answers
117 views

Adding or editing data in PostgreSQL from ArcGIS Pro

Is it possible to edit or add data from ArcGIS Pro (2.8.3, working with .gdb files) to PostgreSQL (PostGIS enabled), without ArcGIS Server ? I already have a connection to PostgreSQL, and can see ...
5
votes
2answers
208 views

How to create a classic sand snail using PostgreSQL/PostGIS?

I would like to be able to create a classic sand snail shape using a query or SQL function, similar that shown in the picture below but with smoother curves. The direction of unwinding/twisting of ...
1
vote
0answers
40 views

REST API pagination with OGR

I am using OGR to ETL data from an ArcGIS Map Service into PostGIS. When I run ogrinfo on the service, I see ~47000 records: ogrinfo -so -al "https://maps.bouldercolorado.gov/arcgis/rest/services/...
0
votes
1answer
20 views

Unable to load raster from PostGIS into QGIS - Cannot instantiate the postgresraster data provider

I'm hoping this is a simple problem. I'm trying to visualise the raster layer I have loaded in PostGIS, using QGIS. I've seen other people simply open the QGIS DB Manager and drag the raster layer ...
0
votes
0answers
71 views

Import GeoJSON object into PostGIS in JavaScript

I'm looking for a way to persist my GeoJSON object to a table in PostGIS, I've installed the ogr2ogr JavaScript library to achieve this; on this case this what I got so far: async function ...
2
votes
1answer
54 views

Points of tracklog inside a polygon with a re-enter tolerance

I have points in PostGIS that represent GPS coordinates with a timestamp from a tracklog. I'm interested in selecting the times at which the tracklog entered and exited the polygon with a certain ...
7
votes
2answers
203 views

Get resulting polygon that is overlapped by others

What I basically want is: I want to have the polygon which is numbered as 13. As you can see there are many overlapping polygons but the most overlapping one is numbered 13. The image is from this ...
1
vote
1answer
47 views

How to get Feature Collection from PostGIS with GeoAlchemy?

I am building a simple Flask app where I want to display all point data stored in PostGIS with Leaflet. What I want to do, is retrieve data in GeoJSON from PostGIS to Flask (using GeoAlchemy) and then ...
1
vote
0answers
40 views

Construct quadkey grid in PostGIS

I would like to create a set of grids in quadkey format like this Mapbox site shows https://labs.mapbox.com/what-the-tile/ Is there any solution in PostGIS that given an boundingbox.geom and the zoom ...
2
votes
2answers
66 views

Getting schema names from PostGIS database in PyQGIS

I would like to list the names of all schemas of PostGIS in a given DB called DB-1 in PyQGIS. My attempt was inspired by : Getting table names from PostGIS database in PyQGIS from PyQt5.QtSql import * ...
1
vote
0answers
36 views

Unable to edit PostGIS polygons using QGIS

I created a QGIS project and added some polygon layers from postgis database. I also saved QGIS project on PostGIS database. I am trying to edit those polygons using QGIS vertex tool but when I try to ...
5
votes
2answers
102 views

Getting table names from PostGIS database in PyQGIS

I would like to list the name of all tables of PostGIS in a given DB called DB-1 in PyQGIS. I found this Q&A at Stack Oveflow: https://stackoverflow.com/questions/34418667/get-table-names-from-...
2
votes
1answer
43 views

Retrieving PostGIS selected table in PyQGIS

I would like to use the layer selected into the explorer's windows. My aim is to launch script using the name of the PostGIS layer selecter in this windows. Is it possible to retrieve the table ...
1
vote
0answers
129 views

How to calculate the area of a polygon in real meter in OpenLayers?

I'm trying to figured out why I'm getting weird results from ol/sphere/getArea. I draw an rectangle with fixed size of 5x5 meter. To translate 5 meters to map units, I do the following: const factor = ...
3
votes
1answer
128 views

Clone PostGIS table in PyQGIS

I would like to clone a schema of PostGIS into the same database using PyQGIS. At the moment, I'm able to do it using SQL using pgAdmin with this code: CREATE OR REPLACE FUNCTION clone_schema(...
2
votes
1answer
49 views

Converting native point datatype into Geometry(Point,4326) using PostGIS

I have a table with "coordinate" column in it of data_type POINT (native postrgresql point). I want to convert it into Geometry(Point,4326) I am using psycopg2 to connect to my database. I ...
0
votes
0answers
41 views

Saving Google Earth Engine image into PostGIS database from Django project

I have calculated the NDVI from Google Earth Engine for the required time period now, I am getting all NDVI images for that periods and I want to save all the NDVI images to my PostGIS database. How ...
2
votes
1answer
54 views

Spatial Join takes very long time on two small datasets using PostGIS

I have two datasets: A is a hexagon grid and has 19089 rows B contains linestrings and has 18641 rows I want to know, which linestrings are within which hexagon. WITH bufferedB AS ( SELECT ...
4
votes
1answer
60 views

Creating Hexagon Grid over streets using PostGIS

I have a street layer of a city. I want to create a hexagon gridwithin the streets. I buffered the streets with 20m, I unionized them. The next step would be creating hexagons within the streets. ...
4
votes
2answers
103 views

Determine shortest distance between each point and line 2 without intersecting line 1 with PostGIS

I am generating cross sections between each points and the closest point along Line 2 (red line). These cross sections are generated with the following statement in PostGIS: SELECT point.id, ...
2
votes
2answers
52 views

Finding nearest point of route using ST_DWITHIN

I'm new to PostGIS and distance comparisons and am having some problems with my current project. I have a an array of geopoints (long lat) which correspond to a route. And I need to find the nearest ...
4
votes
1answer
67 views

Choosing appropriate index for PostGIS data

I have been reading this blog by Paul Ramsey, and considering my own data. https://blog.crunchydata.com/blog/the-many-spatial-indexes-of-postgis I have a regular grid covering an area of the world. ...
4
votes
1answer
115 views

ST_difference resulting in multiple overlapping polygons and no difference

I have a dataset with two layers of polygons: Layer A: Areas of interest from the corine land cover inventory dataset Layer B: Road network resulting from buffered linestrings that were aggregated by ...
2
votes
1answer
42 views

ST_Snap with condition

I don't understand. I try to snap points to line but only points with the same id than line. I try CREATE TABLE snaped_pr2 AS (SELECT axe, ST_ClosestPoint(pr.geom,rr.geom)::geometry(POINT,2154) AS ...
1
vote
0answers
35 views

How to merge a GeoJSON and an OSM file into a single OSM file? I want to merge Microsoft buildings dataset into a single OSM file

I'm using a video game tool that can take OSM data and import it to Unity automatically. The issue is that OSM doesn't have a lot of buildings, so my game doesn't, either. I found the Microsoft ...
2
votes
0answers
26 views

Import GeoJson into PostgreSQL with psql

Is there a way to import a GeoJson through the commandline into a table? Like shp2pgsql
5
votes
1answer
111 views

Counting geometries which intersect another geometry using PostGIS

I'm trying to calculate the total area for each layer I have within a specific area and count the geometries which intersects with that specific area. I can calculate the area and the results seem ...
1
vote
1answer
44 views

Automatically running an ST_AsText query over multiple rows in QGIS

After my SpatiaLite database got corrupted, I used a recovery tool to recover what was lost. I now do have the database, but I can't visualise the features on a map. I figured out that with SELECT ...
0
votes
0answers
28 views

PostGIS WMS raster data - pixel values shifted on different zoom levels

I'm quite new to working with geo data, specifically with PostGIS and currently trying to understand the following phenomenon. I have some raster data stored in a PostGIS database and use this PgSQL ...
1
vote
0answers
37 views

Programmatically generating minimal QGIS map file (.qgs) containing specified PostGIS layers

I am just wondering if there is a way to generate a QGIS map file (.qgs) from the list of data sources (PostGIS) that comprise the map. I have many maps each containing two layers from a PostGIS ...
7
votes
2answers
313 views

Create points along lines at defined distance in PostGIS?

I have zero experience with PostGIS and SQL, but I'm trying to create points along the line at specific distance. I am trying this method: Getting points along line at defined distance using PostGIS? ...
0
votes
1answer
62 views

Storing route in PostGIS Database

I am trying to save few routes created by OSRM which is in Polyline or GeoJSON format in my PostGIS Database. How can I save the data in such a format which I can use to search with coordinates ...
1
vote
0answers
31 views

Does GeoPandas .to_postgis remove my SRID when sending to PostGIS?

I'm using the below code to insert the GeoPandas dataframe "df" into PostGIS but I keep getting the error that Geometry SRID (0) does not match column SRID (27700). The table in PostGIS has ...
2
votes
1answer
52 views

Using ST_Transform() to get the length of a LineString using SRID 4326 returning very small numbers

I am using openmaptiles to convert OSM pbf files to mbtiles. I am testing a trail that is about 5 miles in length. In doing this, I am wanting to calculate the length of path using the following: ...
0
votes
0answers
60 views

Saving login credentials for database in QGIS project file for QField

I'm trying to setup my QField application with PostGIS. However, I get an error in QField saying: The following layers could not be loaded, please review and reconfigure the QGIS project. Does ...