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

Constructing a graph from a city in Python using Overpass

I'm looking to construct something exactly like this person Building a graph from OSM? That is I need to construct a graph with intersections as nodes and roads as edges for a simulation. Unlike this ...
0
votes
1answer
15 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 ...
0
votes
0answers
16 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 ...
2
votes
0answers
26 views

How to obtain an homography from a single soccer image? [migrated]

I am trying to obtain an Homography of a soccer image shot by a broadcasting camera. The original picture: I then proceed to find field lines, resulting in the following: From what I understand, at ...
0
votes
1answer
16 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 ...
0
votes
0answers
7 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. So I found GDALGridInverseDistanceToAPower function but it's a C function. Is somebody know how to perform it in ...
0
votes
2answers
10 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 ...
0
votes
0answers
21 views

Python error message 'EOL while scanning string literal (, line 77) See log for more details' [on hold]

I am an absolute beginner in Python programming. Despite numerous attempts to rectify I am constantly finding new errors in the script below. Can anyone help please? ##Network analysis=group ##...
1
vote
0answers
16 views

ArcGIS Python Add-In Extension - how to make it immediately functional after install?

I have a Python add-in that includes an extension class. The only purpose of this extension is for some buttons in the add-in to be automatically enabled/disabled depending on if there are relevant ...
0
votes
1answer
23 views

pip install psycopg2 from source [on hold]

I have python 2.7 and I want to install and setup psycopg2 from the source code. I installed the code from here http://initd.org/psycopg/ under quick links Download stable release (2.7.7) this ...
0
votes
0answers
18 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 ...
3
votes
0answers
44 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
9 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
24 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
10 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?
0
votes
1answer
26 views

How to create a GeoDataFrame from Dataframe correctly? [on hold]

I am new to Python and struggling with this problem: I have a DataFrame which contains one column called 'WKT' with polygons. I wanted to import it by using gdp.read_file. The import is working but ...
1
vote
0answers
12 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
5 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
18 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
0answers
19 views

Visualizing R-tree in Python? [on hold]

I am trying to visualize R-tree in Python. Are there any existing packages for this?
0
votes
1answer
17 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
10 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 = ...
0
votes
0answers
21 views

Building macro for simple tasks [on hold]

I want to automate some simple steps in my QGIS work. I have several layers included in my project file. What I want to do: Select one layer visible Fit it to screen Print it to SVG via simple svg I ...
2
votes
1answer
32 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
27 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
20 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
12 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
16 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 ...
3
votes
1answer
91 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
36 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 ...
1
vote
0answers
26 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
63 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
84 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
6 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
59 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
44 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 (...
-1
votes
0answers
16 views

issues import fiona [closed]

import fiona Traceback (most recent call last): File "", line 1, in import fiona File "C:\Python27\lib\site-packages\fiona__init__.py", line 87, in from fiona.collection import ...
0
votes
0answers
30 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
18 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 ...
2
votes
0answers
39 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
30 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
20 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.
1
vote
0answers
26 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
41 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
27 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 ...
-1
votes
0answers
25 views

How to print data with latest time in python? [closed]

how do i print only the row with lastest date i.e. catmat,catalin,matei,3/8/2017 in Python?
0
votes
0answers
30 views

Generate simple if possible shp2pgsql [closed]

I am using a Python script to first detect all SHP which are in a directory (not a stable list), and then run a for loop with shp2pgsql to import into my PostGIS database. I would prefer to import ...
2
votes
0answers
62 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
30 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
62 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 ...