Questions tagged [python]

Python is an open source interpreted programming language used in many GIS programs.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

Model designer issue, QGIS 3.14 iMAC

I tried to make Model in Model designer but I don't see my new fields in designer window, but only the offer of the existing layers. What's wrong and what did I miss? There is no connection lines.
3
votes
1answer
164 views

Add RGB values from CPT file to Int16 GeoTIFF using Python and Gdal

I want to add color, using RGB values stored in a CPT file, to a black and white Int16 GeoTIFF file using Python. I tried to use SetColorEntry(), but when I add the ColorTable to the RasterBand, I ...
0
votes
1answer
11 views

Use ST functions in GeoDjango Project

I have a Geo-Django project in which i am using postgres as database. I have a table with geometry column. I am filtering data and getting results which is working fine. Problem is I want the geometry ...
0
votes
1answer
76 views

Python code speed execution problem

I am trying to retrieve data from 324 eopatches I sampled beforehand. Patches are basically numpy arrays as explained in this documentation EOPatch. This is an example of the content of a patch after ...
2
votes
1answer
163 views

Starting QGIS 2.18 processing algorithms from .bat-file

I have written a bunch of Python scripts within the QGIS 2.18 processing framework to process a sequence of tasks. What I am trying to achieve now is to call the python scripts from a .bat-file ...
3
votes
0answers
22 views

Finding union of many geodataframes using GeoPandas

I have a series of many GeoPandas Polygon objects, each with an associated exposure time. My goal is to find the union of all the Polygons in order to create an exposure time map. For each Polygon in ...
1
vote
1answer
33 views

GeoPandas to DXF

I have ten geodataframe; I would like to export each one of them to DXF: geodataframes= [gdf1,gfd2,gdf2] for geodataframe in geodataframes: #geodataframe to dxf it would be possible?
1
vote
1answer
55 views

How to read the relevant join information out of a MXD file (above all the name of the destination table attribute)

Goal: Read all joins within a MXD file and its relevant information. This should include: origin layer name, origin attribute name, destination table name, destination table attribute. To solve this,...
-1
votes
1answer
17 views

Maps with Cartoframes outside jupyter [closed]

I use Pycharm as IDE for python. I can not see the visualization of carto within pycharm. This is a problem of configuration or literally to see the maps I MUST use jupyter as IDE?
1
vote
1answer
192 views

Dealing with NA-Values when plotting rasters with folium in python

I have some tiffs that I'd like to plot interactively in python using folium (or any other package, but I don't know of any). My problem is, that I have many na-values in the raster. At the moment I ...
0
votes
2answers
76 views

Exporting basemap tiles Contextily (ctx.bounds2raster) gives a black/empty GEOTIFF

When exporting a tile basemap (osm topo tile service) from Contextily using ctx.bounds2raster I get a black geotiff raster with no data in it. The properties of the raster say it's an 8 bit unsigned ...
1
vote
1answer
31 views

Cannot convert float Nan to integer with raster data

I have a script that basically takes a low resolution raster grid and creates elevation band text file for this raster based on a high resolution DEM. The data can be accessed from here. On Conda ...
0
votes
1answer
16 views

How to visualize a NetCDF Dataset

Suppose I have a rather large NetCDF file that I open as a dataset using xarray. import xarray nc_in = r"....\D_P_WGS84_comp.nc" nc_ds = xarray.open_dataset(nc_in) It is composed of ...
4
votes
0answers
26 views

How to choose limited number of points to represent a point grid

I need to choose a few points to represent the grid below, e.g: 8 points in the grid below. This point need to be geographic distributed This points needs to be geographic distributed. Lets see a bad ...
4
votes
3answers
720 views

Is it possible to calculate flow accumulation using google earth engine?

I've done this with PCRaster and ArcGIS in the past but would like to know if there's a way to get it done in Google Earth Engine with the python API? Can you use other python libraries like pyDEM or ...
2
votes
1answer
49 views
+50

Extracting only part of supervised output model in Raster format

I have a svm predicted model which when applied on raster images classifies the LULC of land and writes the output to raster file. I want to use only the Land used part out of the output raster image. ...
5
votes
3answers
1k views

WinError 32 error when trying to delete shapefiles with QGIS python

I've looked at some answers on here about deleting shapefiles with QGIS but I still seem to be running into errors. I am trying to delete shapefiles that have no attribute data in them (so 0 rows). My ...
6
votes
2answers
10k views

