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
0
votes
0answers
26 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
36 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
24 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 ...
0
votes
2answers
78 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 ...
1
vote
0answers
34 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
40 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
0answers
34 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\...
2
votes
0answers
28 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
53 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 ...
0
votes
1answer
82 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
0answers
16 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. ...
0
votes
1answer
48 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
36 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
45 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 = ...
9
votes
2answers
301 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
1answer
65 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 ...
0
votes
1answer
33 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
241 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
65 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
55 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
0answers
39 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
19 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
63 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 ...
0
votes
1answer
96 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 ...
0
votes
0answers
31 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 ...
2
votes
0answers
21 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 ...
0
votes
0answers
52 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 ...
0
votes
2answers
2k 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
15 views

Reproject MOD13Q1 in GDAL using the gringpoints

I am working with the MODIS MOD13Q1 vegetation product and the reprojection using gdal is fine, however I wish to be more precise and use the GRING to accurately warp the data into wgs 84(epsg:4326). ...
0
votes
0answers
164 views

Converting NetCDF to Grib2 in Python on native Windows. Which package?

Problem statement: I need to implement an easy-to-share script compatible with Windows environment that allows me to open a NetCDF, manipulate it, and save it in Grib2 format. Attempt 1: iris / iris-...
0
votes
0answers
123 views

Printing a degree symbol (“º”) yields “unknown symbol” (question mark in romb) via Python

I am working with QGIS 2.14.3, I just create a JSON file for detecting text, numbers, bearing and distance with OCR process using python 3 with pytorch, successfully I completed for creating a JSON ...
0
votes
0answers
15 views

User defined folder location for QGIS3 temp files in Pycharm

I set up user defined paths for temporary files in the QGIS version that I'm using (settings -> options -> systems). When I run code within QGIS3 the temporary files are saved in the indicated ...
0
votes
1answer
29 views

Populate a combobox with vector layer name in QGIS 3.X plugin [closed]

I'm updating a QGIS 2.14 Python code plugin to QGIS 3.X. I'm stuck in the attribution of vector name in combobox. The problem is that I don't have any error message but the combobox aren't filled at ...
0
votes
1answer
29 views

ST_Union on Rasters in Geoalchemy2 using ORM

I am attempting to perform a union on two rasters I pick from my postgis database using GeoAlchemy2. I have a Raster table defined: from geoalchemy2 import Raster from sqlalchemy.sql import func Base ...
3
votes
1answer
557 views

Using shapely interpolate to evenly re-sample points on a linestring geodataframe at specified interval

I have a GeoPandas LineString GeoDataFrame. I am trying to evenly interpolate the spacing of the nodes that make up each line, with a couple constraints: keep endpoints unchanged, and specify maximum ...
1
vote
1answer
117 views

Using pyproj inverse transform with GeoPandas and GroupBy + SortBy constraints

I am using pyproj inverse transform to add azimuth and distance "info" to a grouped and ordered geodataframe. I asked a similar question earlier here, but I didn't realize grouping was a ...
1
vote
2answers
196 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 ...
1
vote
1answer
144 views

Pyproj inverse transform returns NaN with EPSG that is not 4326

I am using pyproj inverse transform to add azimuth and distance "info" to an ordered geodataframe and keep getting unexpected NaN results when I use a local UTM-based EPSG. It works fine in ...
0
votes
1answer
45 views

How to extract CRS ellipsiod info in correct format for pyproj inverse

I am using pyproj inverse transform to add azimuth and distance "info" to an ordered geodataframe (gdf), but my datasets are in different locations around the world. I need to use a local ...
1
vote
1answer
82 views

Using pyproj inverse transform to get azimuth, row iteration and lambda apply (I'm close to the answer!)

I am using pyproj inverse transform to add azimuth and distance "info" to an ordered geodataframe. I am trying to iterate over all the rows in the geodataframe to add the "info" as ...
1
vote
0answers
114 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
0answers
103 views

Conversion of (lat, lon, height) to another CRS with pyproj results in no transformation

I have latitude, longitude, and ellipsoidal_height measurements in the IGS14 CRS. I want to convert/transform/project this data into latitude, longitude, and ellipsoidal_height measurements in the ...
2
votes
1answer
129 views

How can I launch a QWidget after pressing a submenu (QAction) in QGis3.4?

I need your help I am developing a dialog box (which I will call toolraster) in QGis to interact with raster layers. I want it to display when I click on a menu I insert in the QGis interface. I ...
3
votes
0answers
85 views

Stand-alone PyQGIS (QGIS 3.13) scripts with OSGeo4W and the Orfeo toolbox (OTB 7.1.0) seem to be mutually exclusive

I am changing my python environment from working with ArcGis and Arcpy to working with QGIS and PyQgis. And I also want to use the machinelearning possibilities from the orfeo toolbox. In doing so I ...
2
votes
1answer
74 views

Check if polygons of a GeoJSON file are included in polygons of another

I have two GeoJSON files. A province.geojson file and a constituencies.geojson file and I would like to know for each district polygon which province it belongs to. That is to say, for each polygon in ...
0
votes
0answers
10 views

Programmatically remove default shortcut of Locator

Using Python, how may I go about changing or removing the default shortcut of the Locator? I have a list of desired_shortcuts that I leverage as a comparison point against QGIS defaults to remove ...
1
vote
0answers
15 views

Problem in distributing GDAL in stand alone application

I'm desperate with the distributing problem of gis packages each time. It is the third day that I'm desperately trying to make an .exe using Pyinstaller to a small application I developed using GDAL ...
0
votes
0answers
9 views

Linear projection going astray

I have developed a tool that tries to find a path connecting a set of telecommunication network equipment along a given road network. Since the equipment is located at various distance from the road ...
1
vote
0answers
71 views

Load layers for viewing in QGIS 3 from delimited text

I am trying to use part of a script to add points from a delimited text file, however, when I use it the layers are not loaded on the screen and not saved in the path indicated as .shp import os ...
1
vote
1answer
536 views

Create an ESRI Shapefile from WKT with OGR

I want to create an ESRI Shapefile layer from a CSV file. In my CSV I have several attributes (text, numeric) and geometry in WKT style. I have a problem with the geometry field wich is truncated to a ...

1
2 3 4 5 6