Questions tagged [python]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
8 views

Simplifying Polygons and MultiPolygons for Visualization

I completed a computation with Canadian Census data and discovered, when trying to visualize the results with Bokeh 2.0.2, that the Polygon and Multipolygon paths were very high resolution with a ...
0
votes
0answers
8 views

Extract Feature Service ArcGIS API Python

I have a feature service server and map service server and I'd like to export them to shapefiles/geodatabase. Map Service: https://tataruang.jakarta.go.id/server/rest/services/DCKTRP/UDGL/MapServer/...
0
votes
0answers
9 views

Network Analysis Shortest path with original line segments as output

I've managed to batch run the shortest path algorithm and the shortest route (point to layer) in the output is perfect, except that I really need the individual attribute table of the line segments in ...
0
votes
1answer
24 views

Movingpandas does not have attribute Trajectory or TrajectoryCollection

I am trying to emulate this tutorial on python lib Moving pandas. However, i am getting the following error while creating trajectory AttributeError: module 'movingpandas' has no attribute '...
-3
votes
0answers
19 views

Obtener atributos entre 2 capas que intersectan espacialmente y autorellenar los atributos al crear un nuevo objeto [closed]

Al crear una vivienda/punto sobre una manzana/poligono , obtener los datos de la manzana y autorellenar en el formulario los datos en los campos de la capa vivienda/punto. Existira un script para ...
0
votes
0answers
26 views

Watershed delineation using hydrological Python library

We would like to delineate watershed polygon for a given pour point using hydrological Python library. Until now, we have tried these libraries: pyshed Grass (r.watershed) Whitetoolbox We have ...
0
votes
2answers
30 views

Loop through Z coordinate of stream and create point where elevation changes by 1ft

Using ArcPy (Python 3), I am trying to create points along a line where the elevation changes by 1 ft. I was successfully able to convert my stream to 3D using a Water Surface Grid and the Interpolate ...
0
votes
2answers
34 views

Convert multiple JSON files to a single shapefile or geodatabase feature in ArcGIS or Python

I have been querying one feature in Esri ArcGIS REST Service, but because it is a large data, I had to query it several times (1000 features query limit). This results in many JSON files as parts of ...
-1
votes
0answers
10 views

Contiguity weighting with “touch” predicate in PySAL? [closed]

I want to compute a contiguity weight matrix in PySAL. I've looked at Queen and Rook contiguity, but I realised some of my data share no vertices, they only have touching edges. In order words, I ...
1
vote
1answer
38 views

How do you validate longitude and latitude coordinates in Python?

I am working on a bunch of shapefile data, and I need to process it and after some kind of processing, I need to feed the data to an indexer (in this case ElasticSearch). The problem is I just ...
-1
votes
0answers
12 views

Q: Scripting the generation of DEMs from Sentinel-1 imagery? [closed]

I'm interested in ways to automate the generation of DEMs from Sentinel-1 SAR data over a particular region. Is there a way to script the DEM generation, preferably from Python?
-3
votes
0answers
17 views

How do I filter out all unique file names in a Windows 10 folder? [closed]

I have a folder that commonly has files go in and out of it via task scheduler. These files (.docx, .pdf, .png) are added to the folder through another script and are added with a duplicate named file ...
-1
votes
0answers
17 views

I accidentally made the print function into a variable name [closed]

Silly me.... I accidentally made my print function into a variable name by typing "print = something" in Jupyter notebooks. How can I undo this?
1
vote
1answer
25 views

Test Schema Lock does not catch open feature class from within ArcGIS Pro

I am working on a script tool to be run in ArcGIS Pro (version 2.4.0 with Python 3.6.8) and wish to give the user a warning message and also time to close a feature class so as to avoid the script ...
0
votes
2answers
31 views

Crop two rasters to common extent where pixelvalues are not nodata

I hope this doesn't get too confusing. I have two raster that overlap in a certain region. Like the following: What I would like to have, are two raster that only have values in the region where ...
0
votes
0answers
18 views

QGIS 3.6 Model works but exported python script gives false results

I would greatly appreciate if somebody can help me out here. As the title says, in QGIS 3.6 i made a model calculating "Forest fire susceptibility index - RC", model works fine and gives correct ...
0
votes
1answer
17 views

ArcMap 10.7 Python Label Expression - compound. expression verified but will not label. Syntax issues

