Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

0
votes
1answer
23 views

Using the ArcGIS API for Python with a REST service to search content

I have a public REST service that has several layers and feature classes that I want to access. According to the documentation. Once I have the arcgis package imported, I can inject my outside REST ...
1
vote
1answer
24 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 ...
1
vote
1answer
52 views

Installing Anaconda for Python 3.6 without wrecking Python 2.7

I have both Python 2.7 with ArcGIS 10.5 Desktop and Python 3.6 with ArcGIS Pro. A few weeks back, I tried to install Anaconda (w/ Conda, Spyder, Jupyter, etc..) and it somehow overwrote my system ...
1
vote
1answer
41 views

Error: Algorithm not found with correct processing use

I try to run a simple dissolve algorithm in a standalone Python 3 script. My code is following : from qgis.core import QgsVectorLayer import processing from processing.core.Processing import ...
1
vote
2answers
50 views

Visualizing GPS points on interactive map [closed]

I am using version 3.0 of python, I want to visualize GPS points in my dataset on interactive map. Is there any python library that can help me to visualize my data on maps. Reference of any tutorial ...
0
votes
0answers
28 views

use python3 with osgeo4w shell and missing py3_env

I'm trying to migrate my qgis plugin from qgis 2.18 to 3.2. I try to use qgis2to3 for the migration but I'm having some problems. First qgis2to3 require python 3.3 and my osgeo4w shell install is ...
0
votes
0answers
28 views

Raster color after crop image by mask with rasterio

I have stacked 4 bands of Sentinel which have 10 meter of spatial resution. I I did it with command above: command = 'gdal_translate SENTINEL2_L1C:{scene_file_name}.SAFE/' \ 'MTD_MSIL1C....
0
votes
1answer
28 views

Problem reading shapefile with Python ogr-module

Trying to read naturalearthdatas shapefile vers. 4 "ne_110m_admin_0_countries.shp" with the python-ogr.modul I encounter a problem. inspecting the file with the following code-snippet: counter = 0 ...
1
vote
1answer
75 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:\...
2
votes
1answer
37 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....
0
votes
1answer
17 views

Cannot find feature class after adding new field in ArcPy?

