From d3fa305302ce789ccb98412cc39c043b3100bd7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Mon, 11 Nov 2024 10:56:35 -0800 Subject: [PATCH 1/2] Factored out language list --- renderer/languages.txt | 392 ++++++++++++++++++++++++++++++++++++++++ renderer/render_once.sh | 5 +- 2 files changed, 396 insertions(+), 1 deletion(-) create mode 100755 renderer/languages.txt diff --git a/renderer/languages.txt b/renderer/languages.txt new file mode 100755 index 0000000..60eb72c --- /dev/null +++ b/renderer/languages.txt @@ -0,0 +1,392 @@ +aaq +ab +abe +ace +af +aht +akz +ale +alg +alq +als +am +an +apj +apm +apw +ar +arp +arz +as +asb +ast +atj +az +az-Arab +az-Cyrl +az-Latn +azb +ba +bar +be +be-tarask +bea +ber +bg +bla +bm +bn +bo +bpy +br +bs +bxr +ca +cay +cdo +ce +ceb +cho +chp +chr +chy +cic +ckb +cku +clc +cmn +co +coo +cow +cr +cr-Latn +crg +crh +crh-Cyrl +crj +crk +crl +crm +cro +cs +csb +csw +cv +cwd +cy +da +dak +de +del +den +dgr +dsb +dv +dz +ee +egl +el +en +eo +es +esk +ess +esu +et +eu +fa +fi +fil +fit +fla +fo +fr +frr +fur +fy +ga +gag +gan +gcf +gd +git +gl +gn +gr +grc +gsw +gu +gv +gwi +ha +haa +hai +hak +hak-Hant +haw +he +hei +hi +hid +hif +hoi +hop +hr +hsb +ht +hu +hup +hur +hy +ia +id +ie +ik +ike +ikt +ilo +ing +int +io +is +it +iu +iu-Latn +ja +ja-Hira +ja-Latn +jv +ka +kab +kbd +kee +ki +kic +kio +kjq +kk +kk-Arab +kk-Cyrl +kk-Latn +kl +km +kn +ko +ko-Hani +ko-Latn +koy +krc +krl +ks +ku +kuu +kv +kw +kwk +ky +kyh +la +lb +lez +li +lij +lil +lkt +lld +lmo +ln +lo +lrc +lt +lut +lv +lzh +md +mdf +mez +mg +mhr +mi +mia +mic +mk +ml +mn +mnr +mo +moe +moh +mr +mrj +ms +ms-Arab +mt +mus +mwl +my +myv +mzn +nah +nan +nan-Hant +nan-Latn-pehoeji +nan-Latn-tailo +ncg +nds +ne +nez +nl +nn +no +nov +nsk +nuk +nv +oc +oj +ojb +ojg +oji +ojs +ojw +oka +old +one +ono +ood +or +os +ota +otw +pa +pam +pao +pcd +pfl +pl +pms +pnb +pot +pqm +ps +pt +pt-BR +pt-PT +ptw +qu +rm +ro +ru +rue +rw +sac +sah +sal +sat +sc +scn +sco +scs +sd +se +sec +see +sgs +sh +shh +shs +si +sju +sk +sl +sma +smj +so +sq +squ +sr +sr-Latn +srs +sto +str +su +sv +sw +syc +szl +ta +tau +tcb +te +tew +tfn +tg +th +th-Latn +thp +ti +tix +tk +tl +tli +tow +tr +tsi +tt +tt-Arab +tt-Cyrl +tt-Latn +tus +twf +udm +ug +uk +uma +umu +ur +ute +uz +uz-Arab +uz-Cyrl +uz-Latn +vec +vi +vi-Hani +vls +vo +wa +war +win +wiy +wo +wuu +wya +xmf +xsl +yak +yi +yo +ypk +yue +yue-Hans +yue-Hant +yue-Latn +yue-Latn-HK +yue-Latn-jyutping +za +zgh +zh +zh-Bopo +zh-Hans +zh-Hans-CN +zh-Hans-SG +zh-Hant +zh-Hant-CN +zh-Hant-HK +zh-Hant-MO +zh-Hant-TW +zh-Latn +zh-Latn-pinyin +zu +zun +zza diff --git a/renderer/render_once.sh b/renderer/render_once.sh index 6cdc8ee..b975c9d 100755 --- a/renderer/render_once.sh +++ b/renderer/render_once.sh @@ -36,6 +36,9 @@ rm -rf "$WORKING_DIR/data/sources/monaco.osm.pbf" PLANET="$WORKING_DIR/data/planet.pmtiles" +# Read in a line-delimited list of BCP 47 codes corresponding to name:* subkeys +languages=$(cat languages.txt | tr $'\n' ',') + docker run -e JAVA_TOOL_OPTIONS='-Xmx150g' \ -v "$WORKING_DIR/data":/data \ -v "$DIR/layers":/layers \ @@ -48,7 +51,7 @@ docker run -e JAVA_TOOL_OPTIONS='-Xmx150g' \ --storage=ram --nodemap-type=array \ --max-point-buffer=4 \ --building_merge_z13=false \ - --languages=aaq,ab,abe,ace,af,aht,akz,ale,alg,alq,als,am,an,apj,apm,apw,ar,arp,arz,as,asb,ast,atj,az,az-Arab,az-Cyrl,az-Latn,azb,ba,bar,be,be-tarask,bea,ber,bg,bla,bm,bn,bo,bpy,br,bs,bxr,ca,cay,cdo,ce,ceb,cho,chp,chr,chy,cic,ckb,cku,clc,cmn,co,coo,cow,cr,cr-Latn,crg,crh,crh-Cyrl,crj,crk,crl,crm,cro,cs,csb,csw,cv,cwd,cy,da,dak,de,del,den,dgr,dsb,dv,dz,ee,egl,el,en,eo,es,esk,ess,esu,et,eu,fa,fi,fil,fit,fla,fo,fr,frr,fur,fy,ga,gag,gan,gcf,gd,git,gl,gn,gr,grc,gsw,gu,gv,gwi,ha,haa,hai,hak,hak-Hant,haw,he,hei,hi,hid,hif,hoi,hop,hr,hsb,ht,hu,hup,hur,hy,ia,id,ie,ik,ike,ikt,ilo,ing,int,io,is,it,iu,iu-Latn,ja,ja-Hira,ja-Latn,jv,ka,kab,kbd,kee,ki,kic,kio,kjq,kk,kk-Arab,kk-Cyrl,kk-Latn,kl,km,kn,ko,ko-Hani,ko-Latn,koy,krc,krl,ks,ku,kuu,kv,kw,kwk,ky,kyh,la,lb,lez,li,lij,lil,lkt,lld,lmo,ln,lo,lrc,lt,lut,lv,lzh,md,mdf,mez,mg,mhr,mi,mia,mic,mk,ml,mn,mnr,mo,moe,moh,mr,mrj,ms,ms-Arab,mt,mus,mwl,my,myv,mzn,nah,nan,nan-Hant,nan-Latn-pehoeji,nan-Latn-tailo,ncg,nds,ne,nez,nl,nn,no,nov,nsk,nuk,nv,oc,oj,ojb,ojg,oji,ojs,ojw,oka,old,one,ono,ood,or,os,ota,otw,pa,pam,pao,pcd,pfl,pl,pms,pnb,pot,pqm,ps,pt,pt-BR,pt-PT,ptw,qu,rm,ro,ru,rue,rw,sac,sah,sal,sat,sc,scn,sco,scs,sd,se,sec,see,sgs,sh,shh,shs,si,sju,sk,sl,sma,smj,so,sq,squ,sr,sr-Latn,srs,sto,str,su,sv,sw,syc,szl,ta,tau,tcb,te,tew,tfn,tg,th,th-Latn,thp,ti,tix,tk,tl,tli,tow,tr,tsi,tt,tt-Arab,tt-Cyrl,tt-Latn,tus,twf,udm,ug,uk,uma,umu,ur,ute,uz,uz-Arab,uz-Cyrl,uz-Latn,vec,vi,vi-Hani,vls,vo,wa,war,win,wiy,wo,wuu,wya,xmf,xsl,yak,yi,yo,ypk,yue,yue-Hans,yue-Hant,yue-Latn,yue-Latn-HK,yue-Latn-jyutping,za,zgh,zh,zh-Bopo,zh-Hans,zh-Hans-CN,zh-Hans-SG,zh-Hant,zh-Hant-CN,zh-Hant-HK,zh-Hant-MO,zh-Hant-TW,zh-Latn,zh-Latn-pinyin,zu,zun,zza + --languages="${languages%%,}" # Check if the file exists and is at least 50GB if [[ ! -f "$PLANET" ]]; then From 2329b44f2405b1661ccc2308c64ba8e507a5f3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Mon, 11 Nov 2024 10:57:41 -0800 Subject: [PATCH 2/2] Generate taginfo project file --- renderer/render_once.sh | 4 ++++ renderer/taginfo_template.json | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 renderer/taginfo_template.json diff --git a/renderer/render_once.sh b/renderer/render_once.sh index b975c9d..178b90a 100755 --- a/renderer/render_once.sh +++ b/renderer/render_once.sh @@ -93,6 +93,10 @@ done echo 'Waiting for all background jobs to finish' wait +echo 'Regenerating taginfo project file' +cat "$DIR/languages.txt" | sed -E 's/([-A-Za-z]+)/{"key": "name:\1", "object_types": ["node", "way", "relation", "area"]}/g' | jq -s '.' > "$DIR/languages.json" +jq -s '.[0].tags += .[1] | .[0]' "$DIR/taginfo_template.json" "$DIR/languages.json" > "$DIR/../static/taginfo.json" + echo 'Invalidating the CDN cache' aws cloudfront create-invalidation --distribution-id E1SJ64GZNQSV8M --invalidation-batch "{\"Paths\": {\"Quantity\": 1, \"Items\": [\"/*\"]}, \"CallerReference\": \"invalidation-$DATE\"}" diff --git a/renderer/taginfo_template.json b/renderer/taginfo_template.json new file mode 100644 index 0000000..a55dbb4 --- /dev/null +++ b/renderer/taginfo_template.json @@ -0,0 +1,15 @@ +{ + "data_format": 1, + "project": { + "name": "OpenStreetMap U.S. Tile Service", + "description": "A vector tile server for community projects.", + "project_url": "https://github.com/osmus/tileservice/", + "doc_url": "https://tile.ourmap.us/", + "icon_url": "https://openstreetmap.us/img/osmus-logo.svg", + "contact_name": "OpenStreetMap U.S.", + "contact_email": "team@openstreetmap.us" + }, + "tags": [ + {"key": "name", "object_types": ["node", "way", "relation", "area"]} + ] +}