Questions tagged [python-3]

Use this tag when Python 3 (or any of its dot releases) is the version you are using.

Filter by
Sorted by
Tagged with
3
votes
5answers
8k views

Ipyleaflet map object doesn't display in Jupyter Notebook but it gets created

When running the code from the example (https://ipyleaflet.readthedocs.io/en/latest/api_reference/map.html#example), no map get displayed. from ipyleaflet import Map, basemaps, basemap_to_tiles m = ...
1
vote
0answers
132 views

ArcGIS Pro Python Toolbox - env.workspace being 'forgotten' after using Spatial Analyst tools

EDIT I've narrowed down the cause of the problem to the spatial analyst toolbox. After using an SA tool, arcpy seems to temporarily 'forget' the env.workspace setting: Subsequent attempts to reference ...
0
votes
1answer
363 views

Debugging Error: Algorithm gdal:dissolve not found in PyQGIS?

I have difficulties with the processing package. I try to run a simple QGIS dissolve in pyQGIS 3. When I run the line : from qgis.core import QgsVectorLayer import processing from processing.core....
1
vote
1answer
733 views

Installing Python bindings for 64-bit Python on Windows

I installed GDAL and its Python bindings from GISInternals. While I believe that GDAL was installed correctly, the Python bindings have an issue. After opening a file with gdal.open I cannot read ...
6
votes
1answer
321 views

Get xy coordinates of QgsMapCanvas in PyQGIS 3?

I am trying to get the QgsMapCanvas coordinates when they change using PyQt5 and PyQGIS 3. What I have used for that: self.canvas.scaleChanged.connect(lambda: self.showScale(self.canvas.scale())) ...
0
votes
1answer
24 views

Does not display Map in Rstudio using Python Package - GEEMAP

I am trying to use the GEEMAP package of Python in RStudio-1.4.1106. After importing the packages and running the code shown below MAP is not displayed rather it displays the MAP attributes in the ...
1
vote
1answer
70 views

Transform Google Earth Engine script to Python with Landsat 8 temporal data

I am doing a study for my work and I need to adapt my Google Earth Engine script in Python, but I am encountering some problems. Here is a Google Earth Engine script: //Importing image and geometry: ...
0
votes
1answer
55 views

FionaDeprecationWarning: Collection.__next__() is buggy and will be removed in Fiona 2.0. Switch to `next(iter(collection))`. record = next(c)

I have some Python3 code used to import shapefiles using fiona. This is the main set of lines: I created some code (Python3) with these lines: c = fiona.open(dataDir + "/" + sourceFile, ...
2
votes
1answer
1k views

Run Python 3 scripts on ArcGIS Server 10.5

Is it possible to run Python 3 scripts on our ArcGIS Server 10.5 running Windows? I have a script that I want to publish as a geoprocessing tool that exports an .aprx (ArcGIS Pro) file to a PDF using ...
1
vote
2answers
733 views

Using ArcPy with Python 3.7 instead of default Python 2.7 that comes with ArcMap 10.6.1?

I want to use ArcPy with Python 3.7. I tried setting the paths to arcpy but Python 3.7 doesn't import arcpy properly. Is it possible to use a Python version outside of default version that ships with ...
0
votes
0answers
891 views

Visualize big data HTML file created with Folium

I have written a Folium map of a French city with the possibility of visualizing attributes information on click for each of its polygon which makes a huge file after 2 hours of calculation with the ...
0
votes
1answer
174 views

GDAL & Python 3 environment variable

Newbie here. I've just loaded OSX Catalina on my iMac. I've installed GDAL 2.4 complete from the Kyngchaos site. The install works great for all GDAL commands except for the python ones (...
1
vote
1answer
1k views

Enabling Jupyter nbextension for ipyleaflet?

I was trying to test out this script https://github.com/tylere/PyDataNYC2017/blob/master/ipynb/satellite_analysis.ipynb but got stuck at the iteractive mapping part. import ipyleaflet map1 = ...
0
votes
0answers
45 views

ModuleNotFoundError: No module named '_gdal' on mac machine

I have installed gdal in the following way python3 -m pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL=='gdal-config --version' If I try to call it from osgeo ...
0
votes
1answer
49 views

Extracting only roads through Overpass API query

I am using overpass API and querying the api for ways,as a result it gives points, whereas I need only lines, multiline strings and polygons. But while using the following code, I get a geojson file ...
0
votes
0answers
26 views

How to check integrity of Python-processed shapefile

In my QGIS project of American railroads, using USGS Base Topo Layer and shapefiles giving railroad details as of 2015, I have used the Python-3 pyshp library to edit the dbf database, adding some ...
10
votes
3answers
9k views

Installing external python packages for QGIS 3?

While there are tools and methods for QGIS 2 I cannot figure out for 3 I want to install external Python packages such as sqlalchemy etc. I tried the following things : Tried to download osgeo4w for ...
0
votes
2answers
103 views

Executing QGIS tools in Python from Linux Shell [duplicate]

I would like to execute a Python script which uses QGIS Processing tools. On Ubuntu 20.x I installed qgis, qgis-common, python3-qgis and python3-qgis-common. My objective is to execute the tool Exploe ...
3
votes
0answers
39 views

CalledModuleError: Module run None g.gisenv -n ended with error

I am trying to use r.horizon GRASS module(version GRASS 7.8) in Python script. But I couldn't able to access the grass modules. Everytime, I am getting the following error. File "C:\OSGEO4~1\apps\...
1
vote
0answers
40 views

Deleting GDAL created raster

I am simply trying to delete a TIF that I created with GDAL. I have tried, simply, to use shutil which errors with: NotADirectoryError: [WinError 267] The directory name is invalid: 'T:/p003M01p0001/...
1
vote
0answers
44 views

Why does my arcpy script's da.UpdateCursor get slower the longer it runs?

I have a layer containing pedestrian crosswalks (line features), and two layers containing street data: street segments (line features) and street nodes (point features). Every street segment has a ...
3
votes
2answers
512 views

PyQGIS standalone script using QGIS 3.2

I want to work with PyQGIS Python 3 using QGIS 3.2 standalone install. I created a simple batch file to work with PyQGIS but I have some errors. Here's the batch file: @echo off SET OSGEO4W_ROOT=C:\...
2
votes
0answers
33 views

GRASS GIS: r.out.gdal raises an exception and hangs if it's called multiple consecutive times

I'm using a small python routine (grass.script, pygrass) to handle several operations on sentinel2 imagery. I'm calling r.out.gdal inside the script and a very annoying problem occurs: when it is ...
0
votes
1answer
111 views

Reprojection with gdal.Warp doesn't work

I am trying to reproject a raster. I have tried gdal.Warp and it doesn't work. RuntimeError: Cannot find coordinate operations from 'EPSG:6257' to 'EPSG:6686'. Working in Python 3, Windows 64bit ...
0
votes
1answer
58 views

Using GRASS i.segment in Python 3 stand alone script on Windows10

I installed GRASS GIS 7.8.1 on Windows 10 using a OSGeo4W. I would like to use in a stand alone Python 3 script the i.segment GRASS tool. I saw some related questions (e.g., Using GRASS GIS in Python ...
10
votes
2answers
575 views

What's the difference between QgsPoint, QgsPointXY and QgsGeometry.fromPointXY(QgsPointXY()) in PyQGIS?

I am using PyQGIS. What is the difference between QgsGeometry.fromPointXY(QgsPointXY(x,y)), QgsPointXY(x,y) and QgsPoint(x,y)? When I print these 3 options, I get: print( QgsGeometry.fromPointXY(...
1
vote
2answers
405 views

How can I convert a LineString GeoDataFrame to a Points GeoDataFrame while retaining the vertice order?

I have a LineString GeoDataframe that I am trying to convert into a Points GeoDataframe, but I want to retain the GroupBy and SortBy features inherent in a LineString (i.e., all the vertices that make ...
0
votes
0answers
18 views

CSV to NetCDF Python HDF error

I'm basically cribbing code from Esri and other online sources to convert a CSV to a NetCDF. I get an HDF error on writing values to the variables. X and Y values are UTM coordinates if that matters. ...
1
vote
1answer
110 views

Can't install Packages with Cloned ArcGIS Pro Python

I have a new installation of ArcGIS Pro 2.6 on a Windows 10 computer. I have successfully cloned Python because I want to install third-party packages to this cloned environment and still use arcpy. ...
1
vote
1answer
51 views

Identifying coordinate format from exif data

I am using the Python exif module to extract coordinates from photos. The methods for doing so are: gps_latitude and gps_longitude. The output for latitude is: (32.0, 37.0, 37.15) and longitude is: (...
1
vote
1answer
51 views

Calculating dates and using arcpy.CalculateField_management(

I am in the process of converting my scripts from python 2.7 to 3.x I am trying to calculate a date field with a datetime object exactScriptTime = datetime.datetime.now() exactScriptTime = ...
2
votes
4answers
7k views

Click event on maps with Folium and information retrieval

I was wondering if there is a way in Folium to get the information on an entity we click on with Folium? I'd like the map to either open a tab with the attribute information or just send back ...
0
votes
1answer
40 views

QGIS how to activate the checkboxes of the constractions in the attribute form by Python code and add expressions?

I tried using this type of line for the edit form , but its only for versions 2.8 but I don't know how is for new version 3.0 including "Enforce not null constraint". formConfig = layer....
1
vote
1answer
116 views

How to visualize a NetCDF Dataset

Suppose I have a rather large NetCDF file that I open as a dataset using xarray. import xarray nc_in = r"....\D_P_WGS84_comp.nc" nc_ds = xarray.open_dataset(nc_in) It is composed of ...
1
vote
1answer
393 views

Adding compression to a NetCDF file using xarray

I have a raster that I am trying to compress and convert to a NetCDF format with compression level = 9 using the xarray package. I assume that the compression is added using the encoding parameter as ...
1
vote
3answers
72 views

Drawing points in layer given its coordinates using PyQGIS [closed]

I want to draw points in a certain polygon layer. Specifically, I want to display the centroid over each respective feature. All this using PyQGIS. So far, none of the answers I found helped me. I am ...
3
votes
0answers
64 views

Convert .grib2 in triangular grid to regular grid

I have ICON datasets (.grib2.bz2 file format) from Deutscher Wetterdienst (DWD) in triangular grid that I would like to transform to a regular grid. Currently, I run the following statement in my ...
0
votes
1answer
112 views

Using GeoPandas generated .gpkg in ArcMap

I am using GeoPandas to create .gpkg files. Using GeoDataFrame.to_file() When opening the files in ArcMap, it takes a long time updating the file extent. Files already have an spatial index as this is ...
2
votes
1answer
69 views

Generate tiles when creating tile Layer on ArcGIS Enterprise Portal

I have a raster (TIFF) that I want to publish on my ArcGIS Enterprise Portal. To reach that aim, I followed these steps : 1) Create SDDraft from TIFF in ArcGIS Pro project 2) Create SD file from ...
0
votes
0answers
49 views

PyQGIS atlas composer export to PNG with specific name

I want to use PyQGIS3 to export some map composer using atlas,In this task I want to export only one feature from atlas layers to PNG image with specific unique name file. output='/home/username/...
0
votes
0answers
23 views

gdal.Open() returns None for hdf5 file

I realize there isn't much information here but I have an hdf5 file I want gdal to recognize in python. I have tried the following: import gdal filename = 'I:/ppl/user/GFED/GFED4.1s_1997.hdf5' os....
0
votes
0answers
77 views

Adding QGIS coordinate, scale, magnifier and rotation toolbar into custom PyQGIS canvas

I was wondering if it is possible to add a toolbar with coordinate, scale magnifier, and rotation such as the one in QGIS Desktop to a custom PyQGIS canvas on a standalone application. below is a ...
5
votes
4answers
6k views

Using PyScripter with ArcGIS for Desktop?

Can someone please let me know how I can set the PyScripter 2.5.3.0 x64 works with Python 2.7.3 which comes with ArcGIS what I did was: I installed the ArcGIS 10.2 I installed PyScripter 2.5.3.0 x64 ...
2
votes
2answers
686 views

Deactivating QgsMapTool after single map click?

I'm trying that to create a class that inherits from QgsMapTool and deactivates itself after a canvasPressEvent is called. I've tried three options (in the code below) but none of them is working. ...
0
votes
0answers
34 views

CesiumJS:3Dtiles tileset path? (Windows)

I'm trying to load and display my 3D tiles file with CesiumJS on my Window Station and Chrome web browser. Cesium server seems to running fine locally. When I type the 'npm start` command via one ...
3
votes
2answers
7k views

Visualizing GPS points on interactive map [closed]

I am using version 3.0 of python, I want to visualize GPS points in my dataset on interactive map. Is there any python library that can help me to visualize my data on maps. The input dataset in ...
2
votes
0answers
26 views

Polygonize RGB mage considering all 3 bands simultaneously

I'm using the rasterio.features.shapes method to generate GeoJSON information from a PNG file. This answer shows what I'm trying to do, except I need to analyze the RGB bands simultaneously otherwise ...
1
vote
2answers
3k views

ModuleNotFoundError: No module named '_gdal'

I am using Python 3.6 and still having this problem,, although I have tried to uninstall both numpy and GDAL and installed them again in the order numpy then GDAL I am using Windows 10. This was my ...
0
votes
0answers
75 views

ArcGIS Pro Python install causing issues with importing packages

I've looked at several posts and articles and I can't seem to find a solution to this. I need to use jenkspy for a specific task but my Python 3x was installed with a software called ArcGIS Pro that ...
2
votes
2answers
922 views

Get QgsLayoutItemMap from existing QPT Layout

I created a QPT model with a map inside QGIS. The problem is when I try to select the map under pyQGIS : qpt = QDomDocument() qpt.setContent(content) layout = QgsLayout(QgsProject().instance()) ...

1
2 3 4 5 6