Open mbauer288 opened 6 months ago
hmm. Not clear to me what is going on just yet. Could you tell me what the outputs of the following are:
top_df.has_trixels()
top_df._trixel_column_name
top_df._geometry_column_name
Can you plot the outputs from the examples; i.e. do:
world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))
world.sort_values(by='name', inplace=True)
africa = world[world.continent=='Africa']
stare = starepandas.sids_from_gdf(africa, level=5, force_ccw=True)
africa = starepandas.STAREDataFrame(africa, sids=stare)
trixels = africa.make_trixels()
africa.set_trixels(trixels, inplace=True)
africa.plot(trixels=True, boundary=True)
Ohhh. I see it now. top_df
is a GeoDataFrame
, not a STAREDataFrame
.
You can either cast it to a STAREDataFrame
by doing
starepandas.STAREDataFrame(top_df)
Or, the following: the plot method of STAREDataFrames and GeoDataFrames are slightly different. The GeoDataFrame plot function does not understand the kwarg trixels
or boundary
. So you could do:
top_df.set_geometry('trixels').boundary.plot()
The starepandas.STAREDataFrame(top_df) worked. Thanks. I wonder why/how that worked before?
This worked when I made the Snow animations back in January... Any idea why this error cropped up?
Name Version Build Channel
cartopy 0.22.0 py311h6e08293_1 conda-forge
geopandas 0.14.3 pyhd8ed1ab_0 conda-forge
geopandas-base 0.14.3 pyha770c72_0 conda-forge matplotlib 3.8.3 py311ha1ab1f8_0 conda-forge matplotlib-base 3.8.3 py311hb58f1d1_0 conda-forge pandas 2.2.1 py311hfbe21a1_0 conda-forge pystare 0.8.13 pypi_0 pypi shapely 2.0.3 py311h0815064_0 conda-forge starepandas 0.6.6+60.g1d9b635 pypi_0 pypi
If I add
top_sdf.set_geometry("trixels", inplace=True)
I get different errors.