All Questions

31,290 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
30
votes
0answers
3k views

Leaflet v1 plugin: layer control for ungrouped, grouped, and nested-grouped layers

I need a Leaflet plugin which extends L.Control.Layers. I have the following requirements: works with Leaflet 1.x handles ungrouped layers alongside grouped ones handles nested layer groups does not ...
23
votes
0answers
393 views

Unit testing for QGIS 3 plugins

There is a nice resource on unit testing for QGIS. There is also a post on this, Writing automated tests for QGIS plugins, which requires the use of docker and relies on QGIS 2 plugin - QGIS Tester. ...
16
votes
0answers
773 views

Parsing file format for attributes in Raster Product Format (RPF) maps and imagery?

I'm trying to implement an open-source NITF reader (using only java, no external libraries such as GDAL or NITRO), and its mostly going OK. However I'm having trouble understanding the RPF extensions, ...
14
votes
0answers
2k views

Extract TopoJSON directly from PostGIS

I have a simple "region" table: id (TEXT), name (TEXT), geom (MULTIPOLYGON). Here's the query I can use to extract a GeoJSON FeatureCollection: SELECT row_to_json(fc) FROM ( SELECT '...
13
votes
0answers
1k views

Constructing a Voronoi diagram using a complicated travel time metric

I have in my possession four sets of shapefiles: 1. Locations (points), around 1000 2. Roads (lines), each road has a speed attribute 3. Terrain (polygons), each zone also has a speed attribute 4. ...
12
votes
0answers
197 views

Reading raster backward using GDAL

I am currently working on two-scan raster algorithms (euclidean distance transformations, cost surface analysis, etc.). Those algorithms require a line-wise forward raster scan (from top left to ...
12
votes
2answers
9k views

Downloadable, Open Source, IP GeoLocation database

I have an open source project. I need a similarly open source IP GeoLocation database i.e. IP address to country (and ideally city). Ideally with a license that allows redistribution. This is a ...
11
votes
0answers
451 views

Remove reference to raster layer object PyQGIS

I am developing a plugin to load a set of raster files on QGIS. When there is a large number of files to be loaded, the main UI freezes. So I use QgsTask to move the creation of raster layers to a ...
11
votes
0answers
512 views

High PostgreSQL/PostGIS memory and disk usage when saving QGIS project

Why would simply pressing the "save" button in QGIS cause my local PostgreSQL instance to cause memory and disk usage to spike to "Not Responding" levels? Seems to me like the ...
11
votes
1answer
2k views

Setting band names when writing multiple layer rasters using GDAL with Python?

I want to write a raster file (using GDAL+Python) with multiple bands. However, I do not know how to name the bands. Their names are always "Band 1", "Band 2", etc. I searched and ...
10
votes
0answers
328 views

Accessing watershed boundary for lakes in R

I have had success accessing unique database IDs and polygons for various lakes in the US. I'm now looking to get polygons for the watersheds associated with these lakes, but have stumbled a bit. ...
10
votes
0answers
238 views

Processing post-execution script hook to clear scratch layers?

I've been cobbling together some Processing scripts for QGIS 2.18 (I'm not a fan of QGIS 3 scripts), and I keep running into one particular problem: my script creates a lot of scratch layers and they ...
10
votes
0answers
331 views

Multithreaded DB connection for QGIS plugin

I am using QGIS 2.18.21 and PostgreSQL 9.6. on a Windows 8 machine. I am trying to do processing of a certain database task in the background, and I want the user to be able to continue to work in ...
10
votes
0answers
282 views

ESRI Runtime Geodatabase Shape storage

Does anyone out there know the geometry storage encoding for ESRI's Runtime Geodatabase (.sqlite) format? aka mobile geodatabase. There are 'GDB_ tables', 'st_ tables', 'RTREE indexes' and other ...
10
votes
0answers
473 views

MapScript with Python 3

I am trying to build raster summarizing features into a GeoDjango webmap, and would like to use the django-raster and django-wms packages to do so. I believe that I have them set up correctly, but am ...
9
votes
0answers
122 views

Finding largest visible area inside polygon using PyQGIS

I need to find the largest possible visible area inside many polygons. The polygons represent clearcuts inside forests. For example if I stand here I can see 10 out of 14 hectares, nowhere else can I ...
9
votes
1answer
230 views

Displaying Google Earth Historical Imagery in QGIS

