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
0answers
40 views

Point style with Python MapScript does not work

Software details: CentOS 7, Python 3.6, MapServer v 7.2.1 is compiled from source. I use Python MapScript to build WMS, it works well for styling Lines and Polygons, but not for Points. For example,...
1
vote
0answers
27 views

Accessing ArcSDE delta tables through Python?

I would like to access delta tables through ArcPy for a QC script that I am improving. Read-only. How could I output a Python dictionary that contains all the rows that were added/deleted/modified ...
1
vote
0answers
27 views

Pathfinding in mixed network

I have three geopandas GeoDataFrame representing a road network, telecommunication wires and a set of network devices to be connected to the network. They are respectively depicted as yellow lines, ...
1
vote
0answers
184 views

Cannot create geodataframe from feature class due to IndexError: list index out of range

I have a function that helps me read in large feature classes and them create a geodataframe: line_feat = "S_Studies_Ln" cnms_cols = ['REACH_ID', 'STUDY_ID', 'CO_FIPS', 'CID', 'FLD_ZONE', '...
1
vote
0answers
128 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
111 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
300 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
92 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
164 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
160 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
633 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
971 views

Enabling 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
160 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
453 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
166 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
71 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
0answers
279 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
0answers
490 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
1answer
672 views

Get QgsLayoutItemMap from existing QPT Layout

I created a QPT model with a map inside QGIS. The problem is when I try to select the map under pyQGIS : qpt = QDomDocument() qpt.setContent(content) layout = QgsLayout(QgsProject().instance()) ...
1
vote
0answers
486 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 version : 0....
1
vote
0answers
87 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
313 views

use python3 with osgeo4w shell and missing py3_env [duplicate]

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 ...
1
vote
0answers
262 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
95 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
180 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
361 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
1answer
92 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....
1
vote
0answers
255 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
300 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 ...
1
vote
1answer
63 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,...
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
283 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 ...
1
vote
1answer
690 views

Installing Python bindings for 64-bit Python on Windows

I installed GDAL and its Python bindings from GISInternals. While I believe that GDAL was installed correctly, the Python bindings have an issue. After opening a file with gdal.open I cannot read ...
1
vote
0answers
513 views

Installing QGIS with Python 2 and Python 3 on OSX [closed]

I just installed qgis (and all the dependencies, etc.) on my Mac OSX 10.10 via homebrew. Currently, I use both Python 2 and Python 3 on the machine. Whenever I change the Python path [to open qgis], ...
1
vote
0answers
85 views

Switching between python versions for Arcpy [duplicate]

I’m developing a multi-module project in Python. I’m new to GIS and my boss doesn’t have a strong technical background. I’ve been instructed to use the Arcpy module to do functions such as intersect. ...
1
vote
0answers
682 views

How to export from ModelBuilder as script and then run using Python. 3.4? [closed]

I'm currently studying for a Msc in GIS. In my assignment I have been asked to produce a model, export that model as a script file and then run that script as a stand alone in IDLE. So I have created ...
0
votes
2answers
233 views

Migrating ArcGIS for Desktop script to ArcGIS Pro? [closed]

Recently I've been considering switching my department over to ArcGIS Pro in an effort to stay ahead in the ever-advancing world of GIS software. Currently we run ArcGIS 10.3, and have many daily ...
0
votes
1answer
469 views

Getting 'list' object has no attribute using ArcPy for ArcGIS Pro? [duplicate]

I am using ArcGIS Pro with Python 3.6. I'm posting this as a new question because I've made significant headway in narrowing down the problem. I believe the issue is how ArcPy is used with ArcMap ...
0
votes
1answer
592 views

ExecuteError: Failed to execute. Parameters are not valid error when SelectLayerByAttribute run in Python 2.7 [duplicate]

I am running a line of code in a Python 2.7 environment using arcpy.SelectLayerByAttribute_management: fl_haz_selects = arcpy.SelectLayerByAttribute_management(S_Fld_Haz_Ar, "NEW_SELECTION", "\"...
0
votes
2answers
53 views

Weird cursor issue

Lets say I have a temp layer made out of selected items from another layer and I am trying to look through 2 attributes in that layer with searchCursor: union_test = "C:/Workspace/Sandbox/...
0
votes
1answer
117 views

Difficulty using variables as input parameters for arcpy.Intersect_analysis

I have 2 variables created from a previous geoprocesses: fc = arcpy.JSONToFeatures_conversion("cslf.json", os.path.join("cslf.gdb", "cslf")) selectFeatures = arcpy.CopyFeatures_management(select, "C:\...
0
votes
1answer
126 views

How would I have an improper DMS value input return a message to the user in a Python 3 function? [closed]

My question is about input functions in python 3 specifically for a latitude conversion function from dms to dd. I'm new to python3 and having some trouble understanding how I would allow a user to ...
0
votes
1answer
124 views

Can Python 3.6 Script be turned into tool that will work in ArcGIS Desktop?

I have a Python 3.6 script that I want to turn into a tool for that I can use in ArcMap (10.5). Will that even work or will I strictly have to do it in ArcGIS Pro? I couldn't seem to find any ...
0
votes
1answer
596 views

TypeError: unhashable type: 'dict' when using shapefile with arcpy_metadata module

I am having an issue with the arcpy_metadata module. I have a simple shapefile I am trying to load into the MetadataEditor: import arcpy, os, sys,env import arcpy_metadata as md myfeatures = "C:/...
0
votes
1answer
131 views

Dataset '{}' does not exist or is not supported in arcpy

I am trying to insert some variable into a simple arcpy call using .format(var1, var2) as I would in a string. I am new to using Python 3.6, so maybe there's been some change in how this is done. When ...
0
votes
1answer
51 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 ...
0
votes
1answer
29 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
4answers
1k views

QGIS “python3.exe: No module named gdal_merge”

I just would like to merge several raster of GeoTIFF but after the QGIS update from 3.3 to 3.4, even this simple tool can´t be used for the same raster anymore. GDAL command:python3 -m gdal_merge -...
0
votes
1answer
541 views

Getting latitudes and longitudes in between start and end coordinates and spaced at equal distance

I have a csv file which has the latitude and longitudes values , I need to find the coordinates in between the start and the end latitude and longitude which must be equally spaced at the interval of ...