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

Plotting Raster Data on tkinter canvas using Rasterio

I am trying to plot my Raster Data on tkinter canvas using the following code: import tkinter from matplotlib.backends.backend_tkagg import ( FigureCanvasTkAgg, NavigationToolbar2Tk) # Implement ...
0
votes
1answer
19 views

GeoPandas sjoin with extensive quantities

I have one geodataframe that contains polygons and corresponding land use category (e.g. agricultural, commercial, retail, residential, ...) and another that contains census tract polygons and ...
0
votes
1answer
14 views

Overpass API returns points instead of polygons

I'm able to retrieve geojson using the following call to the Overpass API for boroughs in London: import overpass api = overpass.API() response = api.get('relation(1811626);>;out;') However the ...
1
vote
1answer
8 views

Python ImportError with libgdal, undefined symbol: opj_codec_set_threads

GDAL and its Python 3 bindings have been installed through apt package manager for weeks, but, suddenly: from osgeo import GDAL ------------------------------------------------------------------------...
0
votes
0answers
11 views

Building image classification model from raster images and shapefile that contains labels?

I have a satellite raster image of a land taken from sentinel2 that is composed of 14 bands, a train shapefile that is composed of polygons that represents different farms in the region, each polygon ...
0
votes
0answers
13 views

Subtracting Roads from Raster Image Overlayered by Atlas Road Map Image in Python? [on hold]

I have two raster images A and B. One is a satellite image and other a snipped screenshot of atlas map containing roads in red color. Both images are of same scale/ zoom level. I want to now stack ...
0
votes
0answers
16 views

Error copying environment to Anaconda3\envs? [on hold]

I tried to copy environment to another PC before and it worked with me Now I got the error below . This application failed to start because it could not find or load the Qt platform plugin "windows" ...
0
votes
2answers
29 views

GeoPandas: plot two layers but only to the extent of the smaller one

I am using GeoPandas and I want to plot two layers. I want the map to have the extent of the smaller layer. With this code below, the map's size automatically fits the bigger layer. import geopandas ...
1
vote
1answer
29 views

Importing CLR in QGIS python?

I created a plugin and I added my separate python file(added in plugin path itself) in the created qgis plugin. In that separate python file, I called a DLL file like below, import sys import clr ...
2
votes
0answers
42 views

Applying filter on the geometry for a given feature?

I have multiple layers, with multiple features, where I am interested in extracting information from a given feature within a rectangle. I am able to achieve this using the following filter, ...
1
vote
1answer
36 views

No module named 'arcgis' for import GIS

I have ArcGIS API for Python installed and when I use below line, am getting error as ModuleNotFoundError: No module named arcgis from arcgis.gis import GIS Please refer to Image
1
vote
1answer
23 views

What format is NEXRAD level 2 data in?

I am trying to download raw radar data off of https://s3.amazonaws.com/noaa-nexrad-level2/index.html The files do not have extensions. What format is the data in (grib, netcdf, etc.)? How do I ...
1
vote
1answer
18 views

Create Query either using Select by Attributes or Python

I am working on something for my job, where I have a list of water/sewer service customers. Some customers have one service or the other, while others have both which is stored as two separate entries....
0
votes
1answer
42 views

Reading LAZ file in Python directly?

I am able to read .las file in Python using laspy in Windows as below: las_filename = 'abc.las' inFile = laspy.file.File(las_filename, mode='r') But when I put a .laz file in this code, I get the ...
0
votes
0answers
17 views

Tools for programmatically finding a large flat site using height map data [closed]

I want to find the best location for a large science experiment. It requires two long (multi-kilometer), flat "arms" about 20 m wide separated by an angle between 45 and 90 degrees. I want to use ...
0
votes
2answers
47 views

Temporal combination of Raster files?

I have a set of time series daily raster files, I want to have a temporal combination on daily bases. As an example I want to combine day1 with day2 and day2 with day3 and so on. The file name are ...
0
votes
0answers
9 views

Adding RGB values from a .txt file to a .las file using laspy

I have a text file that has XYZ and RGB values in it. To convert it to .las format i use lfile = laspy.file.File(r"D:\las\tolas.las", mode='w',header=LasHeader(x_scale=0.01,y_scale=0.01,z_scale=0.01))...
1
vote
2answers
97 views

