From 47d4462789f58c27c6aca8c135e253a6bd353578 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 6 Jul 2019 10:20:06 -0400 Subject: [PATCH 1/4] iiab-update-map description & extra_description --- roles/osm-vector-maps/templates/iiab-update-map | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/osm-vector-maps/templates/iiab-update-map b/roles/osm-vector-maps/templates/iiab-update-map index b11dcba90..b0607c823 100755 --- a/roles/osm-vector-maps/templates/iiab-update-map +++ b/roles/osm-vector-maps/templates/iiab-update-map @@ -165,11 +165,15 @@ def create_menu_def(region,default_name,intended_use='map'): menuDef["logo_url"] = default_logo menuitem = lang + '-' + item['perma_ref'] menuDef["menu_item_name"] = default_name - menuDef["title"] = "OpenStreetMap: 18 Levels of Zoom for " + item.get('title','ERROR') + '' + if item.get('title','ERROR') == "World": + menuDef["title"] = "OpenStreetMap: " + item.get('title','ERROR') + else: + menuDef["title"] = "OpenStreetMap: " + item.get('title','ERROR') + " & Earth" menuDef["map_name"] = item['perma_ref'] # the following is in the idx json #menuDef["file_name"] = lang + '-osm-omt_' + region + '_' + os.path.basename(item['url'])[:-4] - menuDef["description"] = '

Resolution of the Whole World to 5 KM. OpenStreetMap data for ' + item.get('title','') + ' with details down to 5 Meters

' + menuDef["description"] = '18 levels of zoom (5 m resolution) for ' + item.get('title','ERROR') + ', illustrating human geography.

10 levels of zoom (5 km resolution) of satellite photos covering the whole world.' + menuDef["extra_description"] = 'Search for cities/towns that have more than 1000 people. There are currently 127,654 such settlements.' menuDef["extra_html"] = "" #menuDef["automatically_generated"] = "true" menuDef["change_ref"] = "generated" From 3d7a5d7ebde172d10afa414d6725f51aef6c3552 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 6 Jul 2019 13:09:03 -0400 Subject: [PATCH 2/4] better Map Pack descriptions, building on PR #1823 --- .../osm-vector-maps/templates/iiab-update-map | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/roles/osm-vector-maps/templates/iiab-update-map b/roles/osm-vector-maps/templates/iiab-update-map index b0607c823..31b106234 100755 --- a/roles/osm-vector-maps/templates/iiab-update-map +++ b/roles/osm-vector-maps/templates/iiab-update-map @@ -27,8 +27,7 @@ else: doc_root = get_iiab_env('WWWROOT') menuDefs = doc_root + "/js-menu/menu-files/menu-defs/" vector_map_idx_dir = doc_root + "/common/assets" -#map_doc_root = '{{ vector_map_path }}' -map_doc_root = '/library/www/osm-vector-maps' +map_doc_root = '{{ vector_map_path }}' # /library/www/osm-vector-maps # map_catalog will be global, assumed always available map_catalog = {} map_menu_def_list = [] @@ -75,10 +74,10 @@ def main(): fetch_menu_json_value('autoupdate_menu'),region,)) menus.update_menu_json(menu_ref) # redirect from box/maps to an installed map rather than test page - with open('{{ vector_map_path }}/index.html','w') as fp: + with open(map_doc_root + '/index.html','w') as fp: outstr = """ \n\n"""%fname fp.write(outstr) - + def get_map_catalog(): global map_catalog @@ -165,15 +164,24 @@ def create_menu_def(region,default_name,intended_use='map'): menuDef["logo_url"] = default_logo menuitem = lang + '-' + item['perma_ref'] menuDef["menu_item_name"] = default_name + if item.get('title','ERROR') == "World": - menuDef["title"] = "OpenStreetMap: " + item.get('title','ERROR') + fancyTitle = "Planet Earth" + elif item.get('title','ERROR') == "Central America": + fancyTitle = "Central America-Caribbean" else: - menuDef["title"] = "OpenStreetMap: " + item.get('title','ERROR') + " & Earth" + fancyTitle = item.get('title','ERROR') + + if fancyTitle == "Planet Earth": + menuDef["title"] = "OpenStreetMap: " + fancyTitle + else: + menuDef["title"] = "OpenStreetMap: " + fancyTitle + " & Earth" + menuDef["map_name"] = item['perma_ref'] # the following is in the idx json #menuDef["file_name"] = lang + '-osm-omt_' + region + '_' + os.path.basename(item['url'])[:-4] - menuDef["description"] = '18 levels of zoom (5 m resolution) for ' + item.get('title','ERROR') + ', illustrating human geography.

