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
1
vote
1answer
35 views

Exporting geodataframe to shapefile to match DBF format of ArcGIS export

I have a shapefile I created with GeoPandas that I am unable to use in a 3rd party application. The problem seems to lie with differences in how integer fields are being interpreted vs a shapefile ...
0
votes
1answer
32 views

Update point fields with fields in intersecting polygon

I get new points (inspections) every day. Each point falls within a polygon (district). I need to update 3 fields (Week, RecycleRt, RecyCollDay) in the point feature class with the district fields. I ...
-2
votes
0answers
18 views

Parse Exception error in Python 3.9 while executing it in Anypoint Studio [closed]

caused by org.python.antlr.parseexception encoding declaration in unicode string I am getting this error while importing python script in anypoint studio (mule4)
1
vote
1answer
34 views

Error using SQL statement in ogr2ogr with Python string formatter

I am iterating through a list of shapefiles and extracting subsets of each shapefile to save as a KML using ogr2ogr. How can I extract the subset based on multiple conditions while using string ...
1
vote
0answers
22 views

Polygon simplification without intersection in GeoPandas/Shapely

Is there an in-the-can solution for simplifying a boundary that won't intersect the original poly? Something like .convex_hull but with a fillet option possibly? For example, .simplify() produces ...
1
vote
0answers
23 views

QGIS 3.20 failed dependency in qgis_core on libQt5Concurrent

I wrote a Python application that successfully uses QGIS on OSX. I now want to 'freeze' it. Building an app after using the kyngchaos packages resulted in all sorts of issues finding components. I ...
5
votes
1answer
81 views

Difference between LINESTRING((x1 x2), (x3 x4), (x5 x6), (x7 x8)) and LineString([(x1,x2), (x3,x4), (x5,x6), (x7,x8)])

I am a little confused about how objects are being defined and represented and mostly because some of the solutions I find for solving issues I have demand that the input data be in an other form than ...
2
votes
0answers
39 views

Shapefile topo projections not displaying all data using geopandas, geoplot, and matplotlib

I'm currently trying to display topographic map data for an area. Although the data that is displayed is showing up correctly, there are visible chunks missing from the final projection. I don't have ...
2
votes
1answer
33 views

Converting PBF to GeoJSON using python3-gdal module

How can I use the module python3-gdal to convert .pbf into .geojson using Python? I've been exploring ogr in python3-gdal module but I can't figure out how to make it work. I do a request, the ...
4
votes
1answer
101 views

Split the column into several and unpivot the columns

I currently have 2 columns NOM_CONCAT and Number of concat(COUNT_RSF_) which is composed of" concat "from 0 to 5 A1, B1, C1 ... A2 A3, B3 . . My goal and to separate the column ...
0
votes
1answer
33 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
125 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: ...
1
vote
1answer
104 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, ...
0
votes
0answers
83 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
83 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
31 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
247 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
67 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
47 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
48 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
39 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
78 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
138 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
21 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
200 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
68 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
66 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 = ...
10
votes
2answers
903 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
193 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
43 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
544 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
79 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
75 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
60 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
31 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
85 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
133 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
40 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
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 ...
0
votes
0answers
100 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
4k 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
26 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
299 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
187 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
23 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
32 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 ...
1
vote
1answer
61 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
998 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
185 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
797 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
2 3 4 5 6