Closed kcpevey closed 5 years ago
The problem here is that the code expects the names of the polygon/path dimensions to match those of the points. Since I can't see the columns in the reservoir_df
I can't tell if this error is wrong or not. That said we should definitely try to validate it to produce a more informative error.
You are correct, reservoir_df
had column names of x
and y
but dam_df
had Longitude
and Latitude
.
When you specify an element, e.g. polys, with a dataframe in the initialization of an Annotator, it expects it to have 'x' and 'y' columns. However, when I specified my columns names as 'Latitude' and 'Longitude', it gave me an error that is produced is very confusing and misleading:
DataError: Supplied data does not contain specified dimensions, the following dimensions were not found: ['Longitude', 'Latitude']
To me, this reads that the supplied data is supposed to have the dimensions 'Latitude' and 'Longitude' but it does not. Which of course, my df did specify those so I was confused. It took looking at a working code to discover that the issue was actually that it wanted 'x' and 'y' columns.