Make a hazard-map MBTiles app
Bug #1097679 reported by
Ben Wyss
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenQuake Platform |
Fix Committed
|
Undecided
|
Ben Wyss |
Bug Description
This will involve gathering requirements, gathering and formatting data, pre-processing data, then adding the data into a tilemill project, activate some kind of interactivity (as needed), rendering the interactivity as a text, a table, or a chart (as needed) and then finally mix the layer(s) into a leaflet/wax app.
summary: |
- Make a hazard-map/curve MBTiles app + Make a hazard-map MBTiles app |
Changed in openquake: | |
status: | New → Confirmed |
no longer affects: | openquake |
Changed in oq-platform: | |
status: | New → Fix Released |
status: | Fix Released → Fix Committed |
assignee: | nobody → Ben Wyss (bmwyss) |
To post a comment you must log in.
For this task we decided to use MBTiles format for the data as it provides very fast rendering to the client.
1. The hazard map data is vector data in a grid. The hazard map data was first transformed from csv to shapefile.
2. The data was then interpolated into a raster with: power=1. 5:smoothing= 1.0 -outsize 3000 3000 -txe -180 -180 -tye -80 80 -zfield iml -co "iml=iml" -ot iml -of GTiff -l temp2 map_world_ complete_ PGA_0.1. shp haz_world_ interp_ 1.5
gdal_grid -a invdist:
3. This raster was then converted into a contour map. To do this I used the Gdal contour:
gdal_contour -a ELEV -i 0.01 "<path to input raster> <path to output shapefile>
4. Clip the contours that are outside of the landmass. download natural earth land area: http:// www.naturaleart hdata.com/ downloads/ 10m-physical- vectors/ then clip the contour layer against the natural earth layer
5. Load the shapefile into tilemill and style: rgb(255, 0,0);
@color:
#hazard_contour { spin(@color, 355); line-width: 9; } spin(@color, 355); line-width: 8; } spin(@color, 350); line-width: 7.7; } spin(@color, 350); line-width: 7.5; } spin(@color, 1); line-width: 7.3; } spin(@color, 1); line-width: 7; } spin(@color, 5); line-width: 6.7; } spin(@color, 5); line-width: 6.5; } spin(@color, 10); line-width: 6.3; } spin(@color, 10); line-width: 6; } spin(@color, 15); line-width: 5.7; } spin(@color, 15); line-width: 5.5; } spin(@color, 20); line-width: 5.3; } spin(@color, 20); line-width: 5; } spin(@color, 25); line-width: 4.7; } spin(@color, 25); line-width: 4.5; } spin(@color, 30); line-width: 4.3; } spin(@color, 35); line-width: 4; } spin(@color, 42); line-width: 3.7; } spin(@color, 47); line-width: 3.5; } spin(@color, 53); line-width: 3.3; } spin(@color, 75); line-width: 3; } spin(@color, 80); line-width: 2.7; } spin(@color, 65); line-width: 2.5; line-opacity:0;} spin(@color, 70); line-width: 2.3; line-opacity:0;} spin(@color, 75); line-width: 2; line-opacity:0; } spin(@color, 80); line-width: 1; line-opacity:0;} spin(@color, 180); line-width:.6; } spin(@color, 0); }
line-width:1;
[zoom < 13] { line-width: .5}
line-opacity:.4;
line-join:round;
line-gamma:1;
line-join:round;
line-smooth:1;
[ELEV <= 0.595] { line-color:
[ELEV <= 0.55] { line-color:
[ELEV <= 0.5] { line-color:
[ELEV <= 0.25] { line-color:
[ELEV <= 0.23] { line-color:
[ELEV <= 0.22] { line-color:
[ELEV <= 0.21] { line-color:
[ELEV <= 0.20] { line-color:
[ELEV <= 0.19] { line-color:
[ELEV <= 0.18] { line-color:
[ELEV <= 0.17] { line-color:
[ELEV <= 0.16] { line-color:
[ELEV <= 0.15] { line-color:
[ELEV <= 0.14] { line-color:
[ELEV <= 0.13] { line-color:
[ELEV <= 0.12] { line-color:
[ELEV <= 0.11] { line-color:
[ELEV <= 0.10] { line-color:
[ELEV <= 0.09] { line-color:
[ELEV <= 0.08] { line-color:
[ELEV <= 0.07] { line-color:
[ELEV <= 0.06] { line-color:
[ELEV <= 0.05] { line-color:
[ELEV <= 0.04] { line-color:
[ELEV <= 0.03] { line-color:
[ELEV <= 0.02] { line-color:
[ELEV <= 0.01] { line-color:
[ELEV <= 0.005] { line-color:
[ELEV <= 0] { line-color:
}