Open dcherian opened 1 month ago
I think I know the reason we originally did this. When selecting via a scalar coordinate from GeometryIndex, the result no longer has an index along the dimension, hence loses information on CRS. So when using the traffic_dataset
from our tests
ds = traffic_dataset.sel(
origin=shapely.Point(1, 2), day="2023-01-01", mode="car"
)
ds
no longer contains any information on CRS of origin
if we don't set attrs["CRS"]
. I am not sure if it is a good enough reason to keep assigning it. In our tests this pops out in conversion to a GeoDataFrame, where resulting origin
GeoSeries does not have a CRS assigned.
Yes I think this is where the CRSIndex
idea is useful. It can always be tied to a scalar spatial_ref
variable and propagated.
Currently the crs is duplicated in attrs and on the index.
The edge-case to handle is when you select with a scalar the index is dropped. In this case we may want to set it on the variable attrs in
IndexSelResult
.This commit is a good starting point.