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
18 views

TypeError: QgsMapLayerRegistry.addMapLayers(list-of-QgsMapLayer, bool addToLegend=True): argument 1 has unexpected type 'QgsVectorLayer

I can't stop getting this error message when I try to run the following code in Qgis 2.14.10 : from qgis.core import * from PyQt4.QtCore import * from PyQt4.QtCore import QSettings from PyQt4.QtCore ...
1
vote
1answer
77 views

Getting a count of points in a multipolygon?

I have a set of lottery retail locations, latitude and longitude, that I transformed to points and added the geometry column like this: ALTER TABLE lottery.retailers ADD COLUMN geom geometry(Point, ...
1
vote
2answers
57 views

Slow rendering with layers when making WMS call on GeoServer

I am making WMS calls (L.tileLayer.wms) to GeoServer and rendering the layers on a Leaflet map for a production environment, so I have maybe about 100+ concurrent users that might be constantly ...
0
votes
1answer
49 views

Django: how to set all of the model's fields using LayerMapping?

I have a GeoDjango model like below (in "data" app): from django.contrib.gis.db import models class FirstModel(models.Model): data_id = models.IntegerField(blank=True, null=True) ...
2
votes
1answer
97 views

Removing fid from the GeoServer layer

In my PostGIS table, I do not have any column with feature ID or FID. But when I open it in GeoServer layer, It shows the FID but I don't want to show it when i click over the polygon, Is there any ...
1
vote
1answer
54 views

How to save/import .shp file data to a PostGIS table in Java

Ok, I've searched and at a loss as to why I cannot find anything on how to save a shapefile to PostGIS with Java. Thought GeoTools might be helpful, but doesn't seem to be there either. So here's the ...
0
votes
2answers
37 views

PostGIS import shapefile Error

I am using PostGIS GUI to import shapefile. The connection is good. While I successfully imported the Alabama table. I got the following error when I tried to import the other two shapefiles. I ...
0
votes
1answer
71 views

GeoPandas dataframe from PostGIS table having date column

I have this PostgreSQL PostGIS database and I want to read this data in GeoPandas. I am able to create the GeoPandas database when I exclude the columns having dates/datetime #Reading data from ...
1
vote
0answers
32 views

How to find gaps in a tile and geometry of tables in a faster way

I have a table that contains polygons within a tile and it is huge. I want to find the gaps in a tile, i.e. where polygons are not present within a tile. I came up with this query but it takes a lot ...
1
vote
1answer
28 views

QGIS error message while running PostgreSQL code. WARNING Invalid PostgreSQL layer

I have run a code in pgAdmin it returns 43 rows of data. I took the same code ran it in QGIS and found the same row of data. However while trying to add the new data into the map QGIS comes with the ...
1
vote
1answer
46 views

Plotting PostgreSQL PostGIS points on map for web application

My goal is to create a web app where there's a map of a city and you can filter for year, month, day, etc. and crimes for that day will pop up as points on a map. I already have the data formatted as ...
4
votes
0answers
125 views

Connecting to PostGIS from QField

I have a QGIS project that uses a table with PostGIS geometry from a PostgreSQL server in the cloud, I have a username and password to connect. In QGIS it is requested to enter username and password ...
0
votes
0answers
23 views

QGIS: Using OSgeo4W shell to login to and create a new PostGIS database

I'm trying to create a new database through the OSgeo4W shell, as opposed to loading QGIS and hitting the 'Manage DB' menu to make one an pipe in SQL scripts. I haven't seen any documentation on this ...
0
votes
1answer
73 views

Error compiling PostGIS 3.1 from source : “undefined reference to `GEOSIntersectionPrec'”

I am just trying to build the new PostGIS 3.1.0 (with GEOS 3.9.0). But I consistently get an error about "undefined reference to `GEOSIntersectionPrec'". The commands I used was (which was ...
1
vote
0answers
36 views

raster2pgsql: “Could not allocate memory for INSERT statement”

I'm very new to raster2pgsql so please bear with me. I'm trying to load a 60mb .tif into my postgis-enabled database via raster2pgsql using the following command: raster2pgsql -s 5235 -C -F *.tif ...
0
votes
0answers
17 views

How to read postgres sql Table (No geometry) in PYQGIS? [duplicate]

In my database there is a table without geometry. how to read that from from pyqgis. self.uri = QgsDataSourceUri() self.uri.setConnection(self.Hostname, self.Portid, self.Dbname, self.Username, self....
0
votes
0answers
53 views

PostGIS install not completing

Running psql (13.1, server 12.4) trying to install PostGIS. OS X 10.13.6. postgis installed via brew install postgis. CREATE EXTENSION postgis; ERROR: could not load library "/usr/local/lib/...
1
vote
0answers
52 views

GDAL upgrade causes errors in uploading shapefiles with ogr2ogr

After upgrading my GDAL version to 3.1.4, I am unable to upload shapefiles to a local postgres database by using ogr2ogr. PostGIS is already installed and I am able to connect and run queries ...
3
votes
2answers
64 views

How to get the area of two interesecting polygons divided into attributes on PostGIS

I am trying to calculate the area overlap two vector polygon layers. I have the one based layer - soil map and I have second layer - plots. The example below: I would like to know how much area each ...
1
vote
0answers
25 views

NVDI + PostGIS + ST_Mapalgebra

I am following the PostGIS Cookbook's code to create an NDVI. I created the function but when using the example code but when I callback the function there seems to be an error... and I cannot figure ...
1
vote
1answer
42 views

Merging attributes by location in PostGIS

I am a newbie on PostGIS and I want to transfer an attribute or even a symbology from a layer to another. For example, I have a file with points that each country has a point at the center, I want to ...
1
vote
2answers
65 views

House numbers as multiple stops route with pgRouting

How do I create a routing with multiple stops? Currently I have uploaded on PostGIS the nodes and edges of the road graph but I want the stops to match the housenumbers. The ideal work would be to ...
2
votes
1answer
72 views

Converting PostGIS table to Feature Set using ArcPy

I am writing an ArcPy script (ArcGIS Pro) to export tile in the area of interest with help of arcpy.ExportTileCache_management(). I am getting the area of interest from a table in PostGIS. As far as I ...
2
votes
0answers
103 views

Create spatial joined table with intersected geometry using ST_Intersects and ST_Intersection in PostGIS

I want to perform a spatial intersection join of the two tables "temperature_precipation_slope" and "buek200_clc10 with ST_Intersects in PostGIS via psycopg2 in Python and write the ...
5
votes
1answer
112 views

Spatio-Temporal Plot on a Basemap

I have trajectory data in LineStringM format and visualize relevant results via Leaflet on street map tiles. I was wondering whether it is possible to visualize spatiotemporal plots on OSM tiles. I ...
0
votes
0answers
34 views

Can I import vector data into a SQL Database with GDAL using a stored procedure?

I am trying to understand if I can use a GDAL utility like ogr2ogr to load data from a CSV file that contains Point features, into my PostGIS-enabled database. I need to be able to pass the point ...
1
vote
1answer
82 views

QGIS: Select objects and insert relative attributes in other layer [closed]

In QGIS I'd like to graphically select multiple objects in one layer and insert corresponding multiple IDs in a unique field of a second layer. Is that possible with QGIS? (I'm working with two ...
1
vote
1answer
118 views

geopandas GeoDataFrame.to_postgis is showing AttributeError: 'GeoDataFrame' object has no attribute 'to_postgis'

I have this geopandas geodataframe which I want to write in the postgis/postgreSQL database. I have followed the steps as shown here by the geopandas docs https://geopandas.readthedocs.io/en/latest/...
2
votes
1answer
36 views

pg_tileserv database connection string specify port

I am trying to connect a DB to pg_tileserv following these directions https://github.com/CrunchyData/pg_tileserv/blob/master/README.md it says after download for windows: SET DATABASE_URL=postgresql://...
1
vote
0answers
37 views

Faster read from GPKG to PostGIS

I am loading data from a GPKG to a PostGIS database using GDAL and have noticed that it is very slow even with using the normal faster tricks. I am currently using this command ogr2ogr -progress --...
0
votes
1answer
38 views

Is there a routing solution for PostGIS that supports Theta Star?

I have a data set with 10m of accuracy. I have drones with a GPS that provides far finer resolution. I would like to provide pathing for my drone that exceeds the 10m of accuracy. I believe theta star ...
1
vote
1answer
55 views

Import .gpx data to PostGIS using ogr2ogr

I want to import a few .gpx files to postgresql using ogr2ogr. The data in each .gpx looks like this: <trkpt lat="41.842607000" lon="12.490628000"><ele>40.5</ele>&...
1
vote
0answers
32 views

Identifying overlap between linestrings efficiently in PostGIS

My goal is to clip one linestring table to a buffered version of another linestring table, and I want to make sure I'm doing it the most efficient way possible. The steps are One table is acting as ...
0
votes
0answers
21 views

Aggregate heating energy demand based on building data and street segments with PostgreSQL and PostGIS

I have two datasets / tables: Georeferenced building data with the yearly heating energy demand per building Street line segments from OpenStreetMap. My goal is to calculate the total heating energy ...
0
votes
1answer
38 views

ArcGIS Enterprise Registered Database Changed - Update Source Without Republishing All Layers?

I have around 50 feature and map layers published in ArcGIS Enterprise (the same would apply for ArcGIS Online) that reference registered PostGIS database. The database will be migrated (same names, ...
2
votes
1answer
38 views

PostGIS: Creating Polygon from lots of other geometries and then returning list of ID's in the same query

I am fairly new to all of this but in simplistic terms I have the following problem: I need to create lines from points, and from said points group all of those within n distance of one another. From ...
1
vote
0answers
49 views

How to export vector tiles from a PostGIS raster database?

I have a PostGIS raster database with 5 tables loaded from 5 geoTIFF images, tiled 100x100. I am trying to setup a map tile server to display this data on an openlayers map. I need to transform the ...
1
vote
0answers
45 views

geopandas to_postgis: ValueError: geom (geometry(MULTILINESTRING,4326)) not a string

I have a GeoPandas GeoDataFrame with a column named geom having MultiLineString values as such: print(gdf.to_markdown()) # using package 'tabulate' to display a markdown table | | uid | key | ...
1
vote
0answers
41 views

Is this a safe way to enforce non overlapping polygons or can it cause data corruption?

In this answer and comments it is explained that it it possible to implement a non overlapping polygon constraint using exclude and a custom operator. This is using PostGIS and not the built in ...
1
vote
0answers
25 views

Union table of raster tiles in PostGIS

I have a table of tiled rasters. They often overlap with each other. For instance: I would like to eliminate the overlaps. Where a raster overlaps with another raster, it should take the larger value ...
1
vote
0answers
60 views

Filling in gaps between polygons using PostGIS functions

I have a similar question to Filling gaps between polygons using QGIS The solution talks about using it in QGIS but I want to use PostGIS functions on a table on the geometry column. The solution ...
1
vote
0answers
27 views

Appending the features to PostGIS with PyQGIS

I have two layers with same schema and same name but its contain different features. I need to append those features with PostgreSQL db layer. All three Layers(db layer) schema and name is same . def ...
2
votes
0answers
61 views

Using shortest path pgr_dijkstra

Versions PostGIS Bundle 3 for PostgreSQL x64 12 pgAdmin 4.24 pgrouting 3.1.0 I have also enabled the postgis and pgrouting extensions on a public schema. I am only just starting with pgrouting so I am ...
1
vote
2answers
74 views

PostGIS - Fast area computation on large overlapping (or not) polygon dataset

I'm co-developing an PostGIS based API that will work with complex and potentially large sets (>10k) of polygons, extracted from a large table following custom, user defined filters. I have ...
1
vote
1answer
44 views

Combining points into polygons with range of values using ST_ClusterDBSCAN and ST_ConvexHull

I tried to create polygons with similar depths based on values from point data. I got some help to start with in this question Combining points into polygons with range of values using PostGIS Since ...
0
votes
0answers
15 views

pgr_createTopology does not create vertices at every end of the lines of a street network

I am using pgRouting with a street network. I added lines to the network that represent straight lines from destination points I am interested to the nearest street using ST_ShortestLine(). Now I ran ...
1
vote
1answer
48 views

Issue with different values after reprojection using GDALWARP (epsg4269 -> 3857)

I need to reproject a raster file (.tif) from EPSG 4269 to EPSG 3857 (OpenLayers default) to be used in PostGIS and tiled and served to an OpenLayers front end. I used the following command to ...
2
votes
2answers
94 views

Create point geometry in PostGIS from a X Y Z M coordinate format

I would like to get a PostGIS point table from a PostGreSQL table containing OpenDataKit data where the coordinates are contained into in a column in a X Y Z M format (M being I think the value of the ...
0
votes
1answer
76 views

Change geometry type to Polygon and MultiPolygon in PostGIS

I try to insert geometry values into a column in PostGIS. However, the type of values is a mix of MultiPolygon and Polygon. I tried to change the column type to Multipolygon with: Alter table ...
1
vote
0answers
44 views

How do you access PostGIS geometry data from .NET

I have a PostgreSQL / PostGIS database with both geometry and non spatial columns I created a new Console App .Net framework project and added these nuget packages EntityFramework pgsql ...