Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

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

0
votes
1answer
38 views

Check if a VERTEX of one polygon falls anywhere within the boundary of another polygon (in Python)

This is different than simply containing, overlapping, etc. For example, imagine a circle partially overlapping a square: The circle and square both overlap each other, both intersect each other, but ...
1
vote
0answers
29 views

Iterate into VectorDataset features

From a point shapefile of pools, I create an extent and I want to check if another pool is in the extent, take the coordinates and save it. I have the following code, but when I run it it just loops ...
0
votes
1answer
42 views

How to create a shapefile [polygon type] from a Geodataframe, returned from a Oracle Spatial cursor with geometry column type=cx_Oracle.LOB?

I'm trying to create a shapefile [2D polygon type] with a Geodataframe, that result from a SQL made to a Oracle Spatial database. The SQL and the Geodataframe creation runs without errors, but when I ...
3
votes
2answers
95 views

How to use GDALGridInverseDistanceToAPower in a python script

I'm trying to use GDAL in a python script to do an inverse distance interpolation. Within the C documentation API I found GDALGridInverseDistanceToAPower function but I don't know how/if I can call ...
0
votes
2answers
78 views

Extracting pixel time series from Google Earth Engine

I have written a short program in Python to extract a time series for any given pixel for MODIS data stored in the Google Earth Engine. The code is working fine and returns a data frame containing the ...
1
vote
1answer
136 views

Extract data from NetCDF file based on station

I have read other solutions for NetCDF data but my data are a little different and I do not know how to extract data from NetCDF and save them in CSV files based on stations. Data include the maximum ...
4
votes
1answer
59 views

ArcPy Memory issue re-using dictionary?

Before I start I should mention that before this I have never worked in Python before. I am trying to process a large fc to fc update, 3 million plus rows with 70 columns. I tried using updatecursor ...
1
vote
1answer
19 views

Failure to Revoke ArcGIS Pro Advanced license using Python API

I am scripting the provisioning and de-provisioning of users for my place of employment. I have the script in place to license users but I am having trouble getting the revoke script to work. I can ...
2
votes
1answer
42 views

Populating new field in shapefile with values from list?

I'm looking to populate a newly created field in a shapefile that from a list using basic python and osgeo tools. The values are integers and in a python list that is the length of the number of ...
0
votes
0answers
12 views

Different levels in R-tree

I am using the "rtree" package in Python to index spatial data. Is there any way to identify how many levels are there in the R-tree?
1
vote
0answers
13 views

How to find data orientation atfer an ICA

I'm trying to cluster tractor sensor data by row in a python script. For the moment I'm trying to find data orientation after a FastICA (sklearn), vertical or horizontal. Because for same data, ...
0
votes
0answers
32 views

ERROR 1: gdal_translate was compiled against GDAL 2.0, but the current library version is 2.2

I have tried to uninstalled both version but failed. both version were installed from source. How can I remove both version or point to 2.0 version.
0
votes
1answer
90 views

Convert GeoJSON object to bounding box using Python 3.6

Is there a library available in Python 3.6 using which I could convert a GeoJSON object (geometry) into a bounding box object? Actually I am calling a WMS layer from GeoServer and I want to set the ...
0
votes
1answer
44 views

pyrcc4 command not recognized as internal or external command? [duplicate]

The question has already been asked as 'pyrcc4' is not recognized as an internal or external command? but the answers did not fit my own trouble. I am trying to create a plug-in. I followed ...
0
votes
0answers
25 views

Error in write Array in Raster file: “”ValueError: expected array of dim 2“”

