I have a service published in ArcGis Online that consists of a layer and two related tables.
I have to access one of the tables to write a url and I'm using Pandas to do it. Until now it worked correctly, but now I get the following error.
itemgis content foto item tables field_service_dataframe pd DataFrame spatial foto
Could not load the dataset: 'PropertyMap' instance has no attribute 'drawingInfo'
If I want to access the layer, I can create the dataframe correctly; however with a table I can't.
Is it normal that only the data of the layer can be accessed or I have something missing in my code?
Hi Alberto Cañivano
I tested the same code with a sample feature layer and it's working fine.
I just changed the item.tables index to 0 as I only have one related table to the feature layer.
item = gis.content.get("xxxxxxxxxxxx") foto = (item.tables) field_service_dataframe = pd.DataFrame.spatial.from_layer(foto) field_service_dataframe
I recommend check you feature layer first, then change the index.
you can also check the code on other feature layers to see if it throws the same error.
I hope that helps.
Thank you for your answer.
I keep getting bugs when I use Pandas with a table, the funny thing is that if I want to consult a layer, I don't have any problem and it shows correctly
geometry = (item.layers) field_service_dataframe = pd.DataFrame.spatial.from_layer(geometry) field_service_dataframe
Alberto Cañivano, I tested your code snippet using ArcGIS API for Python versions 1.8.x, 1.7.x, and 1.6.x; and they all fail the same way. So, unless you were using an old version of the API, I don't think anything in the API has changed recently that would make it stop working when it did before.
What version of the API have you been using up until recently?
I contacted the ESRI support team, they told me it was a bug in the program and that with the new release they would fix it.
In the meantime, it's still (more or less) working for one table but for another table it's not working. Also, if I make a new Notebook with the same code, it doesn't work for any table.
I'll keep an eye on the new version of the api
Thank you for answering.
To make the script I based on the following post:
The author said that instead of using a layer, it was possible to enter a table (my project is about Survey123 repeats and the relational tables I need).
I modified the code for my example and it worked perfectly (running on the ArcGis Online Notebook, in BETA version: I don't know if the BETA output to production may have been the problem).
It's true that with the previous code it seems that I can't access the table anymore (as I said before I could, and with other tables I can; even mehdi pira in his answer says that he has been able to access it.
I'm testing with
from arcgis.features import SpatialDataFrame
And it does read the tables. But there are fields in the table that do not read it (I am interested in taking the ObjectID of a table to get a value from the layer, through the relationship that is given between the two tables.
Since Esri deprecated the SpatialDataFrame at version 1.5, I don't think switching to it represents a long-term solution, although it is good to get you past the problem for right now. Regarding from_layer, either the documentation is wrong or the software has a defect, that much is clear.