I'm struggling with a very basic problem. it seems though, it's a problem with arcpy itself. I'm running the following code and it's give me a problem in the line of: with arcpy.da.UpdateCursor(...
1
vote
1answer
41 views

python's .replace doesn't work in QGIS' python editor

I am trying to compare some files to a datalist. The datalist's names are all in english letters, while the datafiles have the scandinavian "æ" "ø" "å" letters. an example: the file "Kystnære_måger....
0
votes
0answers
38 views

Time series values extraction from a 3D (lon,lat,time) NetCDF file using Python

I want to extract time series from a netcdf file which contain, Data variables: time_bnds (time, nb2) float64 ... pr (time, lat, lon) float32 ... at specific lon/lat points.The 'pr'[...
0
votes
1answer
40 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
30 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 ...
0
votes
1answer
141 views

Installing PCL module for Python 3.6 in Anaconda

I am using Python 3.6 in Anaconda3 for Windows10(64) and would like to install PCL module. I tried conda install -c sirokujira python-pcl from (https://anaconda.org/sirokujira/python-pcl) and ...
1
vote
0answers
103 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
1answer
124 views

pyQGIS returns invalid layer with QgsVectorLayer in QGIS 3

I have the following problem : I've installed all pyQGIS environment on Windows 7. I work with 64 bits version of Python 3.6 and QGIS 3.0 and PyQt5. My Windows paths are ok. My objective is to create ...
0
votes
0answers
63 views

pyqgis 3 QgsApplication.initQgis failed due to Qt5Core.dll crash

I have an existing pyqgis standalone application that was developed using python2.7 and Qt4. Now that Qgis 3.0 has come out, I am trying to get it to run in Python 3.6 and Qt5. I've made a clean ...
0
votes
0answers
108 views

qgis plugin problem: Couldn't load plugin due to an error when calling its classFactory() method

I am not able to install any plugin. Packages qtwebkit and qt5-qtwebkit are installed on my machine. Below is an example for the error ocurring: Couldn't load plugin 'go2streetview' due to an ...
2
votes
0answers
28 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....
3
votes
1answer
54 views

Joining a shapefile attribute table to a CSV file pyqgis3.0

I would like to join a shapfile to a csv file in pyqgis3.0. So, when I run the following code, it executes without errors but the join action does not succeed. What is wrong with the following code? ...
1
vote
1answer
18 views

“measureLine” not working in pyqgis 3.0

The following code works very well in pyqgis 2.0 with a line shapefile, but when executed with pyqgis 3.0 the instruction measureLine return 0 and with no errors signaled. What is the new instruction ...
6
votes
1answer
307 views

QGIS log error when using GRASS

I downloaded python 3.6, installed it, dowloaded QGIS 3.0.2, installed GDAL, then QGIS, then opened QGIS and tried to use GRASS processing tools. I got the following error: env: python3: No such file ...
1
vote
1answer
405 views

Installing external python packages for QGIS 3?

While there are tools and methods for qgis 2 i cannot figure out for 3 I want to install external python packages such as sqlalchemy etc I tried the following things : Tried to download osgeo4w ...
1
vote
1answer
88 views

ArcPy Calculate Field Management with Variable

I'm trying to calculate multiple fields that all begin with "B01". This calculation consists of multiplying the fields by a field that contains a percentage ("TractPercent") and then dividing the ...
1
vote
0answers
40 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
110 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/...
2
votes
0answers
256 views

QGIS3 error Python on launch, Ubuntu 16.4

I just 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) ...
0
votes
0answers
167 views

How Can I convert .PBF to GeoDataFrame python

I use the following script to convert pbf to geopandas for points it works well. # coding: utf-8 # In[1]: get_ipython().run_line_magic('matplotlib', 'inline') import pandas as pd import geopandas ...
2
votes
2answers
817 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\...
2
votes
0answers
66 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
1answer
98 views

Deactivating QgsMapTool after single map click?

I'm trying that to create a class that inherits from QgsMapTool and deactivates itself after a canvasPressEvent is called. I've tried three options (in the code below) but none of them is working. ...
2
votes
1answer
112 views

How to show label according to attribute name?

I try to show label name according to predefined in QGIS 3.0 by using pyqgis. I used that code in QGIS 3.0 but last update broke it down. Here is my code: settings = QgsPalLayerSettings() ...
5
votes
1answer
127 views

Make ST_Polygonize in Postgis return dangles, cuts and invalid rings

Postgis allows using ST_Polygonize() from GEOS to make polygons out of lines. I have seen the same function available in Shapely library for Python, but in Shapely, the other method named ...
1
vote
1answer
41 views

How to get lattitude and longitude of selected pixels from a raster?

I have have a code which will select some pixels from a raster. Further I want to get Latitude and Longitude information of these pixels and save it in .csv format. import gdal import numpy as np np....
2
votes
1answer
273 views

ModuleNotFoundError: No module named 'QgsComposerMap'

I am trying to import QgsComposerMap in my QGIS3 plugin but I always get this error:ModuleNotFoundError: No module named 'QgsComposerMap'. My import looks like this: from qgis.core import QgsRectangle,...
1
vote
0answers
213 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
1answer
313 views

geopandas can't import

I've installed geopandas on ubuntu 17.10 and can't import geopandas. I can't find this particular error anywhere. from pyproj import _proj ImportError: cannot import name '_proj' I'm using a virtual ...
1
vote
0answers
141 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
1answer
782 views

Converting coordinates of a bunch of polygons in a shapefile which are in UTM to latitude and longitude

My exact problem is that I have a file that report vehicular traffic that has 6 columns and two of these columns are latitude and longitude.for example this is the first row and 45. and 9. are ...
1
vote
1answer
93 views

How to normalize the data mapped on a shapefile in GeoPandas when polygons do not have the same size

I have a shapefile containing the map of Milano that contain square polygons with different size, I mean small, medium and big squares and each square has an identifier and I want to fill these ...
0
votes
1answer
502 views

Understanding ValueError from folium?

I was trying the following line of codes in python (that I learnt from a tutorial), import folium import pandas data=pandas.read_csv("Volcanoes.txt") lat = list(data["LAT"]) lon = list(data["LON"]) ...
2
votes
2answers
3k views

Fill color not showing appropriately in folium?

The following code should have shown different colored circles in a map. But my result was circles with no color at all. import folium import pandas data=pandas.read_csv("Volcanoes.txt") lat = list(...
3
votes
0answers
87 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\...
0
votes
0answers
733 views

GDAL and JP2: Python3 installation through PIP

I have JP2 files, which I have procured from ESA Sentinel 2 website. I am interested in processing them through GDAL and Python3. I have manageed to install Python3 and GDAL. GDAL was installed ...
1
vote
1answer
46 views

GDAL deletes metedata file when creating GTiff

Reposting question explaining it better. I am doing TOA corrections on Landsat8 Images in Python(3.5) by reading all image_bands and after processing them creating new GTiff of those images with GDAL,...
3
votes
1answer
293 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 ...
1
vote
0answers
607 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: ...
3
votes
0answers
669 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 ...