I'm using Python in my research and how I don't have large experience in this language, I need Help to understand this error that occur when I`ll write a array as raster file. data_res_b1_corrected = ...
2
votes
1answer
353 views

Fast intersection of a list of polygons with a bounding polygon using Shapely

I have a list of Shapely polygons which I need to find the intersection of each with a bounding Shapely polygon. Not all the polygons in the list cross the boundary of the bounding polygon so I only ...
0
votes
1answer
41 views

Understanding Scale in Earth Engine

I am trying to understand the scale parameter in earth engine better. My goal is to calculate monthly sums of precipitation across a geometry. Here is the python pseudo code: area = ee.Geometry....
0
votes
0answers
29 views

Download GEE Image Based on Boundary of Feature Collection in Python [duplicate]

In Google Earth Image I'm trying to download an image using the boundaries of a feature collection using Python. Working off this example, in 'region' I want to specify a feature collection instead ...
0
votes
0answers
14 views

Using Python / ArcPy to activate feature in one of ArcMap toolbars?

I'm writing a basic python script that will change a definition query and export. That is simple enough, but I would like to also add these arrows that only show up when you manually check a box ...
0
votes
0answers
23 views

NHGIS census files get lat/lon from polygon

I've never worked with shapefiles before and I'm having a lot of trouble with something that I think should be pretty simple. So I have the census tract files from NHGIS for 1980 and the structure ...
4
votes
1answer
108 views

Custom function works in “Zoom to Features” but not “Select Features”

I'm trying to update the Using Custom Functions tutorial to QGis 3 and Python 3 and I've run into an interesting issue. With the following code I can create an expression GetUtmZone()='33N' and it ...
0
votes
1answer
48 views

Integrate JSON file inputs (specifically latlng) in Leaflet with JS

It's my first time using Leaflet and I wanted to simply put two markers based from my inputs. I managed to connect my JSON file with the JavaScript and the only problem I have is how to dynamically ...
4
votes
1answer
218 views

Unable to load output layer from Python algorithm in QGIS 3

I'm building a Python algorithm for QGIS 3, to be run from the Processing Toolbox. I've finished debugging the algorithm body, which seems to work, but QGIS is unable to load its output. To summarize,...
1
vote
1answer
96 views

Map automation using open source Python modules

I have a shapefile with 3000 parcels. I am going to generate a map for each parcel. The map should be the same as the following paper map. I know that arcpy.mapping can be used for this purpose. I was ...
1
vote
1answer
139 views

Handling AIS data using Python and PostGIS?

I want to turn points into a linestring in PostgreSQL with the extension of PostGIS using Python. I want the lines in a new table because every few minutes more points are added and it needs to keep ...
0
votes
0answers
21 views

PDAL Filter output is same as input file

I've applied SOR filter using PDAL python.Below is the code snippet of the same, json = """ { "pipeline":[ "D:/Lidar_collect_3/output/output_1.las", { "type":"filters....
-2
votes
2answers
71 views

How to gently ask PostgreSQL to add PostGIS extension

I have recently installed PostGIS for the first time. I'm trying to use psycopg2 to create some polygon features. This runs: cur.execute('CREATE TABLE test_insert_shape (uuid varchar PRIMARY KEY, ...
1
vote
0answers
78 views

asyncio with multiprocessing

I am trying to run a multiprocessing on a zonal statistic in pure Python. I am new on it. I have to apply a zonal statistic with a shapefile with more than 6 million features on a taster of 6 GBs (...
0
votes
0answers
59 views

Retrieving OpenStreetMap data (ways and its child nodes) by coordinates using Overpass API?

I am new to using OSM.I am trying to download OSM data programmatically using python. I need data of ways and its child nodes contained in a perimeter specified by coordinates. Currently, I am ...
1
vote
0answers
43 views

Project a subset of GeoTIFF image from UTM 32651 to EPSG:4326 by bounding box in EPSG:4326?

I have a GeoTIFF file which is in UTM 32651 and I need to develop a program, using GDAL library version 1.x (e.g., not using gdalwarp/gdal_translate binary tools) which takes a subset bounding box in ...
5
votes
0answers
93 views

Installing QGIS to virtual environment?

I'd like to install QGIS. I'm on a system that defaults to Python 2.5x and I downloaded python 3.7x with homebrew. I created a virtual environment with this code. brew install pyenv brew install ...
0
votes
0answers
99 views

Installing pip on ArcGIS Python Installation?

I have a problem installing pip on my Windows Server 2016 on ArcGIS 10.2 Python installation. Actually, I want to install requests package and I want to install it through pip. I have downloaded get-...
0
votes
0answers
23 views

Retrieving Landsat cloud percentage without downloading the data

Is there any way to get the cloud percentage information from metadata of Landsat data without downloading it? I would like a Python solution if one is available.
2
votes
0answers
78 views

Watersheds and Catchment delineation in Earth Engine only with included datasets

Is there a possibility to derive Watershed boundaries or catchment areas by using one or more of the integrated data sets in google earth engine? The available data sets are: WWF HydroSHEDS ...
3
votes
2answers
51 views

ArcPy UpdateCursor deleting duplicate records?

I am working with .dbf files. I have two columns of data that have duplicates. A column of parcel numbers with duplicates and a column of letters that are duplicated. I want to delete all parcel ...
1
vote
0answers
47 views

R process: Zonal Stat Raster has No Data Values vs Arc output

I am trying to re-create my ArcGIS Zonal Stat model with R All my files will be 30m pixels; 18000 x 18000. I have used R two different ways to create the output and both create NoData values in the ...
2
votes
0answers
73 views

Rank-based Spatial Clustering in Python

I was wondering if there was any python (or R) packages out there that can do spatial clustering on ranked data? For each US state I spatially varying value for education rankings. For example, for ...
1
vote
1answer
69 views

Empty shapefile created with Python and GDAL

I need to create a point shapefile using the coordinates specified in the variable I called "my_points_dataset". 'my_points_dataset' variable has this structure: 1615311.055743243079633 4820229....
2
votes
1answer
71 views

Sorting (ORDER BY) rows from Shapefile using Python?

I'm writing a Python script where I have to read a Shapefile, sort its rows/records by a specific field, and then write a new shapefile with that new order. Does anyone how can I do it? I'm using ...
0
votes
1answer
53 views

Extraction of Cloud Coverage percentages of Sentinel 2 images

I have to download S2A images over a large area from 2016 March to 2019 January. Before start downloading data, first I want to know cloud coverage percentages of all the images over this period. Is ...
1
vote
0answers
40 views

Extracting shapely polygons from .png file? [closed]

I have a .png file coming from a WMS service (WFS is not available). It only contains "straight" lines and I would like to extract the geometries (shapely polygons) of the connected components of ...
1
vote
0answers
18 views

ogr2ogr - organizePolygons() error

Does anyone has idea how to deal with this error: Warning 1: organizePolygons() recieved an unexpected geometry. Either a polygon with interior rings or a polygon with less than 4 points or a non-...
2
votes
1answer
137 views

ipyleaflet draws?

If I draw a circle with map control in a map, how can I store in a variable? from ipyleaflet import Map, basemaps, basemap_to_tiles, DrawControl watercolor = basemap_to_tiles(basemaps.Stamen....
0
votes
0answers
30 views

append X,Y,Z and intensity values into a las file

I want to append XYZI values row after row into a las file.How to do this? I'm using python laspy library to write XYZI points at once, but i want to append row after row using a loop. The points are ...
0
votes
0answers
17 views

Closest point between two outer edges/ polygons

I have been trying to find two closest points between two polygons. Initially I used the "nearest_points" shapely function. However this does not always return a point on each of the polygon edges. e....
2
votes
1answer
91 views

Importing QGIS3 processing tools in standalone script

Inspired by this question, but for QGIS 3 (and therefore Python 3), I would like to use the QGIS processing algorithms in a standalone Python script without a GUI, with a standard installation of ...
0
votes
2answers
41 views

Reduce GEE memory usage?

I am working with global applications and decided to use the Python Earth Engine API to collect some data I will need. I am exporting annual, global NDVI composites based on Landsat. Since this ...
4
votes
1answer
148 views

Saving layer as shapefile using PyQGIS?

Using QGIS 3.4.4, I'm trying to save a layer as shapefile with the following code: import qgis.core import os working_folder = r'C:\myFolder' fc_Prospect = os.path.join(working_folder, Equipment....
1
vote
1answer
44 views

Visualization of 11-bit images

I'm trying to visualize a 11-bit TIFF image using matplotlib. To do it, I load the image using tifffile to obtain a 3D numpy array. Next, I have to down-sample the image because the array contains ...
2
votes
1answer
36 views

Is there any list of Python packages bundled with QGIS 3 installation on Windows?

We currently solving the problem of dependcies of our plugin. Since we want to have user-friendly installation (inexperienced users), one of the possible solution is drop some used packages in favour ...