Is it possible to query/download satellite images with Python?

I was wondering if there exists a Python library/API for downloading satellite images. Ideally, I would want to enter the latitude and longitude of a bounding box and get a high resolution image ...
1
vote
0answers
41 views

Converting every pixel of TIFF file from decimal to binary

I have a folder of .tif-files. I would like to convert every value in each of these files from decimal to binary. This code mostly works. The inner loop correctly outputs the binary equivalent for ...
2
votes
1answer
66 views

Difference in geometries of shapefiles

I have the geometry of the outline region as part of one shapefile (which is only one feature and there are other features in it apart from this). Other polygon regions' boundaries which are colored ...
2
votes
1answer
73 views

exportToPdf doesn't export the layout in QGIS 3

I have a trouble exporting a print layout in QGIS 3.10 to PDF when doing it programatically. I've created a project with print layout manually and now just want to modify the content of the map with ...
1
vote
0answers
25 views

Importing processing from QGIS into IDLE

I have been trying to make a program that creates a virtual raster based on the files that are input. Whenever I run my code it says. Traceback (most recent call last): File "C:/Users/Zach/...
7
votes
1answer
641 views

Buffering point with different distance toward N, E, S, W using ArcGIS for Desktop?

I want to create buffer polygon(with curved edges) from points like this using ArcGIS for Desktop. distance toward North from a point 5, toward South 1.5, toward west 1, toward East 2. all this ...
0
votes
0answers
13 views

Apply cloud mask to Landsat Imagery in Google Earth Engine Python API and output NAs instead of 0s

I am trying to mask clouds using the python API in Google Earth Engine, but the masked values are exporting as 0s instead of NAs. I am basically following the code here Apply cloud mask to Landsat ...
0
votes
1answer
60 views

Automated updates for fields in a metadata record?

At the moment I'm trying to write a process (in Python) to update a metadata record in GeoNetwork 3.10.2, which we have running on our intranet recently. Unfortunately, I'm unable to figure out how to ...
1
vote
0answers
14 views

Generate irregular 3d Buffer of polyline

