Grist-Data-Desk / land-grab-2

Code and methodology to produce the dataset in Grist's Misplaced Trust investigation
https://grist.org/project/indigenous/land-grant-universities-indigenous-lands-fossil-fuels
Creative Commons Zero v1.0 Universal
14 stars 2 forks source link

feat: Ensure each GeoJSON dataset has an accompanying version using WGS84. #40

Closed parkerziegler closed 10 months ago

parkerziegler commented 10 months ago

This PR ensures that we generate versions of every GeoJSON file in Stages 1 and 2 using World Geodetic System 1984 (WGS84, EPSG:4326) as our coordinate reference system. WGS84 is the canonical CRS for the GeoJSON specification, as outlined in Section 4 of RFC 7946. In addition, all geospatial rendering libraries (e.g., d3-geo, Mapbox GL JS, MapLibre GL JS, deck.gl) expect GeoJSON data to use WGS84 as its CRS; their respective projection APIs take care of reprojection on the fly.

If we're feeling up for it, we could also consider using WGS84 as our default CRS rather than the current mixture of projections based on the input data. The GeoJSON spec actually removed support for any projections other than WGS84, so it may be worthwhile to just have all GeoJSON files use WGS84 in our workflow rather than creating separate files. Up to you all!

mariaparazorose commented 10 months ago

Hey team, this looks good to me, too. I think if we want to distribute it in this CRS, then we should add that for step_3and step_4. We kept getting strange numbers in the GIS_calculated_acreage field when we standardized the CRS before processing, so we kept states in their original CRS to process. If we're just adding additional files to distribute in a default CRS, that's totally fine!

clayton-aldern commented 10 months ago

Cool. @parkerziegler, what do you think about adding the WGS84 support for the other steps? Foresee any issues? If not, maybe we just tack those commits on this PR before merge.

parkerziegler commented 10 months ago

Yep, I'll add the exports for the other steps! No foreseeable issues, just a few quick questions.

  1. I notice that for Step 3, the export to GeoJSON is currently commented out (see here). I'm assuming we'd want to add that back in, plus the additional export to WGS84—is that correct?
  2. For Step 4, it looks like we're dropping the geometry column when reading the output of Step 3 to create the GeoDataFrame. It also seems like we don't currently export any GeoJSON from Step 4 for the summaries. Happy to add support for this—I think it may just involve unioning together all parcels associated with a given tribe and given university into MultiPolygons. Does that sound correct?

Let me know too if I'm missing some important context!

mariaparazorose commented 10 months ago

Yes for the first issue (we do want to export to GeoJSON), and as for the Step 4 issue – we dropped it for simplicity, but I agree that it would be smart to also join parcels by tribe / university and have those as two additional outputs. I don't foresee any issues with that. Thanks, Parker!

clayton-aldern commented 10 months ago

Agree! GeoJSON exports and MultiPolygon summaries 💪

clayton-aldern commented 10 months ago

This looks ready to be merged! Gonna do so but won't delete the branch just yet in case anyone needs for some reason. We can prune later.