PermafrostDiscoveryGateway / pdg-portal

Design and mockup documents for the PDG portal
Apache License 2.0
0 stars 0 forks source link

Show the Circumpolar Arctic Vegetation Map (CAVM) #26

Open robyngit opened 1 year ago

robyngit commented 1 year ago
robyngit commented 1 year ago

The raster file is relatively small, making it easier to work with than some of our larger datasets. However, some challenges are arising while trying to tile this data for Cesium:

1) The data requires a discrete colour palette, which is not yet supported by our workflow. A discrete palette is easy to implement with rio_tiler. 2) The colormap used in the publication seems pretty integral to the data, but isn't saved in the geotiff (though might be stored in auxiliary the ArcGIS files, e.g. the binary .lyr file?). However, I was able to pick the colours from a legend image in the associated research paper (see below).

Click to see the colour palette data ```python col_pal = [ {"value": 1, "code": "B1", "color": "#CCCFA8"}, {"value": 2, "code": "B2a", "color": "#939A32"}, {"value": 3, "code": "B3", "color": "#896F70"}, {"value": 4, "code": "B4", "color": "#716E8C"}, {"value": 5, "code": "B2b", "color": "#A9B259"}, {"value": 21, "code": "G1", "color": "#F6E7A2"}, {"value": 22, "code": "G2", "color": "#EDCC75"}, {"value": 23, "code": "G3", "color": "#C6B62E"}, {"value": 24, "code": "G4", "color": "#EAEC31"}, {"value": 31, "code": "P1", "color": "#C79FA1"}, {"value": 32, "code": "P2", "color": "#BB828E"}, {"value": 33, "code": "S1", "color": "#99C339"}, {"value": 34, "code": "S2", "color": "#58993E"}, {"value": 41, "code": "W1", "color": "#A5D0A2"}, {"value": 42, "code": "W2", "color": "#98CBBE"}, {"value": 43, "code": "W3", "color": "#74B289"}, {"value": 91, "code": "Lakes", "color": "#4657A3"}, {"value": 92, "code": "Lagoons", "color": "#BDC5E6"}, {"value": 93, "code": "Glacier", "color": "#FFFFFF"}, {"value": 99, "code": "Non-arctic", "color": "#F6E8B5"} ] ```

3) Either the bounds that are stored in the GeoTIFF are incorrect, or the CRS/projection information is incomplete or isn't being handled correctly in python (rio_tiler, rasterio, and geopandas are all displaying this raster/raster bounding box oddly). When either the raster or the vector bounding box is reprojected to 4326 in python, data shows up as just a thin layer a little north of the equator: data-bounds. The CRS is identified in the GeoTIFF as Lambert Azimuthal Equal Area:

CRS.from_wkt('PROJCS["Sphere_ARC_INFO_Lambert_Azimuthal_Equal_Area",GEOGCS["GCS_Sphere_ARC_INFO",DATUM["Sphere_ARC_INFO",SPHEROID["Sphere_ARC_INFO",6370997,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["latitude_of_center",90],PARAMETER["longitude_of_center",-180],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1],AXIS["Easting",EAST],AXIS["Northing",NORTH]]')
elongano commented 5 months ago

Category: Vegetation