Reading big raster getting warnings using GDAL Python

I am trying to use GDAL Python API to deal with some big raster, and when I read these rasters into Python, I get warnings like that: Warning 1: TIFFFetchNormalTag:ASCII value for tag "GeoASCIIParams"...
3
votes
2answers
53 views

Upscaling Raster Data in Python

Solved @user2856 helped me crack this. import geopandas as gpd import rasterio as rio from rasterio import features from rasterio import Affine from rasterio.enums import Resampling results = [] ...
2
votes
0answers
53 views

“RasterioIOError: This is a BigTIFF file. BigTIFF is not supported by this version of GDAL and libtiff” error message

I am trying to read a raster ".tif" file with rasterio: import rasterio raster_path = r'.........\file.tif' raster = rasterio.open(raster_path) but I am getting the following error message: "...
-2
votes
0answers
14 views

Need python idle with pre-coded toolbox [closed]

I need python toolbox with pre - installed set of label , buttons, which is similar to visual studio toolbox .Is there any python idle available with set of pre-coded toolbox ?
1
vote
0answers
32 views

Plotting CDF of the values in a raster (.tif) file, using Python or QGIS?

I have a tiff file with some values and I want to read those values and plot a CDF (Cumulative Distribution Function). So far I only know how to get the mean value from osgeo import gdal gtif = gdal....
0
votes
1answer
92 views

Length of intersections from a linestring and a grid shapefile by using Python geopandas & QGIS

I am using Python geopandas and I have two shapefiles. One of them is a grid file containing equal polygons. The other shapefile is a linestring file with several lines and its Attributes. The idea ...
3
votes
1answer
36 views

Find duplicate point geometries in a shapefile [closed]

How to find a duplicate point geometries in point shapefile (around one lakh geometries) using Python OGR/GDAL
2
votes
1answer
42 views

Making polygon shapefile from unsorted point shapefile?

I have a point Shapefile with unsorted feature ID's (FID). I want to convert the same point file into polygon Shapefile by using python gdal/ogr. I got the help from link1 and link2. I'm able to make ...
2
votes
1answer
25 views

'Must have equal len keys and value when setting with an iterable' error message

I have a postgres spatial table that I want to convert to a geopandas GeoDataFrame. In order to do so I wrote the following piece of code: #'pg_tab_clip' is the name of the postgres spatial table #'b'...
1
vote
1answer
30 views

Make imagecollection from list of images through a for loop in Earth Engine Python API

I try to code Mosaicking a Image Collection by Date (day) in Google Earth Engine this issue with Python. #Load Sentinel 1 and filter data def load_dataset(ImageCollection_ID,begin,end,aoi): ic = ...
1
vote
0answers
33 views

Multiprocess Spatial Join with Spatial Index

I'm a newbie in implementing GIS on Python, but the lack of any GIS software at the office has forced me to learn about it. I have a huge grid (a multipolygon) that I'm currently filling out with ...
2
votes
1answer
54 views

Georeferencing a numpy tensor (spatio-temporal data)

I have a CSV file in which each row represents a record of an event with the following columns: latitude, longitude, time I want to build a numpy tensor with n x m x 8760 (hours in a year) ...
0
votes
0answers
13 views

Missing area when using tabulate area in ArcPy?

I create a polygon layer including 80 buffer areas (they are not overlapping) and want to get the area of each value of a raster file for each buffer area. I can use the tabulate area to realize this ...
1
vote
1answer
45 views

Cutting a portion of a satellite image based on coordinates in GDAL?

I have a satellite image of 7-channels (Basically I have seven .tif files, one for each band). And I have a .csv file with coordinates of points-of-interest that are in the region shot by the ...
0
votes
0answers
40 views

Checking for geospatial similarity in Python?

Say I have two pandas dataframes in a format similar to this one where each 'Point' represents a person and where they were at. Assume that there are multiple line strings representing different ...
0
votes
0answers
21 views

NotImplementedError: Wrong number or type of arguments for overloaded function 'CoordinateTransformation_TransformPoint'

Hello I am new to working with GeoTiff data and I am trying to grab lat/lon values from a tiff image. Here is my code: import gdal import matplotlib.pyplot as plt import osr # open the dataset and ...
1
vote
1answer
22 views

GDAL's Python wrappers don't load correct asc header informaton