I have road ID labels in a string field that need to be parsed down. I'm using the python advanced label expression. I've removed the preceding '0s' successfully as well as some known text. Issue - ...
2
votes
1answer
27 views

Check Conditions on Geopandas

I have a GeoDataFrame : df gid complement geom 0 0 None POINT (601719.697 6316169.550) 1 1 None POINT (889885.470 6766441.264) 2 2 None POINT (841297.833 6819921.974) 3 3 ...
0
votes
1answer
30 views

pyqgis3 atlas feature scale

i was create a simple export code using pyqgis3 and atlas print composer map layout on QGIS3. my question is about map scale. if i use this line : mapScale = map.scale() i take the scale from map ...
1
vote
1answer
19 views

Rasterio creating composite/stack much larger than the individual bands

I am using rasterio to create a stack of eight bands and each individual band is about 1GB, but when it's stacking them the output (with a lzw compression) is a tif that's over 53GB! This seems huge ...
1
vote
0answers
16 views

Points within “normal bounds” of a linestring in Python

I am working in Python (using Shapely). I have a list of Point(s) (the small circles in the image) and a LineString (the solid line with an arrow). I want to select only the points which are within ...
2
votes
1answer
21 views

Generating sampling points - making a series of points in the horizontal centre of a long polygon, equidistant spacing on vertical axis

