Questions tagged [attributeerror]

an AttributeError is one of the built-in exceptions for Python. It is raised when an attribute reference or assignment fails.

Filter by
Sorted by
Tagged with
0 votes
0 answers
27 views

Applying functools.reduce to make Geopandas geometries valid for unary_union

I want to calculate the total area of a GeoDataFrame, year_df, where the geometries overlap so I need to take the union. I was running into an issue with unary_union (some TopologyException that the ...
user avatar
3 votes
1 answer
96 views

Changing stroke width of polygon with categorized symbology using PyQGIS

I have a polygon layer with categorized symbology. I want to change the stroke width of all the categories without touching the categories or colours. Here is the script I have after looking a similar ...
user avatar
  • 428
0 votes
0 answers
51 views

A change in Python API for ArcGIS Online regarding geocoding?

from arcgis.gis import GIS my_gis = GIS() m = my_gis.map('Stockholm, Sweden') m This has previously worked but now second last line takes a lot of time and gives following error. Wondering if this ...
user avatar
  • 287
2 votes
1 answer
73 views

Putting shapefile on map in ArcGIS Online using ArcGIS Python API and Jupyter Notebook

I inserted a shapefile (in .zip as required) to ArcGIS Online through Jupyter notebook: from arcgis.gis import GIS my_gis = GIS() m = my_gis.map() #let's put the shape file to AGOL shp_item = my_gis....
user avatar
  • 287
1 vote
1 answer
234 views

QTableWidget hoizontalHeaderItem is returning None

I am developing a tool is Qgis3 using PyQt5. I am adding columns using a button and the setting column names using 'setHorizontalHeaderItem'. But it gives None while trying to read it. Following is ...
user avatar
1 vote
1 answer
92 views

Attributes disappears from KMZ-file when imported in QGIS

I have a KMZ-file with polygons that I want to edit in QGIS. When I open it in Google Earth it has some attributes, when I open it in QGIS the attributes disappears or look different. How do I get the ...
user avatar
  • 31
0 votes
0 answers
26 views

QGIS 3.16.6 AttributeError in script used to join three tables in PostgreSQL database

I am trying to get a PyQGIS script running that's joining a polygon and two tables in QGIS 3.16.6. Using the script, the user has to select several inputs from layers in the Layers panel that are ...
user avatar
  • 1
2 votes
1 answer
636 views

GeoPandas write esri-shape file failure: AttributeError: 'DataFrame' object has no attribute 'to_file'

I've got a geodata-frame like this: grid_up2geo.head() Out[13]: jahr la3_id ... 0 geometry 0 2000 1 ... 0 POLYGON ((2690000.000 4342000.000,...
user avatar
  • 21
1 vote
0 answers
587 views

AttributeError: type object 'object' has no attribute '__getattr__'

I have made a PyQt application where I load UAV images and I display the coordinates (lat, long) according to where the mouse pointer shows. I use this code: Converting a pixel coordinate in GeoTIFF ...
user avatar
5 votes
1 answer
426 views

"AttributeError: 'str' object has no attribute 'crs'" when referring to vector line layer object

I need to test if a vector layer, chosen by the user, is in geographic coordinates, according to the code below: class RoadSlopeCalculatorAlgorithm(QgsProcessingAlgorithm): def initAlgorithm(self, ...
user avatar
  • 141
2 votes
1 answer
296 views

Crayfish plugin doesn't work in QGIS 3.20 [closed]

I have installed QGIS 3.20 in my computer and wanted to use crayfish plugin for Mesh analysis. When I install the plugin it shows the following error and the plugin does not appearing in the toolbox ...
user avatar
1 vote
1 answer
1k views

Python attribute error class has no attribute dlg

I am trying to create a plugin for QGIS, when I initialize the start of the plugin build and create the GUI without coding any of the buttons associated with the GUI the plugin works, but as soon as I ...
user avatar
3 votes
2 answers
231 views

Exporting selected layouts in ArcGIS Pro

I would like to export selected layouts from an ArcGIS project. The error I keep receiving is AttributeError: ValueObject: Get attribute exportToPDF does not exist Is there something different about ...
user avatar
1 vote
1 answer
56 views

"AttributeError: 'QgsZonalStatistics' object has no attribute 'getFeatures'" when filtering ZonalStatistics result in PyQGIS

I want to calculate zonal stats of a raster using a polygon layer and the filter the ouput as another layer. This is the code I tried: zoneStat = QgsZonalStatistics (tempVectorLyr, rasterLyr, '-', 1) ...
user avatar
3 votes
2 answers
347 views

Converting CRS from EPSG:4326 to EPSG:32635 using PyQGIS

How in QGIS 3.16 to convert from CRS EPSG:4326 to CRS EPSG:32635 using Python? I got this error: exec(open('C:/Users/aaa/AppData/Local/Temp/tmpovpzt0d0.py'.encode('utf-8')).read()) Traceback (most ...
user avatar
  • 51
5 votes
2 answers
1k views

"AttributeError: 'str' object has no attribute 'dataProvider'" when persisting layer from memory into project

I'm writing some scripts in QGIS 3 to automate processing using a number of the inbuilt algorithms. I'm using memory layers to store the intermediate results of the algorithms. I'm looking for a ...
user avatar
  • 73
2 votes
1 answer
358 views

AttributeError while Plotting GeoDataFrame

I am new to geopandas. I am trying to plot the locations of bays and gulfs. I have a csv file containing their names. After geocoding and finding their locations, I tried to plot the points on a world ...
user avatar
0 votes
0 answers
47 views

Several attributes of polygon and linestring in a shapefile

I exported a shapefile from a web application and it has several polygon and attribute fields. I would like to have a check the fields by making use of QGIS. However, seeing the polygon fields, it has ...
user avatar
1 vote
1 answer
796 views

AttributeError: 'NoneType' object has no attribute 'parameterDefinitions'

I'm trying write simple code line in PyQgis in PyCharm, have already set environment in PyCharm and seems to be working fine because I can iterate through f.i fields in vector layer proceed with ...
user avatar
6 votes
2 answers
254 views

AttributeError when counting entity number using PyQGIS

I'm trying to count the number of entities but each time I have this error: `AttributeError: 'dict' object has no attribute 'featureCount' while I have only one selected layer uri = r"C:\...
user avatar
0 votes
0 answers
121 views

Error when installing QAD plugin: Plugin 'qad' could not be loaded due to an error calling its method classFactory()

I am trying to install the QAD plugin and it appears this error: No se pudo cargar el complemento 'qad' debido a un error al llamar a su método classFactory() AttributeError: 'QVariant' object has ...
user avatar
  • 1
1 vote
1 answer
85 views

Python: Cannot construct empty GeoDataFrame with columns

My script import geopandas as gp test = gp.GeoDataFrame(columns=['geometry', 'costs']) the error: File "/usr/local/lib/python3.7/dist-packages/geopandas/geodataframe.py", line 89, ...
user avatar
  • 844
0 votes
1 answer
150 views

Using ArcGIS API for Python and Windows Authentication?

I've been trying to follow the ESRI recommended workflow to log on to Enterprise (using authentication), but it just doesn't want to work. I'm able to get the account credentials registered in ...
user avatar
0 votes
0 answers
80 views

AttributeError: Object: Tool or environment <TrainSupportVectorMachineClassifier> not found

I am new to coding and do not know what I am getting the error message: AttributeError: Object: Tool or environment not found. My first line of code is the typical "import arcpy....." I ...
user avatar
  • 21
4 votes
2 answers
586 views

AttributeError: 'Layer' object has no attribute 'metadata' from ArcPy with ArcGIS Pro

I am trying to get the metadata for each layer within each map within a ArcGIS Pro project (.aprx file), but get this error message: AttributeError: 'Layer' object has no attribute 'metadata'. The ...
user avatar
  • 331
2 votes
1 answer
176 views

AttributeError: 'SpatialReference' object has no attribute 'ImportfromWkt'

I just started using gdal. I'm trying to get longitude and latitudes from pictures. This is what I have so far. This gives me an attribute error. Anyone know how to fix the attribute error? from ...
user avatar
2 votes
1 answer
81 views

Shapefile type description showing attribute error

import arcpy esc = arcpy.Describe("C:\Users\Drona_Maps\Desktop\lecture16\shapefiles\world_continents.shp") print esc.ShapeType Shape file type description showing attribute error like this: ...
user avatar
1 vote
0 answers
222 views

AttributeError: 'NoneType' object has no attribute 'GetLayer'

Using: QGIS 2.18 with a plugin: ECOPLAN Scenario evaluator, inserting self-made shapefiles made in Arcmap. Received this error: Traceback (most recent call last): File "C:/Users/PAU-...
user avatar
0 votes
1 answer
456 views

RQGIS3 : AttributeError: module '__main__' has no attribute 'RQGIS3'

I am trying to use the RQGIS3 package to access QGIS3 functions from R, and although briefly I had things working (mostly), running the following code: library(RQGIS3) qgis_env <- set_env("C:/...
user avatar
2 votes
0 answers
56 views

Using QGIS plugin default code produces attribute error

Using Windows 10/QGIS 2.18 and QT Designer, I am creating a plugin that will create several random point selections and to place the results by appending several point layers. So I created a "...
user avatar
  • 163
1 vote
1 answer
146 views

AttributeError from PDF Export from ArcMap Bookmark Loop [closed]

import arcpy, os, datetime folderPath = r"C:\path" dateTimeStamp = time.strftime('%Y%m%d') basename = "Flows" mxd = arcpy.mapping.MapDocument(r"C:\path\file.mxd") df = arcpy.mapping.ListDataFrames(...
user avatar
  • 131
2 votes
0 answers
510 views

QGIS Python AttributeError: 'NoneType' object has no attribute 'processingRegistry' [closed]

I am executing a QGIS Desktop 3.8.3 Python 3 script. from osgeo import ogr, gdal from gdalconst import * from qgis.core import * import qgis.utils, sys from qgis.gui import * from PyQt5.QtGui ...
user avatar
  • 719
1 vote
1 answer
321 views

GDAL module in python error

I have some troubles with GDAL module on Python. When I try to import gdal, console displays this: Файл "c:/rstp/Lib/site-packages/osgeo/__init__.py", строка 48, из <module> __version__ = ...
user avatar
0 votes
1 answer
390 views

GetRasterBand()Method for GDAL in Python

I'm working on getting the NDVI value of Landsat imagery 2018 using band 4 and 5 but I have encountered a slight problem. import osgeo from osgeo import gdal#gdal, data conversion tool from ...
user avatar
2 votes
1 answer
4k views

AttributeError: 'Series' object has no attribute 'has_z'

I got the following GeoDataFrame taken from a CSV file and after some slincing and CRS and geometry asignment ctf_nom geometry id 0 Prunus ...
user avatar
1 vote
0 answers
1k views

Python - Issue to create choropleth map based on GeoJSON file: AttributeError

I'm trying to build a choropleth map, I cannot figure out why I get this error: AttributeError: 'NoneType' object has no attribute 'get' Here is my code: station_nb is a dataframe with values ...
user avatar
  • 11
1 vote
1 answer
168 views

Getting AttributeError when exporting Heatmap using qgis2web? [closed]

I want to make a heatmap layer on my webgis. using these options but when i'm trying to export it using qgis2web i always get this error. 2019-06-21T10:15:53 WARNING Traceback (most recent ...
user avatar
2 votes
1 answer
558 views

Exporting attributes from QGIS to TXTF file using Python

I have used this method outlined in: https://howtoinqgis.wordpress.com/2016/10/31/how-to-export-attributes-from-qgis-to-a-txt-file/ ##input_file=vector from qgis.core import * import processing # ...
user avatar
3 votes
0 answers
69 views

Lines length plugin - QgsVectorLayer error

Several similar questions have already been made, but none of the is helping me. I have a layer of polygons and I want to known the length of each line of each polygon. And based on the length I ...
user avatar
  • 43
1 vote
0 answers
295 views

Getting AttributeError: 'NoneType' object has no attribute 'sourceCrs' from TIN Interpolation in QGIS?

I am trying to use the TIN interpolation to interpolate conductivities between a vector layer in QGIS 3.4. and I always get this error: Traceback (most recent call last): File "C:/PROGRA~1/QGIS3~...
user avatar
  • 11
1 vote
1 answer
458 views

'NoneType' object has no attribute 'identify'

I'm trying to run a console script, but it gives an error: : AttributeError:'NoneType' object has no attribute 'identify' Yet it works well in QGIS 3.7 Here is the script: import sys import time ...
user avatar
  • 11
1 vote
0 answers
243 views

QGIS Python AttributeError object has no attribute 'pushVersionInfo'

I am unable to use almost all of the processing toolbox features in QGIS. I keep getting the following Python error across multiple algorithms: AlgorithmDialog.py", line 208, in runAlgorithm self....
user avatar
  • 11
0 votes
2 answers
247 views

Geoviews Attribute error

I just installed GeoViews with success and I tried to follow one example at the first page of their site and this already gave me an error. In fact, there are two errors of the same type that occurred ...
user avatar
  • 101
0 votes
1 answer
4k views

Getting AttributeError: 'module' object has no attribute 'CalculateGeometryAttributes_management'?

I am trying to calculate the area for my grid cells. For that, I give the following command arcpy.CalculateGeometryAttributes_management(union, "AREA") Here, union is my grid and I need to make a ...
user avatar
  • 291
1 vote
1 answer
3k views

Displaying attribute field value in TextElement gives AttributeError: 'list' object has no attribute 'text'?

I am new in Python scripting. I have a geodatabase with layer Test and this layer has field Name and Text element on layout named TEname. I am trying to show selected feature attribute Name value in ...
user avatar
1 vote
0 answers
561 views

GeoPandas geocode error when using Nominatim

I am following this lesson about Geocoding. I have entered: # Import necessary modules import pandas as pd # Filepath fp = r"addresses.txt" # Read the data data = pd.read_csv(fp, sep=';') data....
user avatar
2 votes
0 answers
154 views

Clipping outside QGIS with PyQGIS?

This is my first script and I having a problem trying to clip a shp file. I'm running on a linux server and this is my code: #! python from datetime import date from qgis.core import * from PyQt4....
user avatar
1 vote
1 answer
1k views

Getting AttributeError from ArcPy?

I'm working on a simple Python code to make a raster from a shapefile using the Natural Neighbors tool, and then use the resulting raster to generate a contour using the Contour tool. I keep getting ...
user avatar
  • 11
0 votes
1 answer
447 views

Tried running a script, kept getting "AttributeError: DescribeData: Method spatialReference does not exist"

Anyone know how i can fix this problem below? I am trying to merge all the layers under the same name in different subfolders. import arcpy import os # parameters input_folder = arcpy....
user avatar
  • 1
0 votes
0 answers
1k views

AttributeError: Myclass instance has no attribute 'x'

I am trying to select a feature from the layer using my plugin. When working with my plugin in main Python function using QGIS, I receive an AttributeError when I call a class method from within the ...
user avatar
  • 167