Questions tagged [python-3]

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

59 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
70 views

Using both QGIS and native processing algorithms in standalone Python script?

I am developing a Python standalone script to process DEM in order to produce slope in vector format. I used PyQt5 to make a GUI to accept input data and parameters from user. My script is like this: ...
3
votes
2answers
388 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:\...
3
votes
0answers
121 views

QGIS Build error : zzz-db_manager-5-depend error - qgis master 2.99

I am compiling QGIS from master in VS 2015 on x64. I am getting error as : Error MSB6006 "cmd.exe" exited with code 1. zzz-db_manager-5-depend 7 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\...
3
votes
0answers
724 views

QGIS 2.99 and python 3.6

I install QGIS 2.99 development version on my windows 10. I see in the installation folder I have folders python27 and python36. I want to ask can i use python 3.6 to take QGIS python API in ...
3
votes
0answers
5k views

install GDAL 2.0 on Ubuntu 14

I would like to install GDAL==2.0.1 on Ubuntu. A lot of possibilities are found on SO, but none did work for me. I'll give an overview of a selection of my attempts: 1. Using pip directly pip ...
3
votes
0answers
234 views

LatLon Package python 3.4

Does anybody know a package who work in python 3.4 as "LatLon" Package ? https://pypi.python.org/pypi/LatLon/1.0.1#downloads
2
votes
0answers
22 views

Resolution for different layers using Python GDAL

I'm extracting data from a GRIB file using GDAL in Python 3 on CentOS. The model is 40 km resolution, and is usually 151x93. When I try to extract data from band 195, I get the following error: ...
2
votes
0answers
97 views

Python warnings in QGIS 3.4

I just opened the QGIS and this appeared. What does it mean? Is it serious problems? warning:/Applications/QGIS3.6.app/Contents/MacOS/../Resources/python/qgis/utils.py:672: DeprecationWarning: the ...
2
votes
0answers
742 views

How to prevent “Type error: unhashable type” while writing properties with Fiona?

Using shapely's dissolve method I created new geometries from two existing shapefiles. Now I would like to save those new geometries and their properties with Fiona. I have tried to write the ...
2
votes
0answers
64 views

Pass attribute to python script with QGIS command line launcher

I didn't find the answer to this question : is there a way for passing attributes to python script when you try to run it from QGIS command line launch : os.system('qgis --nologo --project project....
2
votes
0answers
116 views

Python within OSGeo4W installation gives “AttributeError: '_NamespacePath' object has no attribute 'sort'”

I have Python 2.7 and Python 3.6 installed via OSGeo4W64 on a Windows 10 x64 machine. I don't have a standalone installation of Python, but I did previously, which may have something to do with the ...
2
votes
0answers
701 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? Basically, I have a script that I want to publish as a geoprocessing tool that exports an .aprx (ArcGIS Pro) file to a ...
1
vote
2answers
14 views

Setting up dependencies for PyPi Elevation module?

I am trying to set up pypi's elevation module in Miniconda (Python 3.7.3), but I get the following error when I run the selfcheck: (base) C:\Users\name>eio selfcheck 'GNU Make' not found or not ...
1
vote
0answers
25 views

Adding distance when buffering point geometry in a geodataframe?

