diff --git a/etc/nshm/sites-ceus.csv b/etc/nshm/sites-ceus.csv new file mode 100644 index 0000000000000000000000000000000000000000..0e7465dbb8cf6048143e79fda5e366cc9002d9f9 --- /dev/null +++ b/etc/nshm/sites-ceus.csv @@ -0,0 +1,71 @@ +name, lon, lat +Washington DC, -77.05, 38.90 +Atmore AL, -87.50, 31.00 +Birmingham AL, -86.80, 33.50 +El Dorado AR, -92.70, 33.20 +Greenbrier AR, -92.40, 35.20 +Little Rock AR, -92.30, 34.75 +Denver CO, -105.00, 39.75 +La Junta CO, -103.55, 38.00 +Trinidad CO, -104.50, 37.20 +Hartford CT, -72.70, 41.75 +Wilmington DE, -75.55, 39.75 +Jacksonville FL, -81.65, 30.35 +Miami FL, -80.20, 25.75 +Atlanta GA, -84.40, 33.75 +Lincolnton GA, -82.50, 33.80 +Savannah GA, -81.10, 32.10 +Central IL, -90.00, 40.00 +Chicago IL, -87.65, 41.85 +Evansville IN, -87.60, 38.00 +Indianapolis IN, -86.15, 39.80 +Des Moines IA, -93.60, 41.60 +Topeka KS, -95.70, 39.05 +Wichita KS, -97.35, 37.70 +Louisville KY, -85.75, 38.25 +New Orleans LA, -90.05, 29.95 +Augusta ME, -69.80, 44.30 +Bangor ME, -68.80, 44.80 +Portland ME, -70.25, 43.65 +Baltimore MD, -76.60, 39.30 +Boston MA, -71.05, 42.35 +Detroit MI, -83.05, 42.35 +Minneapolis MN, -93.30, 45.00 +Jackson MS, -90.20, 32.30 +Cape Girardeau MO, -89.50, 37.30 +New Madrid MO, -89.55, 36.60 +St Louis MO, -90.20, 38.60 +Omaha NE, -96.00, 41.25 +Manchester NH, -71.45, 43.00 +Trenton NJ, -74.75, 40.20 +Batavia NY, -78.20, 43.00 +Malone NY, -74.30, 44.85 +New York NY, -74.00, 40.75 +Charlotte NC, -80.85, 35.25 +Fargo ND, -96.80, 46.90 +Columbus OH, -83.00, 39.95 +Sidney OH, -84.15, 40.30 +Youngstown OH, -80.65, 41.10 +Elgin OK, -98.30, 34.80 +Oklahoma City OK, -97.50, 35.50 +Philadelphia PA, -75.15, 39.95 +Providence RI, -71.40, 41.80 +Charleston SC, -79.95, 32.80 +Edgemont SD, -103.85, 43.30 +Platte SD, -98.85, 43.40 +Sioux Falls SD, -96.75, 43.55 +Chattanooga TN, -85.25, 35.05 +Knoxville TN, -83.90, 35.95 +Maryville TN, -84.00, 35.75 +Memphis TN, -90.05, 35.15 +Amarillo TX, -101.85, 35.20 +Dallas TX, -96.80, 32.80 +Houston TX, -95.35, 29.75 +Kermit TX, -103.10, 31.85 +San Antonio TX, -98.50, 29.40 +Snyder TX, -100.90, 32.70 +Burlington VT, -73.20, 44.50 +Richmond VA, -77.45, 37.55 +Charleston WV, -81.65, 38.35 +Milwaukee WI, -87.90, 43.05 +Cheyenne WY, -104.80, 41.15 diff --git a/etc/nshm/sites-ceus.geojson b/etc/nshm/sites-ceus.geojson new file mode 100644 index 0000000000000000000000000000000000000000..176f00c029baa903d1aa560bb995bb1920d174d2 --- /dev/null +++ b/etc/nshm/sites-ceus.geojson @@ -0,0 +1,775 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-77.05, 38.9] + }, + "properties": { + "marker-size": "small", + "title": "Washington DC" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-87.5, 31.0] + }, + "properties": { + "marker-size": "small", + "title": "Atmore AL" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-86.8, 33.5] + }, + "properties": { + "marker-size": "small", + "title": "Birmingham AL" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-92.7, 33.2] + }, + "properties": { + "marker-size": "small", + "title": "El Dorado AR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-92.4, 35.2] + }, + "properties": { + "marker-size": "small", + "title": "Greenbrier AR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-92.3, 34.75] + }, + "properties": { + "marker-size": "small", + "title": "Little Rock AR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-105.0, 39.75] + }, + "properties": { + "marker-size": "small", + "title": "Denver CO" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-103.55, 38.0] + }, + "properties": { + "marker-size": "small", + "title": "La Junta CO" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-104.5, 37.2] + }, + "properties": { + "marker-size": "small", + "title": "Trinidad CO" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-72.7, 41.75] + }, + "properties": { + "marker-size": "small", + "title": "Hartford CT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-75.55, 39.75] + }, + "properties": { + "marker-size": "small", + "title": "Wilmington DE" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-81.65, 30.35] + }, + "properties": { + "marker-size": "small", + "title": "Jacksonville FL" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-80.2, 25.75] + }, + "properties": { + "marker-size": "small", + "title": "Miami FL" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-84.4, 33.75] + }, + "properties": { + "marker-size": "small", + "title": "Atlanta GA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-82.5, 33.8] + }, + "properties": { + "marker-size": "small", + "title": "Lincolnton GA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-81.1, 32.1] + }, + "properties": { + "marker-size": "small", + "title": "Savannah GA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-90.0, 40.0] + }, + "properties": { + "marker-size": "small", + "title": "Central IL" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-87.65, 41.85] + }, + "properties": { + "marker-size": "small", + "title": "Chicago IL" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-87.6, 38.0] + }, + "properties": { + "marker-size": "small", + "title": "Evansville IN" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-86.15, 39.8] + }, + "properties": { + "marker-size": "small", + "title": "Indianapolis IN" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-93.6, 41.6] + }, + "properties": { + "marker-size": "small", + "title": "Des Moines IA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-95.7, 39.05] + }, + "properties": { + "marker-size": "small", + "title": "Topeka KS" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-97.35, 37.7] + }, + "properties": { + "marker-size": "small", + "title": "Wichita KS" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-85.75, 38.25] + }, + "properties": { + "marker-size": "small", + "title": "Louisville KY" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-90.05, 29.95] + }, + "properties": { + "marker-size": "small", + "title": "New Orleans LA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-69.8, 44.3] + }, + "properties": { + "marker-size": "small", + "title": "Augusta ME" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-68.8, 44.8] + }, + "properties": { + "marker-size": "small", + "title": "Bangor ME" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-70.25, 43.65] + }, + "properties": { + "marker-size": "small", + "title": "Portland ME" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-76.6, 39.3] + }, + "properties": { + "marker-size": "small", + "title": "Baltimore MD" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-71.05, 42.35] + }, + "properties": { + "marker-size": "small", + "title": "Boston MA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-83.05, 42.35] + }, + "properties": { + "marker-size": "small", + "title": "Detroit MI" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-93.3, 45.0] + }, + "properties": { + "marker-size": "small", + "title": "Minneapolis MN" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-90.2, 32.3] + }, + "properties": { + "marker-size": "small", + "title": "Jackson MS" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-89.5, 37.3] + }, + "properties": { + "marker-size": "small", + "title": "Cape Girardeau MO" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-89.55, 36.6] + }, + "properties": { + "marker-size": "small", + "title": "New Madrid MO" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-90.2, 38.6] + }, + "properties": { + "marker-size": "small", + "title": "St Louis MO" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-96.0, 41.25] + }, + "properties": { + "marker-size": "small", + "title": "Omaha NE" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-71.45, 43.0] + }, + "properties": { + "marker-size": "small", + "title": "Manchester NH" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-74.75, 40.2] + }, + "properties": { + "marker-size": "small", + "title": "Trenton NJ" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-78.2, 43.0] + }, + "properties": { + "marker-size": "small", + "title": "Batavia NY" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-74.3, 44.85] + }, + "properties": { + "marker-size": "small", + "title": "Malone NY" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-74.0, 40.75] + }, + "properties": { + "marker-size": "small", + "title": "New York NY" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-80.85, 35.25] + }, + "properties": { + "marker-size": "small", + "title": "Charlotte NC" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-96.8, 46.9] + }, + "properties": { + "marker-size": "small", + "title": "Fargo ND" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-83.0, 39.95] + }, + "properties": { + "marker-size": "small", + "title": "Columbus OH" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-84.15, 40.3] + }, + "properties": { + "marker-size": "small", + "title": "Sidney OH" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-80.65, 41.1] + }, + "properties": { + "marker-size": "small", + "title": "Youngstown OH" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-98.3, 34.8] + }, + "properties": { + "marker-size": "small", + "title": "Elgin OK" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-97.5, 35.5] + }, + "properties": { + "marker-size": "small", + "title": "Oklahoma City OK" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-75.15, 39.95] + }, + "properties": { + "marker-size": "small", + "title": "Philadelphia PA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-71.4, 41.8] + }, + "properties": { + "marker-size": "small", + "title": "Providence RI" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-79.95, 32.8] + }, + "properties": { + "marker-size": "small", + "title": "Charleston SC" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-103.85, 43.3] + }, + "properties": { + "marker-size": "small", + "title": "Edgemont SD" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-98.85, 43.4] + }, + "properties": { + "marker-size": "small", + "title": "Platte SD" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-96.75, 43.55] + }, + "properties": { + "marker-size": "small", + "title": "Sioux Falls SD" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-85.25, 35.05] + }, + "properties": { + "marker-size": "small", + "title": "Chattanooga TN" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-83.9, 35.95] + }, + "properties": { + "marker-size": "small", + "title": "Knoxville TN" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-84.0, 35.75] + }, + "properties": { + "marker-size": "small", + "title": "Maryville TN" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-90.05, 35.15] + }, + "properties": { + "marker-size": "small", + "title": "Memphis TN" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-101.85, 35.2] + }, + "properties": { + "marker-size": "small", + "title": "Amarillo TX" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-96.8, 32.8] + }, + "properties": { + "marker-size": "small", + "title": "Dallas TX" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-95.35, 29.75] + }, + "properties": { + "marker-size": "small", + "title": "Houston TX" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-103.1, 31.85] + }, + "properties": { + "marker-size": "small", + "title": "Kermit TX" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-98.5, 29.4] + }, + "properties": { + "marker-size": "small", + "title": "San Antonio TX" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-100.9, 32.7] + }, + "properties": { + "marker-size": "small", + "title": "Snyder TX" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-73.2, 44.5] + }, + "properties": { + "marker-size": "small", + "title": "Burlington VT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-77.45, 37.55] + }, + "properties": { + "marker-size": "small", + "title": "Richmond VA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-81.65, 38.35] + }, + "properties": { + "marker-size": "small", + "title": "Charleston WV" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-87.9, 43.05] + }, + "properties": { + "marker-size": "small", + "title": "Milwaukee WI" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-104.8, 41.15] + }, + "properties": { + "marker-size": "small", + "title": "Cheyenne WY" + } + } + ] +} diff --git a/etc/nshm/sites-wus.csv b/etc/nshm/sites-wus.csv new file mode 100644 index 0000000000000000000000000000000000000000..5a174577069cad4874d3f1f9a851cc3a0419f539 --- /dev/null +++ b/etc/nshm/sites-wus.csv @@ -0,0 +1,88 @@ +name, lon, lat +Big Sur CA, -121.75, 36.25 +Coalinga CA, -120.40, 36.15 +Concord CA, -122.00, 37.95 +Eureka CA, -124.20, 40.80 +Fresno CA, -119.75, 36.75 +Monterey CA, -121.90, 36.60 +Morgan Hill CA, -121.65, 37.15 +Oakland CA, -122.25, 37.80 +Redding CA, -122.40, 40.60 +Sacramento CA, -121.50, 38.60 +San Francisco CA, -122.40, 37.75 +San Jose CA, -121.90, 37.35 +San Mateo CA, -122.30, 37.55 +Santa Cruz CA, -122.05, 36.95 +Santa Rosa CA, -122.70, 38.45 +Vallejo CA, -122.25, 38.10 +Bakersfield CA, -119.35, 35.35 +Brawley CA, -115.55, 33.00 +Century City CA, -118.40, 34.05 +Cucamonga CA, -117.55, 34.20 +Death Valley CA, -116.85, 36.35 +Diablo Canyon CA, -120.85, 35.20 +Irvine CA, -117.80, 33.65 +Long Beach CA, -118.20, 33.80 +Los Angeles CA, -118.25, 34.05 +Malibu West CA, -118.95, 34.05 +Mammoth Lakes CA, -119.00, 37.65 +Northridge CA, -118.55, 34.20 +Palmdale CA, -118.00, 34.50 +Palm Springs CA, -116.55, 33.85 +Pasadena CA, -118.15, 34.15 +Riverside CA, -117.40, 33.95 +San Bernardino CA, -117.30, 34.10 +San Diego CA, -117.15, 32.70 +San Luis Obispo CA, -120.65, 35.30 +San Onofre CA, -117.55, 33.40 +Santa Barbara CA, -119.70, 34.45 +Ventura CA, -119.30, 34.30 +Grand Canyon Village AZ, -112.15, 36.05 +Palo Verde AZ, -112.85, 33.40 +Phoenix AZ, -112.10, 33.45 +Tucson AZ, -110.95, 32.20 +Paradox CO, -108.95, 38.40 +Rangely CO, -108.80, 40.10 +Boise ID, -116.20, 43.60 +Idaho National Lab ID, -112.85, 43.60 +Lima MT, -112.60, 44.65 +Bozeman MT, -111.05, 45.70 +Billings MT, -108.50, 45.80 +Missoula MT, -114.00, 46.90 +Carson City NV, -119.75, 39.15 +Elko NV, -115.75, 40.85 +Las Vegas NV, -115.15, 36.20 +Reno NV, -119.80, 39.55 +Albuquerque NM, -106.60, 35.10 +Artesia NM, -104.40, 32.85 +Los Alamos National Lab NM, -106.30, 35.85 +Las Cruces NM, -106.75, 32.30 +Brigham City UT, -112.00, 41.50 +Cedar City UT, -113.05, 37.70 +Green River UT, -110.15, 39.00 +Provo UT, -111.65, 40.25 +Salt Lake City UT, -111.90, 40.75 +Casper WY, -106.30, 42.85 +Jackson WY, -110.75, 43.50 +Yellowstone WY, -110.55, 44.40 +Astoria OR, -123.85, 46.20 +Bend OR, -121.30, 44.05 +Brookings OR, -124.25, 42.05 +Coos Bay OR, -124.20, 43.40 +Eugene OR, -123.10, 44.05 +Klamath Falls OR, -121.80, 42.20 +Medford OR, -122.90, 42.35 +Newport OR, -124.05, 44.65 +Pendleton OR, -118.80, 45.70 +Portland OR, -122.65, 45.50 +Salem OR, -123.05, 44.95 +Aberdeen WA, -123.80, 47.00 +Bellingham WA, -122.50, 48.75 +Ellensburg WA, -120.55, 47.00 +Everett WA, -122.20, 48.00 +Hanford Site WA, -119.60, 46.55 +Olympia WA, -122.90, 47.05 +Seattle WA, -122.30, 47.60 +Spokane WA, -117.40, 47.65 +Tacoma WA, -122.45, 47.25 +Yakima WA, -120.50, 46.60 diff --git a/etc/nshm/sites-wus.geojson b/etc/nshm/sites-wus.geojson new file mode 100644 index 0000000000000000000000000000000000000000..efb2e602533dfb962fba5c02b5d64030d28ed9b1 --- /dev/null +++ b/etc/nshm/sites-wus.geojson @@ -0,0 +1,962 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-121.75, 36.25] + }, + "properties": { + "marker-size": "small", + "title": "Big Sur CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-120.4, 36.15] + }, + "properties": { + "marker-size": "small", + "title": "Coalinga CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.0, 37.95] + }, + "properties": { + "marker-size": "small", + "title": "Concord CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-124.2, 40.8] + }, + "properties": { + "marker-size": "small", + "title": "Eureka CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-119.75, 36.75] + }, + "properties": { + "marker-size": "small", + "title": "Fresno CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-121.9, 36.6] + }, + "properties": { + "marker-size": "small", + "title": "Monterey CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-121.65, 37.15] + }, + "properties": { + "marker-size": "small", + "title": "Morgan Hill CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.25, 37.8] + }, + "properties": { + "marker-size": "small", + "title": "Oakland CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.4, 40.6] + }, + "properties": { + "marker-size": "small", + "title": "Redding CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-121.5, 38.6] + }, + "properties": { + "marker-size": "small", + "title": "Sacramento CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.4, 37.75] + }, + "properties": { + "marker-size": "small", + "title": "San Francisco CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-121.9, 37.35] + }, + "properties": { + "marker-size": "small", + "title": "San Jose CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.3, 37.55] + }, + "properties": { + "marker-size": "small", + "title": "San Mateo CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.05, 36.95] + }, + "properties": { + "marker-size": "small", + "title": "Santa Cruz CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.7, 38.45] + }, + "properties": { + "marker-size": "small", + "title": "Santa Rosa CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.25, 38.1] + }, + "properties": { + "marker-size": "small", + "title": "Vallejo CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-119.35, 35.35] + }, + "properties": { + "marker-size": "small", + "title": "Bakersfield CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-115.55, 33.0] + }, + "properties": { + "marker-size": "small", + "title": "Brawley CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-118.4, 34.05] + }, + "properties": { + "marker-size": "small", + "title": "Century City CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-117.55, 34.2] + }, + "properties": { + "marker-size": "small", + "title": "Cucamonga CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-116.85, 36.35] + }, + "properties": { + "marker-size": "small", + "title": "Death Valley CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-120.85, 35.2] + }, + "properties": { + "marker-size": "small", + "title": "Diablo Canyon CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-117.8, 33.65] + }, + "properties": { + "marker-size": "small", + "title": "Irvine CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-118.2, 33.8] + }, + "properties": { + "marker-size": "small", + "title": "Long Beach CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-118.25, 34.05] + }, + "properties": { + "marker-size": "small", + "title": "Los Angeles CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-118.95, 34.05] + }, + "properties": { + "marker-size": "small", + "title": "Malibu West CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-119.0, 37.65] + }, + "properties": { + "marker-size": "small", + "title": "Mammoth Lakes CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-118.55, 34.2] + }, + "properties": { + "marker-size": "small", + "title": "Northridge CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-118.0, 34.5] + }, + "properties": { + "marker-size": "small", + "title": "Palmdale CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-116.55, 33.85] + }, + "properties": { + "marker-size": "small", + "title": "Palm Springs CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-118.15, 34.15] + }, + "properties": { + "marker-size": "small", + "title": "Pasadena CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-117.4, 33.95] + }, + "properties": { + "marker-size": "small", + "title": "Riverside CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-117.3, 34.1] + }, + "properties": { + "marker-size": "small", + "title": "San Bernardino CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-117.15, 32.7] + }, + "properties": { + "marker-size": "small", + "title": "San Diego CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-120.65, 35.3] + }, + "properties": { + "marker-size": "small", + "title": "San Luis Obispo CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-117.55, 33.4] + }, + "properties": { + "marker-size": "small", + "title": "San Onofre CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-119.7, 34.45] + }, + "properties": { + "marker-size": "small", + "title": "Santa Barbara CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-119.3, 34.3] + }, + "properties": { + "marker-size": "small", + "title": "Ventura CA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-112.15, 36.05] + }, + "properties": { + "marker-size": "small", + "title": "Grand Canyon Village AZ" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-112.85, 33.4] + }, + "properties": { + "marker-size": "small", + "title": "Palo Verde AZ" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-112.1, 33.45] + }, + "properties": { + "marker-size": "small", + "title": "Phoenix AZ" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-110.95, 32.2] + }, + "properties": { + "marker-size": "small", + "title": "Tucson AZ" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-108.95, 38.4] + }, + "properties": { + "marker-size": "small", + "title": "Paradox CO" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-108.8, 40.1] + }, + "properties": { + "marker-size": "small", + "title": "Rangely CO" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-116.2, 43.6] + }, + "properties": { + "marker-size": "small", + "title": "Boise ID" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-112.85, 43.6] + }, + "properties": { + "marker-size": "small", + "title": "Idaho National Lab ID" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-112.6, 44.65] + }, + "properties": { + "marker-size": "small", + "title": "Lima MT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-111.05, 45.7] + }, + "properties": { + "marker-size": "small", + "title": "Bozeman MT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-108.5, 45.8] + }, + "properties": { + "marker-size": "small", + "title": "Billings MT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-114.0, 46.9] + }, + "properties": { + "marker-size": "small", + "title": "Missoula MT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-119.75, 39.15] + }, + "properties": { + "marker-size": "small", + "title": "Carson City NV" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-115.75, 40.85] + }, + "properties": { + "marker-size": "small", + "title": "Elko NV" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-115.15, 36.2] + }, + "properties": { + "marker-size": "small", + "title": "Las Vegas NV" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-119.8, 39.55] + }, + "properties": { + "marker-size": "small", + "title": "Reno NV" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-106.6, 35.1] + }, + "properties": { + "marker-size": "small", + "title": "Albuquerque NM" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-104.4, 32.85] + }, + "properties": { + "marker-size": "small", + "title": "Artesia NM" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-106.3, 35.85] + }, + "properties": { + "marker-size": "small", + "title": "Los Alamos National Lab NM" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-106.75, 32.3] + }, + "properties": { + "marker-size": "small", + "title": "Las Cruces NM" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-112.0, 41.5] + }, + "properties": { + "marker-size": "small", + "title": "Brigham City UT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-113.05, 37.7] + }, + "properties": { + "marker-size": "small", + "title": "Cedar City UT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-110.15, 39.0] + }, + "properties": { + "marker-size": "small", + "title": "Green River UT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-111.65, 40.25] + }, + "properties": { + "marker-size": "small", + "title": "Provo UT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-111.9, 40.75] + }, + "properties": { + "marker-size": "small", + "title": "Salt Lake City UT" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-106.3, 42.85] + }, + "properties": { + "marker-size": "small", + "title": "Casper WY" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-110.75, 43.5] + }, + "properties": { + "marker-size": "small", + "title": "Jackson WY" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-110.55, 44.4] + }, + "properties": { + "marker-size": "small", + "title": "Yellowstone WY" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-123.85, 46.2] + }, + "properties": { + "marker-size": "small", + "title": "Astoria OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-121.3, 44.05] + }, + "properties": { + "marker-size": "small", + "title": "Bend OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-124.25, 42.05] + }, + "properties": { + "marker-size": "small", + "title": "Brookings OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-124.2, 43.4] + }, + "properties": { + "marker-size": "small", + "title": "Coos Bay OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-123.1, 44.05] + }, + "properties": { + "marker-size": "small", + "title": "Eugene OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-121.8, 42.2] + }, + "properties": { + "marker-size": "small", + "title": "Klamath Falls OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.9, 42.35] + }, + "properties": { + "marker-size": "small", + "title": "Medford OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-124.05, 44.65] + }, + "properties": { + "marker-size": "small", + "title": "Newport OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-118.8, 45.7] + }, + "properties": { + "marker-size": "small", + "title": "Pendleton OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.65, 45.5] + }, + "properties": { + "marker-size": "small", + "title": "Portland OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-123.05, 44.95] + }, + "properties": { + "marker-size": "small", + "title": "Salem OR" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-123.8, 47.0] + }, + "properties": { + "marker-size": "small", + "title": "Aberdeen WA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.5, 48.75] + }, + "properties": { + "marker-size": "small", + "title": "Bellingham WA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-120.55, 47.0] + }, + "properties": { + "marker-size": "small", + "title": "Ellensburg WA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.2, 48.0] + }, + "properties": { + "marker-size": "small", + "title": "Everett WA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-119.6, 46.55] + }, + "properties": { + "marker-size": "small", + "title": "Hanford Site WA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.9, 47.05] + }, + "properties": { + "marker-size": "small", + "title": "Olympia WA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.3, 47.6] + }, + "properties": { + "marker-size": "small", + "title": "Seattle WA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-117.4, 47.65] + }, + "properties": { + "marker-size": "small", + "title": "Spokane WA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.45, 47.25] + }, + "properties": { + "marker-size": "small", + "title": "Tacoma WA" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-120.5, 46.6] + }, + "properties": { + "marker-size": "small", + "title": "Yakima WA" + } + } + ] +} diff --git a/src/org/opensha2/util/Export.java b/src/org/opensha2/util/Export.java new file mode 100644 index 0000000000000000000000000000000000000000..ab31d048a56d59eee03c1226f7deb4a3b88a94f8 --- /dev/null +++ b/src/org/opensha2/util/Export.java @@ -0,0 +1,206 @@ +package org.opensha2.util; + +import static org.opensha2.util.MathUtils.round; +import static com.google.common.base.Strings.*; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.EnumSet; +import java.util.List; +import java.util.Set; + +import org.opensha2.calc.NamedLocation; +import org.opensha2.geo.Location; +import org.opensha2.geo.LocationList; + +import com.google.common.base.Function; +import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.annotations.SerializedName; + +/** + * Methods for exporting data as TXT, JSON, KML, CSV, etc. + * + * @author Peter Powers + */ +final class Export { + + private static final Gson GSON = new GsonBuilder() + .setPrettyPrinting() + .disableHtmlEscaping() + .create(); + + private static final Path EXPORT_DIR = Paths.get("etc", "nshm"); + + public static void main(String[] args) throws IOException { + writeNshmpSites(); + writeNshmpPolys(); + } + + /* + * Currently, we're exporting map regions as polygons. Although the GeoJSON + * spec supports polygons with holes (and hence 3-dimensional arrays, we + * only support singular polygons. Polygons render better than PointStrings + * in any event. + */ + static void writeNshmpPolys() throws IOException { + LocationList usCoords = NshmpPolygon.CONTERMINOUS_US.coordinates(); + Path jsonOut = EXPORT_DIR.resolve("map-ceus.geojson"); + LocationList ceusBounds = NshmpPolygon.NSHMP_CEUS_BOUNDS.coordinates(); + writePolyJson(jsonOut, "NSHMP Central & Eastern US", usCoords, ceusBounds); + } + + static void writePolyJson(Path out, String name, LocationList coords, LocationList bounds) + throws IOException { + Feature f = createPolygon(name, coords, bounds); + String json = cleanPoly(GSON.toJson(f)); + Files.write(out, json.getBytes(StandardCharsets.UTF_8)); + } + + static void writeNshmpSites() throws IOException { + writeSites("nshmp", EnumSet.allOf(NshmpSite.class)); + writeSites("ceus", NshmpSite.ceus()); + writeSites("wus", NshmpSite.wus()); + } + + static void writeSites(String name, Collection<? extends NamedLocation> sites) + throws IOException { + Path jsonOut = EXPORT_DIR.resolve("sites-" + name + ".geojson"); + writeJsonSites(jsonOut, sites); + Path csvOut = EXPORT_DIR.resolve("sites-" + name + ".csv"); + writeCsvSites(csvOut, sites); + } + + private static final DecimalFormat FMT = new DecimalFormat("0.00"); + private static final int NAME_BUFF = 28; + private static final int LON_BUFF = 8; + private static final int LAT_BUFF = 7; + + private static void writeCsvSites(Path out, Collection<? extends NamedLocation> locs) + throws IOException { + Iterable<String> lines = Iterables.transform(locs, new Function<NamedLocation, String>() { + @Override + public String apply(NamedLocation loc) { + StringBuilder sb = new StringBuilder(); + sb.append(padEnd(loc.toString() + ",", NAME_BUFF, ' ')); + sb.append(padStart(FMT.format(loc.location().lon()), LON_BUFF, ' ')); + sb.append(','); + sb.append(padStart(FMT.format(loc.location().lat()), LAT_BUFF, ' ')); + return sb.toString(); + } + }); + String header = new StringBuilder(padEnd("name,", NAME_BUFF, ' ')) + .append(padStart("lon", LON_BUFF, ' ')) + .append(',') + .append(padStart("lat", LAT_BUFF, ' ')) + .toString(); + Files.write( + out, + Iterables.concat(ImmutableList.of(header), lines), + StandardCharsets.UTF_8); + } + + private static void writeJsonSites(Path out, Collection<? extends NamedLocation> sites) + throws IOException { + + List<Feature> features = new ArrayList<>(sites.size()); + for (NamedLocation loc : sites) { + features.add(createPoint(loc)); + } + FeatureCollection fc = new FeatureCollection(); + fc.features = features; + String json = cleanPoints(GSON.toJson(fc)); + + Files.write(out, json.getBytes(StandardCharsets.UTF_8)); + + } + + /* GeoJSON objects */ + + static class FeatureCollection { + String type = "FeatureCollection"; + List<Feature> features; + } + + static class Feature { + String type = "Feature"; + double[] bbox; + Geometry geometry = new Geometry(); + Properties properties; + } + + static Feature createPoint(NamedLocation loc) { + Feature f = new Feature(); + f.geometry.type = "Point"; + f.geometry.coordinates = toCoordinates(loc.location()); + f.properties = new PointProperties(); + f.properties.title = loc.toString(); + return f; + } + + static Feature createPolygon(String name, LocationList coords, LocationList bounds) { + Feature f = new Feature(); + f.bbox = bounds.bounds().toArray(); + f.geometry.type = "Polygon"; + f.geometry.coordinates = ImmutableList.of(toCoordinates(coords)); + f.properties = new PolyProperties(); + f.properties.title = name; + return f; + } + + static class Geometry { + String type; + Object coordinates; + } + + static class Properties { + String title; + } + + static class PointProperties extends Properties { + @SerializedName("marker-size") + String markerSize = "small"; + } + + static class PolyProperties extends Properties {} + + static double[] toCoordinates(Location loc) { + return new double[] { round(loc.lon(), 5), round(loc.lat(), 5) }; + } + + static double[][] toCoordinates(LocationList locs) { + double[][] coords = new double[locs.size()][2]; + for (int i = 0; i < locs.size(); i++) { + coords[i] = toCoordinates(locs.get(i)); + } + return coords; + } + + /* brute force compaction of coordinate array onto single line */ + static String cleanPoints(String s) { + return s.replace(": [\n ", ": [") + .replace(",\n ", ", ") + .replace("\n ]", "]") + "\n"; + } + + /* brute force compaction of coordinate array onto single line */ + static String cleanPoly(String s) { + return s + .replace("\n [", "[") + .replace("[\n ", "[ ") + .replace(",\n ", ", ") + .replace("\n ]", " ]") + .replace("\n ]", "]") + "\n"; + } + +}