I have a Python script that I am using to load .asc raster files and then work with the contents therein. However, it isn't loading the correct information that is specified in the headers. The .asc ...
0
votes
0answers
32 views

WindowsError: [Error 32]

I get a windows error when trying to run my tool again in the same arc project. It does run again once I shut down ArcMap and reopen and run the tool. Any Ideas? import arcpy, os, shutil, sys # ...
2
votes
0answers
39 views

Shapefile or GeoJSON? [closed]

I'm interested in understanding the relative merits of using GeoJSON or shapefile formats for handling geo-spatial data, particularly in an open-source, Python (CKAN project), web-development context. ...
0
votes
2answers
43 views

arcpy Polyline.within(Polygon) return False for all lines between pairs of Polygon vertices

I'm trying to develop a function which will find the longest straight line length that can be drawn within any of the polygons in a feature class. (To keep things simple, I'm only including lines ...
0
votes
0answers
21 views

Import Arcpy error [duplicate]

I am having an issue with importing arcpy. Initially I thought that it might be that the version of the Anaconda software that I had been running was 64 bit, therefore I changed it to 32 bit to try ...
0
votes
0answers
13 views

Correcting an inaccurate edge effect on MODIS L2 swath data?

I am currently trying to process a MODIS MOD10_L2 product (Snow Cover 5-Min L2 Swath 500m, Version 6) to extract snow cover information. It's in HDF-EOS format and I process it with GDAL in Python and ...
1
vote
1answer
21 views

How to determine column value based on lowest value from other column? [closed]

I have the following dataframe with same value in 'nearest_beacon' column but different distance in 'vms_distance' column. My Dataframe: nearest_beacon vms_distance associated 4548780 0.486456 ...
1
vote
0answers
14 views

I am trying to create an NDVI image using an RSGISLib python script, but it is displaying no data values

My script runs fine and creates an output, but the output is displaying values all the way down to -999, rather than just having the values present in the NDVI result (0-1). I can create an NDVI image ...
1
vote
0answers
30 views

Converting non projected x,y coordinate into a specific projection in a 2D array

I created a 2D array and after applying Gaussian filter I find centroid of all the connected pixels with values equal to 1 and then save it with the projection EPSG:3413. Using skimage.measure.label, ...
2
votes
0answers
27 views

Plotting Geopandas Gallery example fails?

I have been having trouble getting the figures from the example provided in Geopandas Gallery examples. When I ran these scripts in Jupyter console: import geopandas import geoplot import matplotlib....
1
vote
1answer
47 views

ERROR: Could not find a version that satisfies the requirement qgis

I want to use the RQGIS library(RQGIS) # set the environment, i.e. specify all the paths necessary to run QGIS from # within R set_env() Trying to find QGIS LTR in C:/OSGEO4~1 $`root` [1] "C:/...
1
vote
1answer
36 views

Filter fields by expression arcpy

I have to trasform a script (which I didn't write myself) from QGIS to ArcMap. In the script a filter by expression is used. The function has the input inl (= the layer with the data that should be ...
1
vote
1answer
32 views

NetCDF: Why store coordinates as matrix

I am reading the documentation of Python library xarray After having opened multiple NetCDFs and explored their contents, I see that some files store their coordinates as a matrix and some store ...
0
votes
0answers
21 views

Return corner coordinates of images after OpenDroneMap processing

I have images (with EXIF metadata) made by a drone relative to a particular place; having processed them with OpenDroneMap at this point I have an orthophoto with all the geolocated pixels. At this ...
2
votes
1answer
52 views

Polygon area from Google Earth so different to QGIS & Shapely/PyProj?

I have a set of points defined by their longitudes and latitudes in WGS84 that define a polygon that I need to calculate the area of. I originally tried to approach this using pyproj and Shapely as ...
1
vote
1answer
39 views

Opening a BigTIFF file in Python

I am trying to open and extract data from a 90MB TIFF file using Python. The code I'm using is the following: from osgeo import gdal, osr, ogr def get_value_at_point(rasterfile, pos): gdal....
2
votes
1answer
37 views

Retaining last position of vessel position in geodataframe including time series?

I have geodataframe about vessel position which include unique code called 'mmsi' and time series. In the following 'mmsi' column has more than 1 'mmsi' code and time series (* mark). mmsi ...