I have 2 geodataframes that I want to combine. They the same fields/columns but different geometries (one is points, one is polygons).To do this I want to buffer the points slightly (like 10m or ...
1
vote
0answers
36 views

Convert Geo Coordinates System X/Y to lat &lon from netCDF4 file using python 3

I have netcdf4 file with some variables like: Geo Coordinates System X/Y. I need to convert it to lat/lon. How can i do that with python? This information from my netCDF4 file: import numpy as ...
1
vote
0answers
57 views

PyCharm and ArcGIS Pro issue: Arcpy Must Run From Inside the Conda Environment,

I am getting the following error when running my python scripts in Pycharm, does anybody know how to fix it? it is very odd, because it was working just fine, then installed some updates on ArcGIS Pro ...
1
vote
0answers
44 views

Problems with LecoS plugin in QGIS on Mac Mojave

I wanted to install LecoS plugin in Qgis. But first error appears that I have to instal scipy for python in orderd to use plugin. Python was instaled using instructions from Qgis document, version 3....
1
vote
0answers
50 views

pyqgis 3:how to identify partial intersections between a buffer (polygon) layer and pipe (line) layer?

I have a drains layer (polygon) around which I have created buffers of varying distances. I want to find the intersection between the different buffer layers and pipes (line) layer and accordingly ...
1
vote
0answers
77 views

Converting QGIS2 Plugins to QGIS3

I am trying to convert a QGIS2 Plugin to QGIS3; specifically the Quickfinder plugin (I am aware of QGIS3 Locator and no I do not feel it provides the same or similar capability just thought I would ...
1
vote
0answers
95 views

QGIS plugin + project: Enter db credentials(password and username) programmatically

I am developing QGIS Python plugin. I have a QGIS project and layers stored in a PostGIS database. I don't want to store the password into the project and I want to avoid that user need to type ...
1
vote
0answers
211 views

How to insert a Polygon into MySQL database Table?

I have shapefiles which I converted to .csv format. I want to insert those into a MySQL Database table. I used ST_PolyFromText according to the MySQL reference manual. ## create table cur.execute("...
1
vote
1answer
363 views

How to enable 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 = ...
1
vote
0answers
77 views

Launch a QGIS plugin from a batchfile

After having built a QGIS 3 plugin, I'd like to know how could I call my plugin without clicking on the plugin bar of QGIS to launch it. I've tried implement a first batch file for it : REM changer ...
1
vote
0answers
182 views

Shapely : cascaded_union seems to return too many polygons

I'm trying to get the union of around 4,000 polygons using Shapely's cascaded_union function. The output of this function is a multipolygon in my case, which is normal since many input polygons do not ...
1
vote
1answer
63 views

Setting selection border color in red and save the map of the resulting selection

I'm attempting to create a plugin in QGIS 3 in order to zoom on a selected feature and get the map picture exported in .jpg format. I've been able to perform the zoom and selection of my selection, ...
1
vote
0answers
38 views

How to set project CRS with plugin (sqlite layer)?

I'm loading a sqlite db into the current project of qgis with a plugin. The standard CRS is EPSG:4326, however i want the canvas to be set at EPSG:3857. When running one of the 2 codes in the console,...
1
vote
1answer
114 views

Running python code created in QGIS

I'm using QGIS 3.4 and Python 3.7.0 on Windows 7. From the Python console of QGIS, I created a test script ("test.py") which contains the following line: print('Hello) and this is saved in C:\...
1
vote
0answers
234 views

Normalizing negative pixel values in a GeoTIFF with GDAL in Python

I have a GeoTIFF pulled from Google Earth Engine. I'm using the following code to see the red values of each pixel: from osgeo import gdal gdal.UseExceptions() ds = gdal.Open(myfile) band = ds....
1
vote
0answers
308 views

How to populate a div with hover text in bokeh?

I am developing a geographical dashboard in bokeh. It is fairly easy to use hover tooltip in bokeh, however I want to populate a div when I hover on a field. Python version : 3.5.2 Bokeh ...
1
vote
0answers
43 views

How can I install a python 3 module for its use in QGIS3 in Windows?

I've been struggling to install BeautifulSoup4 for a Python script I want to share with Windows users, but I just can't get it installed for its use in QGIS, I've tried pip install BeautifulSoup4 ...
1
vote
0answers
158 views

Show charts and plots in plugin

I'm creating a plugin to guide a user though a GIS analysis process. One of the things the user wants is the ability to display "charts" of the resulting data sets. I'm looking to build simple ...
1
vote
0answers
1k views

NameError: name data_all1 is not defined in Python 3.x

I have a standalone script using data opened from a Geopackage with Fiona. When I run this portion of my script: import os import fiona import numpy as np datapath= '/media/sf_SharesShapefiles/' ...
1
vote
0answers
83 views

QGIS 3, iterate shapefiles to export mulitple pdfs from a standalone python script

I would like to load my qgis project, and a template I made into my stand alone script (in pycharm). I have a folder with shapefiles and I would like to iterate over them, plot each one with the ...
1
vote
0answers
170 views

Install of QGIS3.0 on Mac OSX using KyngChaos prebuilt binaries

The installer doesn't work because it requires Python 3.6 to be installed as a framework in /Library/Frameworks (or so I believe). It is insufficient to have Python 3.6 installed by Macports (in /opt/...
1
vote
0answers
330 views

QGIS3 error Python on launch, Ubuntu 16.4

I installed QGIS3 on ubuntu 16.4. When I launch QGIS I get an error: Impossible de charger PyQt. (Can't load PyQt) Le support Python va être désactivé. (Python support will be deactivate) ...
1
vote
0answers
218 views

NetworkX read_shp works on Python 2.7 but not on Python 3?

I was trying to implement the same code in Python 2.7 and Python 3.0 opening the same file from the same directory using NetworkX's read_shp function. One, using Python 2.7 IDE and the other is ...
1
vote
0answers
1k views

Could NOT find PythonInterp for QGIS 2.18

I'm trying to build Qgis on windows, and I'm following the instructions provided by Qgis, but I've had problems with the python interpreter already being in cmake-gui. I think the following error: ...
1
vote
0answers
242 views

pyQt error in the PYQGIS API

I install QGIS via OSGeo4W 32 bit on windows 7 32 bit and i want to take PYQGIS API in standalone python script. First I have python 3.5.2 and I have before install sip via pip and pyqt4 via gohlke ...
0
votes
0answers
33 views

Set default version of Python in ArcGIS to 64-bit?

This is the output from Python terminal within ArcMap 10.6.1 for Windows 10: >>> import sys, numpy, matplotlib >>> print(sys.version, numpy.__version__, matplotlib.__version__) ('2....
0
votes
0answers
82 views

Setting reference frame for shapefile with pyshp?

I'm using pyshp to create new shapefiles with Python 3. My code runs without errors, but when I open the resulting file in ArcMap I get this error: The following datasource you added is missing ...
0
votes
0answers
15 views

Referencing image using GCP-file?

I'm trying to automate the actual geo-referencing in PyQgis/PyQt5. I went manually over the built-in GDAL Georeferencer in QGIS and saved a GCP-file. Also, the actual commands used for the conversion ...
0
votes
0answers
71 views

GeoPy installation fails via pip3 on Windows / OSGeo4W shell

I have written a little geocoding for PyQgis script on my linux machine, and it runs just fine there. Now I would like to start using this script for PyQgis (Qgis 3.4.1) on Windows 10 as well. The ...
0
votes
0answers
71 views

Install GDAL for Mac

In this discussion: https://gis.stackexchange.com/a/281671/136706 Cheng recommends to "NOT use the 1 install GDAL Complete.pkg to install GDAL. Try use pip to get GDAL from PyPi instead." So after ...
0
votes
0answers
276 views

Smoothing shapefiles using Python

The purple is the original polygon to be smoothed and I would like to smooth the polygons as the red line using Python. I tried simplify but looks like I need a buffer and simplify the buffer. But I ...
0
votes
0answers
17 views

Writing and testing python code using existing OSGeo4W Python3 install?

Looking for a development environment, like idle, for Python 3.6.1 that I can install and use with my existing python3 installation from the OSGeo4W. I am trying to learn python for use with QGIS and ...
0
votes
0answers
32 views

gdalinfo --formats return different values in python3 than in OSGeo4W

I am working whit geopdf to obtain the layers. When I use driver = ogr.GetDriverByName('PDF') it return None, and obviously I can't open it. I have checked with the command gdalinfo --formats and it ...
0
votes
0answers
52 views

How to preserve the Multiploygons using Python?

I converted my input file with geometry Polygon 25D to an output file with geometry Polygon using the below code. As you can see the below image. Problem is that the holes in the polygon is vanished ...
0
votes
0answers
27 views

How to read ALOS PALSAR data using gdal

I have downloaded ALOS-1 PALSAR level 1.0 data from data archive from Alaska Satellite Facility. After unzipping files ,I am getting image files,Leader Files,Trailer File and Volume File. All the ...
0
votes
0answers
76 views

Developing and desirably debugging pygis-3 processing scripts?

The writing of processing scripts in QGIS3 changed substantially. On the basis of many tutorials/blog posts and answers on this site I got a running processing script in QGIS3. But it was, for a lousy ...
0
votes
0answers
224 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 informations on click for each of its polygon which makes a huge file after 2 hours of calculation with the ...