I have a polygon showing the extent of a beach. I would like to create a series of sampling points along that beach, that are equally spaced north to south (say at increments of 100m to the northing ...
0
votes
1answer
17 views

Computing annual spatial (zonal) statistics of a NetCDF file for polygons in shape-file [closed]

I have a NetCDF-file containing annual GDP data for Africa. I also have a shape-file containing provinces in Africa as polygons. I now want to compute statistics (ie. mean, sum, ...) per polygon ...
0
votes
0answers
10 views

sqlite3.OperationError: Module not found when using pylandsat api

I installed pylandsat to download some landsat 8 imagery I need. there is command line interface I was using in the following fashion: pylandsat search --begin 2017-01-01 --end 2017-01-30 --sensors ...
2
votes
1answer
57 views

how to remove small water bodies in binary mask array that we get from ndwi values?

I've detected water bodies in satellite images (modis, sentinel, landsat) in special area polygons, by ndwi values and based on special thresholds. area polygons and image tiles are coordinate ...
0
votes
0answers
16 views

When I get the total bounds of a shapefile, which are llcrnrlon, llcrnrlat, urcrnrlon, and urcrnrlat? Need it to use Maptlotlib Basemap

The goal is to use an ESRI webmap as a basemap beneath a shapefile for a script that visualizes earthquakes in the Philippines. But first, I'm practicing in using Basemap in a separate script. ...
0
votes
0answers
18 views

Buffering multiple features according to an attribute field?

I'm trying to build a buffer tool with Python that will function according to the attribute field that contains varying widths. I am building a inventory of streets and need to add a buffer to the ...
2
votes
0answers
26 views

GeoPandas .sjoin polygon in polygon - works fast for some countries, but not for others

I am new to working with geodata. Setup: GeoPandas, Python3.6 I have a dataset of square polygons of 10x10km for countries. However, some of these squares are already completely in a neighboring ...
1
vote
0answers
12 views

Rasterio mask removes alpha band

I have a geotiff image that I am clipping to a geojson polygon using rasterio. When I load input the image in QGIS, it has an alpha band (4 bands total). rasterio says it only has 3 bands, which ...
1
vote
1answer
16 views

Merging sets of polygon from adjacent image tiles

I have two geodataframes that describes objects in two adjacent tiles. I would like to merge these two dataframes so that I can obtain a single dataframe that contains all the polygons. Using the ...
0
votes
0answers
6 views

Sentinel-2-L2A band compositing

Is it possible to create features from composite bands for the task of crop type classification using machine learning and python? (just like using NDVI data).
1
vote
0answers
22 views

Value error when trying to load line and polygon GEOJSONs into PyCharm/Python

I'm a newb so apologies if there's incorrect formatting etc here. I'm trying to use GEOJSON files to visualise some data in Python using GeoPandas (GDAL, fiona, shapely, numpy, matplotlib are all ...
-1
votes
0answers
18 views

How to get a subpixel accuracte pixel index value for a given coordinate using python?

I use this rasterio function as I found in this example to get the pixel index values for a given georeference location in a georeferenced raster .tif file. For visualization purposes I use these ...
1
vote
0answers
25 views

Create a polygon from selected points using PyQGIS

The problem im having is that when I select the points, I cannot get a sorted list in order of selection, so the polygon ends up being created in unusual shape. the important code is below. def ...
0
votes
0answers
8 views

Correlation-Calculation with missing values

I want to do a pixel-based analysis to detect the crop-type over a year using HLS data. So far I managed to get curves for NDVI of different crop-types over a year and my data for each pixel. Since ...
0
votes
0answers
36 views

Plotting a csv file containing latitude and longitude into DEM (geotiff file)

I produced an elevation map. I want to plot my csv file named 'Coordinates.csv' that contains latitude and longitude points to my DEM (geotiff file) and the elevation map I produce will turn into ...
0
votes
1answer
44 views

Loading GeoDataFrame as QGIS vector layer without exporting to shapefile

I'm using Python console in QGIS to manipulate geospatial data using geopandas. I want to load the output (GeoDataFrame) to the canvas as vector layer directly without exporting it to a file first. Is ...
2
votes
0answers
24 views

Getting a warning of “unexpected argument” for PyQGIS processing parameter in PyCharm

When specifying named argument for any type of QgsProcessingParameter, PyCharm complains of an Unexpected Argument warning. Although it doesn't cause any issue to the execution of the Processing ...
-2
votes
0answers
22 views

I am trying to extract data from tables by giving date and code exit with 0 but not able to see rows [closed]

I am trying to extract data from tables by giving date and code exit with 0. However, I am not able to see rows. What am I doing wrong? import pymysql import json import datetime def ...
-1
votes
0answers
29 views

Geocoding according to the text in a string?

I am working with a pandas dataframe that is light on details but needs to be geocoded in the most accurate way possible. There are about 2,000 rows and each row represents a unique event that took ...
0
votes
0answers
37 views

Converting QGIS X,Y info to lat, long using Python

I am trying to convert QGIS x,y points into the lat, long coordinates. I have (335687.7471962841, 4487822.535352517) supposedly point to somewhere in the Chicago metropolitan area. I tried the ...
-1
votes
0answers
18 views

Predicting LAI values from from vegetation indices [closed]

I am working on a project which involves using satellite images to predict LAI values based on field derived LAI computed from DHPs in CAN-EYE software. I have everything set but with a challenge on ...
0
votes
0answers
15 views

Obtaining latitude and longitude on Earth from Satellite location and pointing angles

Considering the Earth as a perfect sphere and knowing the position (latitude,longitude and height) of a satellite. I would like to transform the pointing angle from the satellite (defined by two ...
1
vote
1answer
25 views

Defining atlas feature margin using PyQGIS3

I want to create a simple atlas composer map using PyQGIS3. My question is about atlas feature scale. I want to use this settings from image. I know this select option but I don't know how to add ...
0
votes
0answers
34 views

Plot Exponential Equation on Graph [closed]

Having pieced together code from a number of different StackExchange questions I have managed to plot a correlation analysis graph with an exponential curve for land surface temperatures and heat ...
3
votes
1answer
123 views

PyQGIS in PyCharm 2020

I know this problem appears over and over again, but maybe someone can help me. I've read many articles on GIS StackExchange on the topic and I'm referring to this post: Why does QGIS 3.2 "...
2
votes
1answer
34 views

Dealing with NAN values in my training dataset

I am new to remote sensing. I am working on a project where I need to perform land use land cover classification. For such a task I want to use machine learning (python). My features contain 'BANDS' (...
0
votes
2answers
67 views

Display only the points that are inside a polygon [closed]

I have a series of points and a polygon. Using PyQGIS, I would like to display only the points that have the coordinates that are within the polygon area. (In this case I would like to display only ...
0
votes
0answers
25 views

Trouble using IF statement for adding and renaming output layers [closed]

I have created a model using ModelBuilder. The model has multiple outputs (I refer to the original output names as XX1 and XX2) which I want to Add each of them to Table of Content (TOC) with specific ...
3
votes
1answer
67 views
+100

Calculate new band for satellite image after predict values with RF

I have satellite image which contains 3 different bands. I'm using Python (jupyter notebook) in order to calculate new band by applying random forest regression. My problem is that after I have ...

1
2 3 4 5
173