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

How to add feature to auxiliary layer and commit changes to auxilliary field in QGIS 3.x?

I can't figure how to do that, here is my code : auxKeyField = myLayer.fields().field(myLayer.fields().indexOf('id')) auxStorage = QgsProject.instance().auxiliaryStorage() myAuxLayer = auxStorage....
1
vote
1answer
13 views

Matching points to polygons and handling points NOT in polygons

I have two GeoDataFrames: one with 191k address points and another with 18 polygons representing catchment areas for specific schools. Theoretically, every address should fall into one of the zones. ...
0
votes
0answers
26 views

Clipping raster using multiple shapefiles using gdal in Python

I am currently using batch process in QGIS based on clip raster by extent to clip geotiff raster layers based on different shapefiles. I am trying to clip many raster layers from the same region with ...
0
votes
0answers
12 views

Reproject CRS for Raster Layer (PyQGIS)

I currently have a script that adds, runs statistics and exports a map. However, when I look at the export of the map, my base map is missing from this map. I think this is due to the .xml base map ...
0
votes
0answers
20 views

GeoPandas legend not displaying correctly the colors

I need a legend where for every bin that I defined there is a color from a colorscale. I wrote this: ax= merge.plot(column=dates, figsize=[15,15], cmap='OrRd', ...
0
votes
0answers
10 views

How to query all branches of a specific bank in a spcific city

I would like to know how to query for an example all the amenities that are named Deutsche bank in a city named Berlin in Germany. Below is my attempt. Furthermore, please let me know the meaning of ...
0
votes
0answers
15 views

Clustering adjacent polygons with values over a given threshold with Python

I have a GeoPandas dataframe that looks like the following geometry raster_val 0 POLYGON ((1.85626 49.12003, 1.85626 49.11171, ... 28.530001 1 ...
0
votes
0answers
11 views

Using the function “directionalDistanceTransform” from Google Earth Engine on local data

I am trying to implement the function directionalDistanceTransform from Google Earth Engine API to run it on my local GeoTIFF, so I was looking at Google Earth Engine's GitHub project to find that ...
0
votes
0answers
37 views

Adding delimited text layer with Python outside of QGIS

I'm trying to create a QGIS project using Jupyter environment. Until now I managed to add a Raster layer. I now want to add a csv file, in QGIS I would add it like that: Layer -> Add Layer -> ...
1
vote
1answer
37 views

Is there some string-like format I can use that would encapsulate what is in a GIS file?

I'm running comparisons to find if there was a change in data. I'm using GeoTIFF and GPKG files (GeoTIFF will be compared to GeoTIFF and GPKG will be compared to GPKG). I have a database with ...
0
votes
1answer
21 views

GDAL point ordering (difference in version 2.2 and 3.0) Python

I'm currently trying to update some legacy Python code from gdal version 2.2.3 to 3.0.2, (along with python 2 > python 3) I need to generate contours and unpack the points, along the lines of: _, ...
0
votes
0answers
28 views

Iterating over dataframe and checking points using shapely

I am getting the error when I try to delete row from dataframe. The code checks if polygon contains points. If not I would like to delete this row, but I am getting the error. Why? Error: IndexError: ...
0
votes
0answers
18 views

Predict continuous variable (forest biomass) using trained Tensorflow model

I want to predict forest biomass over my study region. To do that I have trained Tensorflow model using field data (70 Temporary forest plots) and some remote sensing variables that i've extracted ...
0
votes
1answer
28 views

Understanding the spacial reference/How to get latitude and longitude from a .las LiDAR file

I have downloaded some .las files from a LiDAR project listed on the USGS website. I am hoping to process them in Python. I was able to get the set of X,Y, and Z points using the following snippit in ...
0
votes
0answers
37 views

How to write merged geodataframe to shapefile

Tried the following code. I am able to see the merged data in the console but I don't get any output file. Running my code does not raise any errors either. import geopandas import pathlib import ...
0
votes
0answers
22 views

Programmatically change field heading type in qgis2web plugin

I have a dozen layers each with more than a dozen fields. When I run the qgis2web plugin, there are 3 options on how each field can be displayed (no label, inline label, and header label). I do not ...
0
votes
0answers
26 views

Extracting geometry for each child of GeoJSON [closed]

I have this data as a GeoJSON (the JSON can be found here). What I am trying to accomplish is that, for every region (region == children in this dataset), get a row that looks like this: id name ...
0
votes
0answers
19 views

Match a list of shapefile names to list of raster names then do something

I have a list of shapefiles and a list of rasters that I would like to match the names then do some data extraction for later analysis. The beginning of each raster and shapefile begins with "...
0
votes
0answers
18 views

ReduceRegion(s) Google Earth Engine Python API

I'm trying to find the area of a classified land cover across the study area using the Google Earth Engine's Python API. I am trying to do this by mapping a .reduceRegion function across the image ...
0
votes
0answers
10 views

Extracting data from a .mat file with numpy and a mask

I have the output of a xBeach model run in .mat format. There are several layers that represent the sea status for each time-step. In each layer there are the coordinates and the water level of the ...
1
vote
1answer
29 views

Crop a raster image with the coordinates in a CSV file in Python

I am trying to crop a satellite image with geographical coordinate from a CVS file. I have never cropped an image using coordinates from CSV file. I tried searching a lot but I can only find cropping ...
3
votes
1answer
32 views

Converting a string to LineString

I have a string read from a csv file: 'LINESTRING (-79.494722 43.777724, -79.494805 43.777636, -79.49503799999999 43.777581, -79.495277 43.777524)' I want to convert this string object to shapely....
1
vote
2answers
42 views

Selecting attributes by coordinates from DataFrame in Python

I wonder how to return the right information needed from this df. Currently I get an empty return. I think the problem is my selection because the coordinates are correct and all variables are as well....
0
votes
0answers
23 views

Bounding Box to UTM [closed]

I am given the centre of a bounding box in (lat,lon), the width and height in meters and the heading in radians. Output the 4 corners of the BoundingBox and the center in local coordinates. I am able ...
-2
votes
0answers
24 views

Creating a program to calculate the geometric centroid [closed]

I want to create a program to calculate the geometric centroid of a polygon using coordinates stored in a file csv file. The coordinates are stored as point name, Easting, Northing (i.e. A, 1000, 500)....
1
vote
1answer
52 views

Problem transforming coordinates with PyProj

I would like to plot a marker using the Folium library but the data I have is in ETRS89 and Folium does not accept that projection. I am having problems transforming from EPSG25830 (ETRS89) to ...
1
vote
0answers
19 views

Adding custom names to a GeoPandas legend

I have a shapefile which has an attribute table with a column I would like to make a map/plot of. The attribute values are numerical (integer). I have made two dicts to map the colors and names I want ...
0
votes
0answers
17 views

Remove or trim all but the docID from the URL [closed]

I have a URL field which looks like this: https://eaglerw.mohavecounty.us/recorder/eagleweb/downloads/2000012081.pdf?id=DOCC2000012081 the data has moved and the URL has changed, but the doc IDs ...
1
vote
0answers
19 views

Web GIS with NetCDF data

I have NetCDF data and am trying to transform this into JSON, using Python, to then use in a web sig (NCWMS server). By transforming this into JSON, could I display this same data dynamically (with ...
0
votes
0answers
15 views

Command to download specific Sentinal-1 scene from Copernicus using Python [closed]

There are lots of articles about batch downloading or getting a scene that satisfies a specific set of requirements. How do I download an image if I already know the exact file string name, preferably ...
1
vote
1answer
30 views

Creating a grid from pixels of a georaster in Python with GeoPandas

Let say we have a georaster file with a given resolution. Is is possible to create a grid where each cell of the grid correspond to each pixel? Is it possible to store this grid as a GeoPandas ...
0
votes
0answers
20 views

Georeferencing a GeoTIFF using with RasterIO

I am trying to Co-register a raster using Ground Control Points w.r.t. another raster using RasterIO. I have written a PoC, but having a bit of difficulty in measuring the quality of the final ...
1
vote
2answers
28 views

GeoPandas dissolve using an attribute filter

I am wondering if it is possible in one pass to use GeoPandas' dissolve to merge together only the records matching a query. Specifically, I have many small areas that should be merged to the larger ...
0
votes
1answer
26 views

Error in image.visualize: Creating NDWI animation series for Landsat 8

I'm currently working on QGIS with GEE plugin, making NDWI animation series for Landsat 8. Im getting a error in image.visualize: Expected a string or list of strings for field 'bands'... at the end ...
1
vote
0answers
28 views

Defining CRS with tifffile - export .tif

I am trying to figure out how to define/keep my images CRS throughout a splitting script I have written. I tried adding metadata={'init': 'epsg:3857'} when calling tifffile.imsave(dir_out, image), but ...
0
votes
0answers
30 views

Using GeoPandas to generate shapefile from GeoJSON that could be open for ArcGIS

I got from an API a layer of parcels in format GeoJSON, just like the file in this .zip https://www.dropbox.com/s/5eqi8bbqt6ej6lc/json_data.rar?dl=0 I need to convert this to a shapefile that could ...
1
vote
1answer
18 views

Splitting a BigTIFF using tifffile

I am having trouble splitting a BigTIFF. I am orginally using @Ivan code from this question. I had to modify it a bit since I am using a .tif that was larger than 4GB. Pillow does not support BigTIFFs....
1
vote
0answers
16 views

Spatial join two identical layers

I'm working with Python and GeoPandas. I have two parcel layers that are identical and in the same coordinate reference system. The parcel number field is not unique so I am unable to join on that ...
0
votes
1answer
7 views

How to retrieve answer from sendfile_osm_oauth_protector

I made a request by using the enter link description heresendfile_osm_oauth_protector from subprocess import check_output command = "curl -b 'text from cookie_output_file' https://osm- ...
1
vote
1answer
13 views

Assigning multiple Customize keyboard shortcut keys for ArcMap

I am using ArcMap 10.1 and 10.2.1. I have attached the below image for reference. I want to assign multiple Customize keyboard shortcut keys at the same time. Is it possible do this using ArcPy/...
1
vote
1answer
32 views

Checking if geopoint is in shapefile containing world cities

I have approximately 13 million (lat,long) geocoordinates. I also have a shapefile containing 3460 cities. I need to find the City in which this geocoordinate can be found. This is what I am currently ...
0
votes
0answers
13 views

Problem with Python code to visualize a map in the geospatial analysis

You can download relevant files to execute my python code as below: https://drive.google.com/drive/folders/1WmkZ9t3RnAsd4Dy83TRdjWIsAdby4IwI I want to visualize data at the postal code level with ...
0
votes
0answers
24 views

Choosing coordinate reference systems for esriGeometryPolygon in GeoPandas

I extracted a layer of parcel Geometry Type: esriGeometryPolygon and save as JSON, this is a fragment of one row of this JSON: { "attributes": { "OBJECTID": 171195, &...
0
votes
0answers
19 views

overpass api too many requests

I want to get specific users data from OpenStreetMap. I use Overpass API, but I get an error: overpy.exception.DataIncomplete: ('Data incomplete try to improve the query to resolve the missing data', ...
1
vote
0answers
16 views

Opening gkpg in geopandas throws: UnsupportedGeometryTypeError: 12

I wanted to open a gkpg file in geopandas 0.8.2, on windows, using conda mith channel conda-forge obj = r'path.gpkg' layer="layername" gdf = gpd.read_file(obj, layer=layer) Throws the ...
0
votes
0answers
16 views

'Zonal statistics as table' on hundreds of layers [closed]

I am new to GIS. I have over 600 layers (.bil format) that I want to use a 'Zonal statistics to table' on. The 'input raster', 'zone field' and 'statistic type' are the same for all the layers. I want ...
1
vote
0answers
24 views

Python shortcut to find the distance between two coordinates points from different zones [closed]

I am trying to find the distance between two points on different coordinate zones. I am referring to this Measuring distances when crossing UTM zones? and don't understand anything from it.
0
votes
0answers
21 views

Retrieve overpass data with custom poly

Is it possible to retrieve osm data by using overpass api, for a specific boundary area? I have a custom area in poly format (can change it to geojson) and I would like to retrieve the ways edited by ...
1
vote
1answer
37 views

How to ensure ArcPy CalculateField expression runs if one or more input shapefiles from workspace are missing a field referenced in that expression?

I have a basic ArcPy script that reads an input folder of shapefiles, copies them to a separate output folder, defines this output folder as the workspace and then performs a CalculateField action, ...
0
votes
0answers
10 views

Anyway to integrate QGIS in Visual Studio Enterprise/Community?

I would like to ask if it possible to integrate QGIS in Visual Studio (either enterprise or Community)? You see I am developing for a python based application which request JSON data from an API. The ...

1
2 3 4 5
194