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
17
votes
3answers
9k views

OSGeo4W shell with python3

I would like to use OSGeo4W shell with Python3 but when typing python3 I get the following error: Fatal Python error: Py_Initialize: unable to load the file system codec File "C:\OSGEO4~1\apps\...
13
votes
4answers
13k views

Will ArcGIS Desktop support latest Python 2.x or Python 3.x versions?

I'm curious to know whether ArcGIS Desktop 10.0 will support newer versions of Python than 2.6. And for that matter newer versions of NumPy (ie, 1.4, 1.5 etc). I'm sure that this documentation is on ...
1
vote
2answers
384 views

Terminology for distinguishing ArcPy installed with ArcGIS 10.x for Desktop from that which comes with ArcGIS Pro?

ArcGIS Pro uses Python 3 whereas the other ArcGIS for Desktop applications (ArcMap, ArcCatalog, ArcScene and ArcGlobe) use Python 2 and the changes introduced with ArcGIS Pro were significant ...
9
votes
3answers
3k views

Distinguishing Python version when using IDLE with ArcGIS Pro and ArcGIS 10.x for Desktop architecture?

I have just started to work with Python 3.4.1 which comes with ArcGIS Pro 1.0.0, on my laptop, which also has Python 2.7.8 which comes with ArcGIS 10.3 for Desktop installed, and I would like to ...
5
votes
1answer
1k views

Sending arguments to LAStools function from Python script not working

I`m trying to call the lasground module from a python script, using this method: args=['lasground', '-i *.las', output_file, arg_step, arg_spike, arg_spikedown, arg_offset, arg_bulge, arg_cores] proc=...
1
vote
3answers
4k 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 = ...
2
votes
1answer
4k views

Zonal Statistics of a polygon and assigning mean value to the polygon [closed]

I have a large shapefile filled with polygons, and a raster of that same area. I need to use Zonal statistics to find the mean value of the area under each polygon and then assign that value to the ...
1
vote
1answer
821 views

Compiling QGIS 3.x (master) on Ubuntu 16.04 with Python3.6 and the latest Qt 5 and PyQt5 familiy modules (PyQt5, sip, qscintilla, pyqtchart)

The problem: Now that the compilation issue is over (Unable to compile QGIS 3.x (master) on Ubuntu 16.04: PyQt5.pyqtconfig module does not exist), QGIS 3 (master) refuses to load Python at startup. I ...
3
votes
1answer
125 views

Setting a Background Color with RVBT field with python

I'm trying to set the color of a background of a layer. To do this i created an attribute "Color" with the RVBT numbers associate to each feature. As in the picture, i want to set the color with those ...
6
votes
1answer
286 views

Explaining pyproj to_epsg min_confidence parameter?

Following on from this question How can I get epsg code in pyproj with version==2.1.3, I discovered that sometimes when intialising a pyproj Proj instance with a string ESPG code eventually results in ...
6
votes
2answers
4k views

Python 3 support in QGIS?

As python3 is getting standard more and more I wonder wether there is or will be support for python 3 in QGIS?
5
votes
2answers
1k views

Python 3 with QGIS on Mac?

I need to start learning Python, and I want to learn with version 3.x. I understand that QGIS--at least some plug-ins--relies on Python and Tcl/Tk, and probably on specific versions. Assuming that ...
4
votes
1answer
1k views

How to let ogr/gdal CreateLayer() create a `geom` field instead of `wkb_geometry`?

When creating a new table (PostGIS) using OGR/GDAL (2.1+), is there a way to select a specific name for the geometry field (such as geom), rather than using the default name? I created a new table ...
3
votes
1answer
159 views

How to transliterate in QGIS using Python 3

I am QGIS user but beginner in Python. I figured out how to transliterate Georgian script into Latin using this module (https://pypi.org/project/transliterate/). from transliterate import translit, ...
2
votes
1answer
400 views

QGIS 3 - Python : QgsVectorLayerJoinInfo issue

I'm trying to use Python to join a table to a vector layer within QGIS (v. 3.2.0) Here is the script I use : >>>root = QgsProject.instance().layerTreeRoot() >>>ids = root....
2
votes
2answers
4k views

Python shapely intersection with buffer in meter

Having a line and a polygon, I use shapely to determine the intersection between the two with a defined buffer. Both the line and the polygon are in WGS84 coordinates, while the buffer is in meter. ...
1
vote
1answer
370 views

S57/ENC QgsVectorLayer with stand-alone python script

I'm running the OSGeo4W64 Qgis 3.2.0. In the gui I can add a vector-layer using the same data as in the example below without any problems. Adding the layer using the python console works too. When ...
1
vote
0answers
248 views

Rasterizing shapefile with rasterio and gdal gives all cells 0 values [closed]

I am trying to rasterize my shapefile (20 polygons) with rasterio and fiona and turn the new raster into a mask for clipping. I need to rasterize my all polygons in my shapefile and turn on mask ...
1
vote
4answers
1k views

working standalone app .exe from python3 script that imports osgeo gdal?

I have a script written in python 3.5 that uses osgeo gdal (1.11) to extract maps and file info from geotiff files. I would like to compile this code to create a standalone app on windows, and I use ...
0
votes
1answer
86 views

SearchCursor not reading the last row

Let's say I have a layer made up of pre-selected features from another layer: selects = arcpy.SelectLayerByAttribute_management (S_FIRM_Pan, "NEW_SELECTION", "DFIRM_ID = '{}'".format(fipC)) If I get ...