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
1answer
14 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
0answers
19 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
30 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 ...
0
votes
3answers
35 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 ...
1
vote
0answers
16 views
+50

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
22 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
15 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
38 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
39 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
21 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
18 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
32 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
130 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
8 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
48 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
51 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
14 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
27 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
21 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
231 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
46 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
1answer
48 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
73 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
34 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
50 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
64 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
37 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
90 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
56 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
56 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
11 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
8 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
53 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
226 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
vote
0answers
48 views

Exception for error produced while running arcpy.MakeXYEventLayer_management method

I am using Python 3.6.8 to make an XY Event layer. I first use the arcpy.MakeXYEventLayer_management(inputCSV, "Longitude", "Latitude", TempFeatureLayer, WGS84, "") where TempFeatureLayer is defined ...
2
votes
1answer
276 views

Geopandas (points) to Numpy Array

I have a geopackage with a point feature. Which contains points along 19 lines. So, the number of points per line is exactly the same. Therefore, I could see it as a matrix in numpy. Moreover, each ...
1
vote
1answer
240 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 ...
2
votes
1answer
138 views

Python clipping large shapefile by radius [closed]

I cannot find any real answer so I'd like to ask how to crop shapefile with roads in Python. The goal is to leave roads (nodes) in black circle only, then output that to dataframe in geopandas (...
1
vote
1answer
262 views

Transform geospatial data from decimal degrees to x,y coordinates using pyproj in Python

I have the following dataframe latitude longitude xx yy 0 37.75153 -122.39447 553343.041098 4.178420e+06 1 37.75149 -122.39447 553343.069815 4.178415e+06 2 37.75149 -...
3
votes
0answers
278 views

OSError - cannot import geopandas

While trying to import geopandas error occurs: Exception has occurred: OSError Could not find lib geos_c.dll or load any of its variants []. I downloaded GDAL and fiona for Python 3.7 from this ...
1
vote
0answers
76 views

Merge two maps only at the boundaries with python code

I have two maps one is normal cluster map and other is a grid map. I want that only at the boundaries the cluster map should follow grid map. Refer to the image, map in violet is my cluster map and ...
0
votes
0answers
58 views

Using qgis.core in anaconda environment

I am trying to use qgis.core in a Conda Environment with qgis, PyQGIS and Python 3.7 installed. I get over an over the next error: File "C:\Users\dg\.conda\envs\env_p3\Library\python\qgis\core\...
3
votes
1answer
757 views

Merging a geodataframe and pandas dataframe based on a column

I have a simple geopandas dataframe that includes geometry and a column called 'MUKEY': merged_spatial_df.head() I want to merge it to a tabular (.csv) pandas dataframe (which also has a column ...
2
votes
1answer
57 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 ...
5
votes
1answer
329 views

Differences between OSGEO GDAL and GDAL python bindings?

Question I'm trying to figure what are the differences, and of course, what is the best solution to use, between two python3 bindings: GDAL, imported as import gdal OSGEO.GDAL, imported as ...
1
vote
1answer
112 views

Python user defined function written for ArcGIS Pro returns None when it should return an address?

I am rewriting a 2.7 Python script for compatibility with ArcGIS Pro and organizing it with user defined functions so that I can debug portions of the script as I go. I am new to the process, but I ...
2
votes
0answers
58 views

Problem when trying to cut linestring at multiple points after conversion from Multi-linestring

This is my script: def cut_line_at_points(line, points): ''' line is gdf format points are series of points in gdf format ''' # union all geometries - convert the gdf to shpely (...
0
votes
1answer
30 views

Copy FGDB from folder to another folder in Python 3 without ArcPy? [closed]

I found this code here. first time I ran it, it copied my file to another folder but for second time nothing happened. Even I didn't get error in Jupyter Notebook. #Move GDB to G: for your project's ...
0
votes
1answer
138 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
2 3 4 5 6