Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [python-3]

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

0
votes
0answers
35 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 ...
1
vote
0answers
17 views

How use IF conditions for choose cmap to plot NetCDF4

I have some variable in my NetCDF4. I have 2 type of variable IR ( infrared) or VIS visible all time when when I choose var to plot in list_ var in index I need to choose cmap : Dor IR the cmap is ...
0
votes
0answers
13 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 ...
2
votes
0answers
58 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 ...
1
vote
0answers
22 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....
0
votes
0answers
50 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 ...
1
vote
1answer
71 views

geoserver.catalog.FailedRequestError: Tried to make a GET request to http://localhost:8080/geoserver/workspaces.xml but got a 404 status code

I'm trying connect to geoserver via rest protocol by gsconfig-py3 in python3 ,I get this error, but when I type "http://localhost:8080/geoserver/rest" in browser I can see these items moreover when I ...
0
votes
1answer
60 views

Print elevation of different coordinates from .hgt file [closed]

I am trying iterate through the data(elevation) from .hgt file. I have attached the codes which i used to get the elevation from the file. from gmalthgtparser import HgtParser hgt_file='N09E076....
0
votes
0answers
23 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
1answer
39 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 ...
2
votes
1answer
46 views

How to move a layer position on the layers order

I am looking for a way of moving a layer to the top of the layer order once another layer is loaded. Using the following code extracted from this answer I get the error: AttributeError: '...
1
vote
1answer
74 views

Question about running python in QGIS3

I have 5 python scripts in the following folders : .\Signal_Slot_Example\main.py .\Signal_Slot_Example\ProgressDialog\init.py .\Signal_Slot_Example\ProgressDialog\Progress.py .\Signal_Slot_Example\...
0
votes
0answers
149 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
22 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
49 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 ...
5
votes
2answers
97 views

MessageLevel in QGIS3

I am trying to migrate a plugin to QGIS3 from QGIS2 and I am having issues with an API. The original python has QgsMessageBar.MessageLevel but https://qgis.org/api/api_break.html says it has been ...
2
votes
1answer
123 views

Open Data Cube how to continue after the creation of the database?

I have some questions about using Open Data Cube. First of all I have successfully installed the virtual environment with miconda and the database with PostgreSQLPortable-10.1.1. Now I have already ...
1
vote
1answer
43 views

Automating calculation of NDVI with rasterio?

I want to automate this code below for other 99 images, the problem that I have is that each image is in its specific folder as it's mentioned in the picture below. the images are very big and I want ...
1
vote
2answers
47 views

Add Path to JPGs in Attribute Table based on Unique ID

I've been tasked with updating attribute table fields with file paths to image files in a folder based on a unique ID. I'm having trouble thinking up a script that will do this? I'm working on a ...
0
votes
1answer
66 views

How can I run an ArcPy Python Toolbox from Python3-shell?

I am trying to port an arcpy python toolbox from ArcMap to ArcGIS Pro. In ArcMap I had to use the 64-Bit-geoprocessing tool because of the size of the datasets, so I wrote a wrapper-Script for the ...
0
votes
0answers
16 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 ...
1
vote
0answers
39 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 ...
0
votes
0answers
153 views

Why does the output of gdal.RasterizeLayer differ from gdal_rasterize?

Problem I've recently noticed that the output from the gdal.RasterizeLayer function differs from the result I'm getting using the gdal_rasterize utility. I have geotiff of a SAR product that has ...
0
votes
0answers
54 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 ...
1
vote
0answers
60 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 ...
2
votes
1answer
54 views

QGIS plugin: set the position of the featureForm

Im developing QGIS plugin (Python3) to open the featureForm (depending on some of my conditions (matching geometries,...))I use this code: layer = self.iface.activeLayer() ...
2
votes
1answer
42 views

Write a Spatial Join output to a CSV?

I am trying this example with different input files. My aim is to merge the country and point tables into one table using sjoin from geopandas and write to a CSV file. I took a look at 1. When I run ...
4
votes
2answers
218 views

Bug using Python 3.7 (from QGIS) and trying to install package with pip

I use QGIS 3.6 and Python 3.7 and I try to install a package with pip in command line tool under Windows 7 but I have the following message : Fatal Python error: initfsencoding: unable to load the ...
0
votes
0answers
175 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 ...
0
votes
0answers
84 views

Loading spatialite with python3's module under Windows

I installed spatialite's Python module using pip: pip install spatialite I copied the mod_spatialite.dll found on https://www.gaia-gis.it/gaia-sins/index.html into my windows/system32 folder (I have ...
1
vote
0answers
75 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 ...
0
votes
0answers
158 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("...
0
votes
0answers
64 views

Problems with GeoServer REST API via Python and text encoding

I have checked a few other threads talking about GeoServer REST API and encoding, but nothing seemed to work. I have a dataset already uploaded into GeoServer and now I just want to update some of ...
1
vote
0answers
246 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 = ...
0
votes
1answer
121 views

Search plugin of Folium doesn't appear [closed]

I'm trying to reproduce the following jupyter notebook : https://nbviewer.jupyter.org/github/jtbaker/folium/blob/geojsonmarker/examples/plugin-Search.ipynb But once I'm trying to create the map I ...
0
votes
2answers
345 views

Click event on maps with Folium and information retrieval

I was wondering if there is a way in Folium to get the information on an entity we click on with Folium? I'd like the map to either open a tab with the attribute information or just send back ...
1
vote
1answer
24 views

Can't get the correct geometry values after MySQL querying

I have large points data and also a small bounding boxes. I want all the points present within this bounding boxes. With the extent of the bbox , I want to get all the points within this bbox. With ...
1
vote
1answer
202 views

QGIS 3 - QSettings().value(r“[…]”)[0:2] error - 'NoneType' object is not subscriptable

I'm trying to find a solution to launch a plugin from outside the QGIS console I've succeeded to call the plugin from the python console in the QGIS software but I'm now trying to do it outside of ...
1
vote
0answers
60 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
139 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
72 views

Deprecation warning when importing Processing in pyQGIS 3

I use QGIS 3.4 with Python 3.7 and I have a warning message when importing Processing like this : import processing from processing.core.Processing import Processing Here is the message : Using or ...
1
vote
1answer
47 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
2answers
582 views

Create Polygon with Length, Width, and a center coordinate

Using Shapely or like library, How can I create a rectangular polygon with known Length, Width (in meters)(Drawing over EPSG: 3857), and center coordinates (EPSG: 4326)? The output needs to be in ...
1
vote
0answers
32 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,...
2
votes
0answers
325 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 ...
0
votes
1answer
135 views

QGIS 3.4.4 - Error to zoom : Cannot zoom to selected feature(s) : No extent could be determined

I'm trying to zoom on a specific place of my map using PyQGIS In order to do so I've defined the layer I wanted to get the features : couche_parcelles = QgsProject.instance().mapLayersByName('...
1
vote
1answer
135 views

Getting GRASS 7.4.4 Working in Python 3

I'm trying to get some GRASS functionality in a Python Script, specification r.series, but I'm struggling to import GRASS. I'm trying to uses the method outline on the GRASS Wiki, Working with GRASS ...
1
vote
0answers
124 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 ...
0
votes
0answers
34 views

Get a column from database and populate the shapefile attributes?

I would like to know how to get copy a specific columns from the database and add that column in a shapefile attribute table? I am open to other better ideas.