I have a 3D polyline That i would like to 3D buffer 300 Feet XY and 100 Feet in the Z direction. I think it may be something similar to this but in 3 dimensions rather than 2 (Buffering point with ...
0
votes
0answers
14 views

Geopandas Overlay Union Issue

I was trying to develop an equivalency file between two sets of zone systems (polygons). My script reads in two separate shapefiles, reprojects them to the same projection, calculates the total area ...
0
votes
0answers
30 views

Slope Analysis with Python

I am trying to perform a slope analysis using Python and GDAL. The DEMs have a CRS of EPSG:4269 which is NAD83 and a geographic coordinate system. Previous attempts to perform a slope analysis ...
0
votes
0answers
19 views

OWSLIB Python WCS GetCoverage does not work

I wrote a Python script in order to read a WCS with the module OWSlib: # -*- coding: utf-8 -*- from owslib.wcs import WebCoverageService from owslib.util import Authentication ldbv_url = 'https://...
0
votes
1answer
31 views

Calculating the distance between two Linestring using Python

I have tow linestring, each linestring represents a rail road. I am trying to calculate minimum distance between these two linestrings. Which function is efficient to do this? I have only come across ...
1
vote
1answer
50 views

Extracting LAS/LAZ info in a performant way with PDAL?

I can do this: import json import subprocess as sp laz_file = somefile.laz r = (sp.run(['pdal', 'info', laz_file], stderr=sp.PIPE, stdout=sp.PIPE)) json_info = json.loads(r.stdout.decode()) and ...
0
votes
1answer
10 views

Check if Google Earth Engine Python API is initialized

In Google Earth Engine Python API, you need to start with an initialization : import ee ee.Initialize() Is there a way to check if the ee has already been Initialized ?
0
votes
0answers
10 views

rasterio merge method to calculate mean

I am trying to mosaic some raster-datasets (~15) using rasterio.merge.merge in python. I defined a method to calculate the mean but have trouble to take the no-data-values into account. def nanmean(...
2
votes
1answer
82 views

Is it possible to use FCIS: Fully Convolutional Instance-aware Semantic Segmentation without using CUDA?

I was reading a work on github (https://github.com/chrieke/InstanceSegmentation_Sentinel2) where it requires the use of FCIS and mxnet for deep learning, following the tutorial I saw that the ...
1
vote
0answers
2k views

Converting raster to line vector layer

I would like to convert all values having the value 1 in a binary raster to a line vector layer. The following image shows the binary raster (1=white and 0=black): The optimal output would look like ...
2
votes
1answer
155 views

Errors while importing QGIS 3.10 from standalone Python, but not from QGIS's Python Console

I try to load a QGIS project in standalone Python on Windows 10. This is the code that I use: from qgis.core import * qgs = QgsApplication([], False) QgsApplication.setPrefixPath("C:\Program ...
1
vote
2answers
88 views

Problems with loading Plugins (processing and other plugins)

I have the following python errors when starting the QGIS 3.14: 2020-10-21T09:21:57 CRITICAL Traceback (most recent call last): File "C:\OSGEO4~1\apps\Python37\lib\site-packages\osgeo\osr.py&...
0
votes
1answer
135 views

Calling gdal_pansharpen.py from another Python script?

Has anyone been able to successfully call gdal_pansharpen.py from your own Python script? I have successfully used rasterio to combine my R, G, and B bands, but would like to perform a pansharpen ...
0
votes
1answer
1k views

Using GDAL or Python, how can I merge/combine 3 NITF images (RGB) into one image and keep the RPC metadata intact?

I'm looking to merge 3 imagery bands that are saved as separate files. The file format is NITF. The reason they are saved as NITF is because they have RPC metadata embedded into the images. I would ...
1
vote
1answer
49 views

Getting CURL error when using rasterio on Google App Engine

I'm attempting to get the pixel value of a raster that stored in an S3 bucket via a script that's using Flask and is hosted on Google's App Engine. If I run the script on my local machine, everything ...
0
votes
0answers
29 views

Validating coordinates are within bounds of a spatial reference system

Given a geometry and a projection, how can I verify that all the coordinates in a geometry (Point, Polygon, ...) are within the bounds of the projection? (For example, WGS84 Bounds: -180.0000, -90....
2
votes
0answers
1k views

LiDAR point cloud to numpy array to raster?

I'm looking for a way to create a height raster (raster of z values - i.e. not just ground poinits). I can accomplish this with gdal by creating a point vector layer from the numpy array then using ...
0
votes
0answers
22 views

No image exported from GEE ImageCollection to Cloud Storage

I am attempting to export an ImageCollection from Google Earth Engine to Cloud Storage using python API. I work in Atom text editor using Hydrogen, which relies on Jupyter. My workstation runs Ubuntu ...
1
vote
1answer
124 views

How can I optimize the processing time of the zonal_stats module using multiprocessing in Python?

I am carrying out a spectral feature extraction in Python 3 starting from an 8-band image and a shapefile (consisting of about a million polygons) superimposed on it. I calculate the mean and standard ...
-1
votes
1answer
34 views

Create one TIFF from several images [closed]

I have dataset with images Example image: All images have GPS coordinates. I need to stich this images in one TIFF using Python.
0
votes
1answer
600 views

Plotting Dataset of netCDF using matplotlib.pyplot displays rotated plot

I have read a Dataset in NC file using netCDF4 in python and then tried to plot the dataset using matplotlib.pyplot. But issue is the plot shows the image but with 90 Degrees clockwise rotation. ...
3
votes
1answer
63 views

Converting list into field with PyQGIS

I am trying to convert a few lists into fields. I have no problem creating the fields. I just don't have any idea on how to fill them. if result: layer = self.dlg.comboLayerLine.currentData() ...
1
vote
0answers
23 views

GeoPandas Overlay Intersect not intersecting some areas

I have a GeoDataFrame where I want to get all intersection between the polygons comprised in it. The cope i use for this is this: intersection_list = [] for index in input_gdf.index.to_list(): # ...
1
vote
1answer
873 views

Dividing Geographical region into equal sized grid and retrieving indexing position

I have GPS coordinates of human mobility in Beijing Area. I want to divide geographical space in to rectangular grid, for example 2 sq. km (delta), and access the indexing position of any point inside ...
0
votes
1answer
133 views

Changing coordinate system with rasterio affects dataset opening

I have troubles changing coordinate system of a raster with rasterio. Here is my code: Here I create my .tif (it's a RGB image) import numpy as np import rasterio from rasterio.warp import ...

1
2 3 4 5
184