10 levels of zoom (5 km resolution) of satellite photos covering the whole world.' - menuDef["extra_description"] = 'Search for cities/towns that have more than 1000 people. There are currently 127,654 such settlements.' + menuDef["description"] = '18 levels of zoom (5 m resolution) for ' + fancyTitle + ', illustrating human geography.

10 levels of zoom (5 km resolution) for satellite photos, covering the whole world.' + menuDef["extra_description"] = 'Search for cities/towns with more than 1000 people. There are about 127,654 worldwide.' menuDef["extra_html"] = "" #menuDef["automatically_generated"] = "true" menuDef["change_ref"] = "generated" @@ -181,7 +189,7 @@ def create_menu_def(region,default_name,intended_use='map'): if not os.path.isfile(menuDefs + default_name): # logic to here can still overwrite existing menu def print("creating %s"%menuDefs + default_name) with open(menuDefs + default_name,'w') as menufile: - menufile.write(json.dumps(menuDef,indent=2)) + menufile.write(json.dumps(menuDef,indent=4)) return default_name[:-5] def human_readable(num): From efcac138ef94766e08ce4e83bf0b460e88dea497 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 6 Jul 2019 13:50:10 -0400 Subject: [PATCH 3/4] 1m & 1km details are often visible, don't sell us short! --- roles/osm-vector-maps/templates/iiab-update-map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/osm-vector-maps/templates/iiab-update-map b/roles/osm-vector-maps/templates/iiab-update-map index 31b106234..ee56b142a 100755 --- a/roles/osm-vector-maps/templates/iiab-update-map +++ b/roles/osm-vector-maps/templates/iiab-update-map @@ -180,7 +180,7 @@ def create_menu_def(region,default_name,intended_use='map'): menuDef["map_name"] = item['perma_ref'] # the following is in the idx json #menuDef["file_name"] = lang + '-osm-omt_' + region + '_' + os.path.basename(item['url'])[:-4] - menuDef["description"] = '18 levels of zoom (5 m resolution) for ' + fancyTitle + ', illustrating human geography.

10 levels of zoom (5 km resolution) for satellite photos, covering the whole world.' + menuDef["description"] = '18 levels of zoom (~1 m details) for ' + fancyTitle + ', illustrating human geography.

10 levels of zoom (~1 km details) for satellite photos, covering the whole world.' menuDef["extra_description"] = 'Search for cities/towns with more than 1000 people. There are about 127,654 worldwide.' menuDef["extra_html"] = "" #menuDef["automatically_generated"] = "true" From fef93996b16d77b7d2dd0db2ae6e9e2db10eb74e Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 6 Jul 2019 14:07:50 -0400 Subject: [PATCH 4/4] Describe /usr/bin/iiab-update-map --- roles/osm-vector-maps/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/osm-vector-maps/tasks/main.yml b/roles/osm-vector-maps/tasks/main.yml index 9cccd6aa0..bf7a7bbf1 100644 --- a/roles/osm-vector-maps/tasks/main.yml +++ b/roles/osm-vector-maps/tasks/main.yml @@ -39,7 +39,7 @@ name: python-geojson state: present -- name: Install /usr/bin/iiab-update-map for updating of Map Pack catalog +- name: Install /usr/bin/iiab-update-map for updating of Map Pack catalog & descriptions template: src: iiab-update-map dest: /usr/bin/iiab-update-map