WikiWatershed / model-my-watershed

The web application front end for Model My Watershed.
https://modelmywatershed.org
Apache License 2.0
57 stars 31 forks source link

Create reclassified NLCD 2011 raster #2864

Closed ajrobbins closed 6 years ago

ajrobbins commented 6 years ago

In order to provide a baseline for 2050 land use projections, we'll be including a "2011 urban land cover" raster for visualization, from the layer selector. We already have the NLCD 2011 raster ingested, so in order to derive urban land cover we need to reclassify it to combine the urbanized categories.

The new raster should only have two classes, urbanized and nonurbanized land cover. Urbanized consists of the four developed land categories, values 21, 22, 23, 24.

rajadain commented 6 years ago

Should the non-urbanized be "no data" or "non-urbanized"? (i.e. showing one color and empty map vs showing two colors on the map)

ajrobbins commented 6 years ago

Not sure - @aufdenkampe what do you think?

The applicable Shippensburg product appears to have white or no data for non-urbanized: screen shot 2018-06-01 at 12 48 21 pm

aufdenkampe commented 6 years ago

I think "not developed" should be white for all four datasets. Read below.

The Shippensburg 2050 products from Scott should be byte rasters, with values ranging from 0 to 100, right?

These were intended to indicate the probability of being urbanized in 2050, with 0 representing 0% probability of being urbanized and 100 representing 100% probability of being urbanized, which should also equal the 2011 urban classes (assumption is that if urbanized now, it will still be urbanized in 2050). We didn't complete our discussion of the visualization color ramp, but one good option would be to to continuously grade from White (=0) to Red (=100). Given our opacity slider, I think having 0 equal clear/transparent might make it tricky to clearly see those location with 0% probability of urbanizing. Seeing this is important.

The idea was that the 2011 Urban layer dataset would be set up identically, except that it would only have values of 0 and 100 (or 1 for efficiency, as long as it is visualized as 100), and only 2 colors (i.e. white and red).

For reference, see Notes from Topic 3a Data layers for visualization and analysis notes for 2018-03-20 Bi-Weekly MMW2 Tech Meeting.

kellyi commented 6 years ago

I created the tiles for reclassified NLCD locally and I'm getting set to push them to S3.

For reference, I set up tilejson.io to display the new tiles adjacent to the existing tiles:

left: reclassified; right: nlcd 2011

screen shot 2018-07-25 at 1 21 12 pm

left: reclassified; right: Shippensburg 2050 baseline

screen shot 2018-07-25 at 1 21 22 pm

left: reclassified; right: Shippensburg 2050 baseline (zoomed out to show matching extents)

screen shot 2018-07-25 at 1 21 42 pm

kellyi commented 6 years ago

Also for future reference: I used this Python script to get the bbox of the Shippensburg source geotiff for using to crop & mask the NLCD RDD data before reclassifying and tiling:

import json
import rasterio
import rasterio.features
import rasterio.warp

with rasterio.open("shippensburg.tif") as dataset:
    mask = dataset.dataset_mask()

    for geom, val in rasterio.features.shapes(
            mask, transform=dataset.transform):
        geom = rasterio.warp.transform_geom(
            dataset.crs, 'EPSG:4326', geom, precision=6)

        print(json.dumps(geom, indent=4))

That's basically the Rasterio "hello world", adjusted so the output polygon was actual GeoJSON: https://rasterio.readthedocs.io/en/latest/#rasterio-access-to-geospatial-raster-data

kellyi commented 6 years ago

Here they are in my local MMW

screen shot 2018-07-25 at 4 41 27 pm

Uploading to S3 now