Closed JackKelly closed 2 years ago
Here's the plot using gsp_id_to_shape.geometry.centroid
:
ax = gsp_data_source._gsp_id_to_shape.plot()
xr.plot.scatter(gsp_data_source._data_in_ram.to_dataset(), x="x_osgb", y="y_osgb", color="black", s=10, ax=ax)
plt.show()
And here it is using the envelope.centroid
:
color = rng.choice(np.arange(0, 338), replace=False, size=338)
gsp_data_source._gsp_id_to_shape["color"] = color
ax = gsp_data_source._gsp_id_to_shape.plot(column="color")
xr.plot.scatter(gsp_data_source._data_in_ram.to_dataset(), x="x_osgb", y="y_osgb", color="black", s=10, ax=ax)
plt.show()
For now, I think we should probably just use centroid
(rather than envelope.centroid
)
Instead of using the centroid of the GSP region, maybe we should use the centroid of the bounding rectangle of the GSP region?
https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.envelope.html
This is done in
RawGSPDataSource.load_everything_into_ram
.