diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-03 00:35:51 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-01-03 00:35:51 +0100 |
| commit | dc743b91402484baefdd70434f01918dfaae1887 (patch) | |
| tree | 5d9afa712c0895127029d196c7c4d1fb184b5c58 | |
| parent | f2433d2ad0da0662107ebe2f4a129db626deacff (diff) | |
| download | PROJ-data-dc743b91402484baefdd70434f01918dfaae1887.tar.gz PROJ-data-dc743b91402484baefdd70434f01918dfaae1887.zip | |
index.html: dynamically create agency list
| -rw-r--r-- | files.geojson | 4 | ||||
| -rw-r--r-- | index.html | 56 | ||||
| -rw-r--r-- | index.html.in | 52 |
3 files changed, 38 insertions, 74 deletions
diff --git a/files.geojson b/files.geojson index c572305..60fb771 100644 --- a/files.geojson +++ b/files.geojson @@ -150,7 +150,7 @@ { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/conus.tif", "name": "conus.tif", "area_of_use": "USA - Conterminous", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4267", "source_crs_name": "NAD27", "target_crs_code": "EPSG:4269", "target_crs_name": "NAD83", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD27 (EPSG:4267) to NAD83 (EPSG:4269)", "full_bbox": [ -131.0, 20.0, -63.0, 50.0 ] }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -129.17, 23.81 ], [ -65.69, 23.81 ], [ -65.69, 49.38 ], [ -129.17, 49.38 ], [ -129.17, 23.81 ] ] ] } }, { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/cshpgn.tif", "name": "cshpgn.tif", "area_of_use": "USA - California - South", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.0, 32.0 ], [ -113.0, 32.0 ], [ -113.0, 37.0 ], [ -122.0, 37.0 ], [ -122.0, 32.0 ] ] ] } }, { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/emhpgn.tif", "name": "emhpgn.tif", "area_of_use": "USA - Idaho and Montana East", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -113.0, 41.0 ], [ -103.0, 41.0 ], [ -103.0, 50.0 ], [ -113.0, 50.0 ], [ -113.0, 41.0 ] ] ] } }, -{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/eshpgn.tif", "name": "eshpgn.tif", "area_of_use": "USA - American Samoa - Eastern Islands", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4169", "source_crs_name": "American Samoa 1962", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "American Samoa 1962 (EPSG:4169) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -171.0, 14.0 ], [ -165.0, 14.0 ], [ -165.0, 20.0 ], [ -171.0, 20.0 ], [ -171.0, 14.0 ] ] ] } }, +{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/eshpgn.tif", "name": "eshpgn.tif", "area_of_use": "USA - American Samoa - Eastern Islands", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4169", "source_crs_name": "American Samoa 1962", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "American Samoa 1962 (EPSG:4169) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -171.0, -20.0 ], [ -165.0, -20.0 ], [ -165.0, -14.0 ], [ -171.0, -14.0 ], [ -171.0, -20.0 ] ] ] } }, { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/ethpgn.tif", "name": "ethpgn.tif", "area_of_use": "USA - Texas - Est", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -100.0, 25.0 ], [ -87.75, 25.0 ], [ -87.75, 35.0 ], [ -100.0, 35.0 ], [ -100.0, 25.0 ] ] ] } }, { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/flhpgn.tif", "name": "flhpgn.tif", "area_of_use": "USA - Florida", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -88.0, 24.0 ], [ -80.0, 24.0 ], [ -80.0, 32.0 ], [ -88.0, 32.0 ], [ -88.0, 24.0 ] ] ] } }, { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/g1999a01.tif", "name": "g1999a01.tif", "area_of_use": "USA - Alaska", "type": "VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:5703", "target_crs_name": "NAVD88 height", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAVD88 height (EPSG:5703)" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 172.0, 60.0 ], [ 180.0, 60.0 ], [ 180.0, 72.0 ], [ 172.0, 72.0 ], [ 172.0, 60.0 ] ] ], [ [ [ -180.0, 72.0 ], [ -180.0, 60.0 ], [ -156.0, 60.0 ], [ -156.0, 72.0 ], [ -180.0, 72.0 ] ] ] ] } }, @@ -232,7 +232,7 @@ { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/wihpgn.tif", "name": "wihpgn.tif", "area_of_use": "USA - Wisconsin", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -94.0, 42.0 ], [ -86.0, 42.0 ], [ -86.0, 48.0 ], [ -94.0, 48.0 ], [ -94.0, 42.0 ] ] ] } }, { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/wmhpgn.tif", "name": "wmhpgn.tif", "area_of_use": "USA - Idaho and Montana West", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -119.0, 41.0 ], [ -109.0, 41.0 ], [ -109.0, 50.0 ], [ -119.0, 50.0 ], [ -119.0, 41.0 ] ] ] } }, { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/wohpgn.tif", "name": "wohpgn.tif", "area_of_use": "USA - Washington and Oregon", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -125.0, 41.0 ], [ -116.0, 41.0 ], [ -116.0, 50.0 ], [ -125.0, 50.0 ], [ -125.0, 41.0 ] ] ] } }, -{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/wshpgn.tif", "name": "wshpgn.tif", "area_of_use": "USA - American Samoa - Western Islands", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4169", "source_crs_name": "American Samoa 1962", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "American Samoa 1962 (EPSG:4169) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -171.0, 14.0 ], [ -165.0, 14.0 ], [ -165.0, 20.0 ], [ -171.0, 20.0 ], [ -171.0, 14.0 ] ] ] } }, +{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/wshpgn.tif", "name": "wshpgn.tif", "area_of_use": "USA - American Samoa - Western Islands", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4169", "source_crs_name": "American Samoa 1962", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "American Samoa 1962 (EPSG:4169) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -171.0, -20.0 ], [ -165.0, -20.0 ], [ -165.0, -14.0 ], [ -171.0, -14.0 ], [ -171.0, -20.0 ] ] ] } }, { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/wthpgn.tif", "name": "wthpgn.tif", "area_of_use": "USA - Texas - West", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -107.0, 25.0 ], [ -99.0, 25.0 ], [ -99.0, 37.0 ], [ -107.0, 37.0 ], [ -107.0, 25.0 ] ] ] } }, { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/wvhpgn.tif", "name": "wvhpgn.tif", "area_of_use": "USA - West Virginia", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -84.0, 36.0 ], [ -76.75, 36.0 ], [ -76.75, 41.0 ], [ -84.0, 41.0 ], [ -84.0, 36.0 ] ] ] } }, { "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/wyhpgn.tif", "name": "wyhpgn.tif", "area_of_use": "USA - Wyoming", "type": "HORIZONTAL_OFFSET", "source_crs_code": "EPSG:4269", "source_crs_name": "NAD83", "target_crs_code": "EPSG:4152", "target_crs_name": "NAD83(HARN)", "source": "US National Oceanographic and Atmospheric Administration (NOAA)", "source_country": "USA", "source_id": "us_noaa", "source_url": "https:\/\/www.ngs.noaa.gov\/", "description": "NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152)" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -111.5, 40.5 ], [ -103.5, 40.5 ], [ -103.5, 45.5 ], [ -111.5, 45.5 ], [ -111.5, 40.5 ] ] ] } } @@ -112,6 +112,8 @@ the data: </p> <script> var fullGeoJSON = null; +var agencies_enabled = {} +var list_agencies = [] var featureSource = new ol.source.Vector({ format: new ol.format.GeoJSON(), @@ -123,6 +125,21 @@ var featureSource = new ol.source.Vector({ xhr.onload = function() { if (xhr.status == 200) { fullGeoJSON = JSON.parse(xhr.responseText); + + fullGeoJSON.features.forEach(function(f) { + if( agencies_enabled[f.properties.source_id] === undefined ) { + agencies_enabled[f.properties.source_id] = true; + list_agencies.push(f.properties.source_id); + } + }); + + list_agencies.sort(); + var agency_control = document.getElementById('agency_control'); + list_agencies.forEach(function(x){ + create_checkbox(x, x, agency_control, agencies_enabled); + }); + + featureSource.addFeatures( featureSource.getFormat().readFeatures(fullGeoJSON, { @@ -157,36 +174,6 @@ types_enabled['geoid'] = true; types_enabled['vertical_adjustments'] = true; types_enabled['velocity'] = true; types_enabled['other'] = true; - -var list_agencies = [ - "at_bev", - "au_ga", - "au_icsm", - "be_ign", - "ca_nrc", - "ca_que_mern", - "ch_swisstopo", - "de_adv", - "de_geosn", - "de_lgl_bw", - "de_lgvl_saarland", - "dk_sdfe", - "es_cat_icgc", - "eur_nkg", - "fr_ign", - "is_lmi", - "nz_linz", - "pt_dgt", - "se_lantmateriet", - "uk_os", - "us_noaa", - "us_nga" -] -var agencies_enabled = {} -list_agencies.forEach(function(x){ - agencies_enabled[x] = true; -}); - function refresh_source() { featureSource.clear(); var filtered = { @@ -256,11 +243,6 @@ create_checkbox('vertical_adjustments', 'Vertical shifts', type_control, types_e create_checkbox('velocity', 'Velocity grids', type_control, types_enabled); create_checkbox('other', 'Other grids', type_control, types_enabled); -var agency_control = document.getElementById('agency_control'); -list_agencies.forEach(function(x){ - create_checkbox(x, x, agency_control, agencies_enabled); -}); - /** * Elements that make up the popup. */ @@ -651,7 +633,7 @@ map.on('singleclick', function(evt) { <li><a href="conus.tif">conus.tif</a> - USA - Conterminous - NAD27 (EPSG:4267) to NAD83 (EPSG:4269). Last modified: 2019-12-28</li> <li><a href="cshpgn.tif">cshpgn.tif</a> - USA - California - South - NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> <li><a href="emhpgn.tif">emhpgn.tif</a> - USA - Idaho and Montana East - NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> -<li><a href="eshpgn.tif">eshpgn.tif</a> - USA - American Samoa - Eastern Islands - American Samoa 1962 (EPSG:4169) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> +<li><a href="eshpgn.tif">eshpgn.tif</a> - USA - American Samoa - Eastern Islands - American Samoa 1962 (EPSG:4169) to NAD83(HARN) (EPSG:4152). Last modified: 2020-01-02</li> <li><a href="ethpgn.tif">ethpgn.tif</a> - USA - Texas - Est - NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> <li><a href="flhpgn.tif">flhpgn.tif</a> - USA - Florida - NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> <li><a href="g1999a01.tif">g1999a01.tif</a> - USA - Alaska - NAD83 (EPSG:4269) to NAVD88 height (EPSG:5703). Size: 2.8 MB. Last modified: 2019-12-27</li> @@ -733,7 +715,7 @@ map.on('singleclick', function(evt) { <li><a href="wihpgn.tif">wihpgn.tif</a> - USA - Wisconsin - NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> <li><a href="wmhpgn.tif">wmhpgn.tif</a> - USA - Idaho and Montana West - NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> <li><a href="wohpgn.tif">wohpgn.tif</a> - USA - Washington and Oregon - NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> -<li><a href="wshpgn.tif">wshpgn.tif</a> - USA - American Samoa - Western Islands - American Samoa 1962 (EPSG:4169) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> +<li><a href="wshpgn.tif">wshpgn.tif</a> - USA - American Samoa - Western Islands - American Samoa 1962 (EPSG:4169) to NAD83(HARN) (EPSG:4152). Last modified: 2020-01-02</li> <li><a href="wthpgn.tif">wthpgn.tif</a> - USA - Texas - West - NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> <li><a href="wvhpgn.tif">wvhpgn.tif</a> - USA - West Virginia - NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> <li><a href="wyhpgn.tif">wyhpgn.tif</a> - USA - Wyoming - NAD83 (EPSG:4269) to NAD83(HARN) (EPSG:4152). Last modified: 2019-12-27</li> diff --git a/index.html.in b/index.html.in index ec8150b..c30376d 100644 --- a/index.html.in +++ b/index.html.in @@ -110,6 +110,8 @@ the data: </p> <script> var fullGeoJSON = null; +var agencies_enabled = {} +var list_agencies = [] var featureSource = new ol.source.Vector({ format: new ol.format.GeoJSON(), @@ -121,6 +123,21 @@ var featureSource = new ol.source.Vector({ xhr.onload = function() { if (xhr.status == 200) { fullGeoJSON = JSON.parse(xhr.responseText); + + fullGeoJSON.features.forEach(function(f) { + if( agencies_enabled[f.properties.source_id] === undefined ) { + agencies_enabled[f.properties.source_id] = true; + list_agencies.push(f.properties.source_id); + } + }); + + list_agencies.sort(); + var agency_control = document.getElementById('agency_control'); + list_agencies.forEach(function(x){ + create_checkbox(x, x, agency_control, agencies_enabled); + }); + + featureSource.addFeatures( featureSource.getFormat().readFeatures(fullGeoJSON, { @@ -155,36 +172,6 @@ types_enabled['geoid'] = true; types_enabled['vertical_adjustments'] = true; types_enabled['velocity'] = true; types_enabled['other'] = true; - -var list_agencies = [ - "at_bev", - "au_ga", - "au_icsm", - "be_ign", - "ca_nrc", - "ca_que_mern", - "ch_swisstopo", - "de_adv", - "de_geosn", - "de_lgl_bw", - "de_lgvl_saarland", - "dk_sdfe", - "es_cat_icgc", - "eur_nkg", - "fr_ign", - "is_lmi", - "nz_linz", - "pt_dgt", - "se_lantmateriet", - "uk_os", - "us_noaa", - "us_nga" -] -var agencies_enabled = {} -list_agencies.forEach(function(x){ - agencies_enabled[x] = true; -}); - function refresh_source() { featureSource.clear(); var filtered = { @@ -254,11 +241,6 @@ create_checkbox('vertical_adjustments', 'Vertical shifts', type_control, types_e create_checkbox('velocity', 'Velocity grids', type_control, types_enabled); create_checkbox('other', 'Other grids', type_control, types_enabled); -var agency_control = document.getElementById('agency_control'); -list_agencies.forEach(function(x){ - create_checkbox(x, x, agency_control, agencies_enabled); -}); - /** * Elements that make up the popup. */ |