I am currently carrying out research aimed at showing the evolution of plant cover in urban areas. I opted for the calculation of the vegetation index from Sentinel2 type images that I would like to ...
9
votes
0answers
178 views

Saving ArcGIS Pro symbology to PostGIS DB for each layer

I want to have a default style/symbology assigned to each layer in a PostGIS database so that whenever it is loaded in ArcGIS Pro, it will come up with the default style. There is a way in QGIS to ...
9
votes
0answers
303 views

Defining partial or complete overlap with QgsSpatialIndex

I'm working on adding some functionality to a QGIS plugin. It currently uses a QgsSpatialIndex to efficiently compute whether the features of a vector layer intersect (potentially millions) of ...
9
votes
2answers
782 views

Raster smoothing

For my thesis I need to simulate a debris avalanche, but in my elevation raster the avalanche deposit is included so I'd need to take it off to simulate on a pre-avalanche-like surface. Unfortunately ...
9
votes
0answers
989 views

What is the convergence threshold for ArcGIS Iso Cluster?

The ArcGIS tool Iso Cluster Unsupervised Classification does not seem to have any documentation on the convergence threshold used in the tool. To compare, Erdas Imagine has all of the necessary ...
8
votes
0answers
955 views

Making polygon for every point in set using Voronoi diagram

I'm trying to make polygons from points, where each point will be represented by one polygon. I tried using Voronois, but the results are incomplete. While I more or less understand where this ...
8
votes
0answers
2k views

Georeference an unreferenced image using rasterio in Python

I have 6-band unregistered/unreferenced TIFF images that I have been trying to export as georeferenced GeoTIFFs. The GPS coordinates of the corners of each image is known and each image is 1024 height ...
8
votes
1answer
402 views

Symbol not visible in Layers panel

I have a layer with symbology that includes Geometry Generators. It would appear that because of these the symbol is not visible in the layers panel. Is there a way to show the up most symbol (green ...
8
votes
0answers
382 views

Calculate volume of space defined by multiple overlapping 3D polygons

I have thousands of 3D polygons scattered in space but they mostly overlap with many of their neighbors in big extent. Is there any way how to compute volume they define effectively? I would love ...
8
votes
1answer
4k views

Filtering a layer based on property that's an array in with Mapbox GL JS?

I've got a relational dataset broken into two layers: members and organizations. They're GeoJSON, with features that look something like this: // Org Features { "type": "Feature", "geometry": { ...
8
votes
0answers
544 views

Labelling a rubber band (QgsRubberBand)

It is possible to label QgsRubberBand or QgsVertexMarker with a text annotation (QgsTextAnnotationItem). See this MWE: ... r_polyline = QgsRubberBand(iface.mapCanvas(), False) r_polyline....
8
votes
1answer
408 views

Removing overlapping features by percentage in PostGIS

I have geometry records of type MultiLineStringZM and I am trying to INSERT new records that overlap some of the records currently in the table. If they were type MultiPolygon I could use ST_Area() as ...
8
votes
0answers
2k views

How to prevent cross-world lines in ggplot world map?

I'm having issues displaying 'great circles' paths and polygons in ggmap, an extension of ggplot2. Please enter the following code to replicate my issues: https://gist.github.com/Robinlovelace/...
7
votes
0answers
46 views

Regex_replace in the Field Calculator: unexpected duplication of replacement elements

After testing things out for a different question, I found something unexpected about the way regex_replace works in the Field Calculator, compared to PostgreSQL. The suggested insert ends up ...
7
votes
0answers
199 views

When not to create spatial index?

As I realized once again connected with this answer to Joining attributes by location using QGIS, creating a spatial index can result in huge performance improvements. However, I was wondering why ...
7
votes
0answers
1k views

Warning message using writeRaster() - not updated for proj >= 6

Using the code below to write a raster to disk: library('raster') r <- raster(nrow = 5856, ncol = 9141) r[] <- 1:ncell(r) writeRaster(r, tempfile(fileext = ".tif"), ...
7
votes
0answers
3k views

Exporting GeoTIFF raster to GeoPandas dataframe

I'm just starting in the field of GIS (mostly worked with just python before) and got stuck on a problem. I'm looking for a way to polygonize an already masked GeoTIFF raster with population data in a ...
7
votes
0answers
124 views

How to uncompress a file geodatabase with open-source tools?

At 3.10.4 I tried to load a FGDB polygon feature class, but it failed, with an "Invalid Data Source" error. I tried the load with both the Vector > Directory > ESRI FileGDB and Vector > Directory > ...
7
votes
0answers
114 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 ...
7
votes
1answer
530 views

Finding the closest line to polygon using Python Rtree

I have a series of fields and roads. I am trying to find the nearest road to each field. I want to add field to each of my polygons with the index/name etc. of the closest road. Would this be the ...
7
votes
0answers
329 views

PyQGIS script crashes QGIS 3 when remove a custom pluginLayer which has custom legend

I upgrade a 2.18 plugin to 3.4. PluginLayer has been refactored and I could not create a custom legend as simple as previous major version of QGIS 2 : QgsDefaultPluginLayerLegend was removed. Use ...
7
votes
0answers
78 views

Snap LineStrings considering direction in QGIS 3

I have 2 projected shape files: Roads (red) and public transit routes (blue): I want to snap the PT routes to the roads, but because of inaccurate marks sometimes the routes are snapped to the wrong ...
7
votes
0answers
152 views

Intersections in linestrings using PostGIS

I need to get the intersections of streets and create a graph, so to get the intersections I use this select: SELECT ST_GeometryType(geom), geom FROM ( SELECT a.gid, ST_Intersection(a....
7
votes
0answers
735 views

Add private plugin repository to QGIS 3.4

I want to add a repository to my QGIS 3.4 which is on a private server. The repository contains all files needed (plugin.xml and metadata.txt for example) and has the structure as described here: Is ...
7
votes
0answers
1k views

Using WFST in Leaflet: can not move/delete features

I write a Leaflet app which makes use of two plugins Leaflet.Draw and Leaflet.WFST. The first allows to create/edit/delete features, the second saves changes to my PostGIS database hosted by GeoServer....
7
votes
0answers
413 views

QgsRubberBand Move Event

So, basically I've created a QgsRubberBand which copies feature from layer. And I need to be able visually move this rubberband on mouse event 'move'. Actually same visualisation like during self....
7
votes
0answers
407 views

GDAL contour line generation at DEM edges

In a Python application I use gdal.ContourGenerate() to generate contour lines (GDAL version 1.11.4 and 2.2.1) from DTED tiles. DTED tiles overlap at the top and the right with neighboring tiles. ...
7
votes
1answer
2k views

Write projected array to netcdf file, best practice

I'm trying to write projected rasters to netcdf files including projection information in a way that gdal can understand it. I found two ways to achieve that: By adding the geotransform as an ...
7
votes
0answers
1k views

How to access Google Earth Historical Tiled Imagery Url to other Map APIs or Cesium.js?

Does anyone know how to access Google Earth Historical Tiled Imagery url? Then, the users can load the xyz tiled imagery by using different map APIs such as OpenLayers 3, Leaflet, and Google Map APIs ...
7
votes
0answers
144 views

"Merging" 2 layers of LineString with splits at intersections

I would like to "merge" 2 networks of lines and these lines need to be split when they intersect. With pictures it should be clearer : What to do: if a black line intersects a red line, they should ...
7
votes
0answers
598 views

Setting up PyCharm CE 4 to work with PyQGIS library in Mac OS

I am trying to set up PyCharm to work with PyQGIS library. I am using PyCharm CE v4 and QGIS version 2.8 I have tried to implement the instructions of several posts like: http://osgeo-org.1560.x6....
7
votes
1answer
635 views

PostGIS: How to distinguish overlapping routes (i.e., LineStrings) based on their direction?

I have a set of routes which are represented by LineStrings in my PostGIS database. These routes represent journeys that people make. I want to come up with routes that (a) overlap, and (b) have the ...
7
votes
1answer
2k views

QGIS GRASS Processing Not Working on MacOS?

Recently upgraded to QGIS3 (3.0.2) for MacOS (High Sierra) and encountered GRASS (7.2.2) issues. Tried adding a custom variable and now when running GRASS algorithms (e.g. r.reclass) I get the ...
6
votes
0answers
73 views

Generate closest non-intersecting polygon

I have a PostGIS database of polygons representing regions in a 2D space and I'm trying to find a way to generate the closest square of a given size to a given region that doesn't intersect with any ...

15 30 50 per page
1
2 3 4 5
626