Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ONE COMPATHの地図の開発技術~入門編~ OCEM #2

ONE COMPATHの地図の開発技術~入門編~ OCEM #2

ONE COMPATHの地図の開発技術~入門編~

ONECOMPATH Engineer Meetup #2 (OCEM#2)
https://ocem.connpass.com/event/273110/

One compath

March 08, 2023
Tweet

More Decks by One compath

Other Decks in Programming

Transcript

  1. ©ONE COMPATH CO., LTD. All rights reserved. ! ਗ਼ਫचཬʢ͠Έͣ͡ΎΓʣ !

    αʔϏεਪਐɾٕज़౷ׅຊ෦ SREɾٕज़ઓུ෦ MapionG ʢ௕͍ʣ ! ϚϐΦϯαʔϏεͷاը/ӡ༻ɺ
 ஍ਤݕࡧج൫Λ୲౰͢ΔάϧʔϓͷϚωʔδϟʔ ! OSGeo೔ຊࢧ෦ ཧࣄ ! ৄ͘͠͸ޙ΄Ͳɾɾɾ ! झຯ → ཱྀߦɺ͓স͍ɺϦΞϧ୤ग़ήʔϜ 2 ࣗݾ঺հ
  2. ©ONE COMPATH CO., LTD. All rights reserved. 4 POINT 1

    POINT 2 POINT 3 ඒ͍͠஍ਤσβΠϯ
 ೔ຊ࠷େڃͷ஍ਤݕࡧαΠτ "໎Θͳ͍஍ਤ"ͱ"ݟָͯ͠ΊΔ஍ਤ"Λཱ྆ͨ͠೔ຊ࠷େڃͷ஍ਤݕࡧαΠτMapionʢϚϐΦϯʣɻ पลεϙοτݕࡧ΍ϧʔτݕࡧɺ৐׵Ҋ಺ʹఱؾ༧ใͳͲɺ͓Ͱ͔͚ʹศརͳ৘ใ΋ܝࡌɻ ஍ਤݕࡧαʔϏε Mapio n ΞϓϦʮ஍ਤϚϐΦϯʯ ݄ؒUU 1200ສਓ https://www.mapion.co.jp/ ೔ຊॳͷ Πϯλʔωοτ஍ਤ “໎Θͳ͍஍ਤ”ͱ“ݟָͯ͠ΊΔ஍ਤ”Λ ཱ྆ͨ͠ศརͰָ͍͠Πϯλʔωοτ ஍ਤͰάουσβΠϯ৆΋ड৆ ศརͰָ͍͠஍ਤ͕ ౥ࡌ͞Εͨ஍ਤΞϓϦ ڥքઢϚοϓ ௨Γ໊Ϛοϓ ܙํػೳ ڥքઢ΍ಓ࿏ɺ๷ࡂϚοϓͳͲ༷ʑͳ ༻్ʹಛԽͨ͠๛෋ͳϥΠϯφοϓɻ ͞Βʹ͸અ෼ʹ໾ཱͭʮܙํʯ͕෼͔ Δػೳ΋ ϚϐΦϯ஍ਤΛϕʔεͱͨ͠ ଟ࠼ͳΞϓϦ ΩϣϦଌ ௒ϐϯϙΠϯτఱؾ ࣗ෼޷ΈͷϧʔτΛઃఆ͠ڑ཭ΛଌΔ ͜ͱ͕Ͱ͖ΔʮΩϣϦଌʯ΍ɺ௒ϐϯ ϙΠϯτͳಛఆͷ৔ॴͷఱؾ͕Θ͔Δ ʮ௒ϐϯϙΠϯτఱؾʯͳͲ΋ల։
  3. ©ONE COMPATH CO., LTD. All rights reserved. ! ϚϐΦϯΞϓϦ(iOS൛ʣ !

    2020೥େ෯ϦχϡʔΞϧɻڥքϚοϓɺ౸ୡݍϚοϓͳͲɺଓʑػೳ௥ՃΛϦϦʔε 5 ϚϐΦϯΞϓϦ ڥքઢϚοϓ ඪ४஍ਤ ͻΒ͕ͳϚοϓ ๷ࡂϚοϓ ౸ୡݍϚοϓ
  4. ©ONE COMPATH CO., LTD. All rights reserved. 7 GISͱ͸ʁ !

    ஍ཧ৘ใγεςϜʢGeographic Information Systemʣ ! ஍ཧ৘ใ͓Αͼ෇Ճ৘ใΛίϯϐϡʔλ্Ͱ࡞੒ɾอଘɾར༻ɾ؅ཧɾදࣔɾݕࡧ͢ ΔγεςϜ
  5. ©ONE COMPATH CO., LTD. All rights reserved. 8 GISͱ͸ʁ !

    QGI S ! ΦʔϓϯιʔεͷGI S ! ஍ཧ৘ใͷӾཡɺฤूɺ෼ੳͳͲΛߦ͏͜ͱ͕Ͱ͖Δ ! ֤छͷϕΫλʗϥελϑΥʔϚοτͱͦΕΛૢ࡞͢ΔίϚϯυͰߏ ੒͞Ε͍ͯΔ ! PostGI S ! ΦʔϓϯιʔεͷGI S ! GISΛѻ͏ͨΊͷPostgreSQLͷ֦ுϞδϡʔϧ ! ஍ཧΦϒδΣΫτʢҢ౓ܦ౓ʹΑΔҐஔΛ࣋ͬͨ఺ɺઢɺ໘ʣΛѻ ͑ΔΑ͏ʹͳΔ
  6. ©ONE COMPATH CO., LTD. All rights reserved. 9 ༨ஊ !

    ͜Ε༨ஊͳΜͰ͚͢Ͳɾɾɾ ! FOSS4 G ! Φʔϓϯιʔεͷ஍ཧ৘ใιϑτ΢ΣΞ(GIS)܈
 Free Open Source Software for GeoSpatia l ! OSGe o ! FOSS4GΛԠԉ͢Δ૊৫ ! ONE COMPATH ΋OSGeo೔ຊࢧ෦Λஂମձһͱͯ͠ࢧԉ ! ͜ͷ૊৫ͷཧࣄΛ΍ͬͯ·͢
  7. ©ONE COMPATH CO., LTD. All rights reserved. ! ϥελʔ !

    ը૾ܗࣜʢpng, jpgͳͲʣͰ࡞ΒΕͨ஍ਤλΠϧ ! ϕΫλʔ ! ϕΫλʔܗࣜʢGeoJSON, Protocol BuffersͳͲʣͰ࡞ ΒΕͨ஍ਤλΠϧ ! ʮ఺ʯʢϙΠϯτʣ
 ʮઢʯʢϙϦϥΠϯʣ
 ʮ໘ʯʢϙϦΰϯʣ
 ͷ৘ใͱͦͷଐੑ৘ใͰߏ੒͞Ε͍ͯΔ 10 ϥελʔͱϕΫλʔ
  8. ©ONE COMPATH CO., LTD. All rights reserved. ! ϥελʔ !

    ඪ४ / Ͱ͔ࣈ ! ஍ਤϚϐΦϯWEB/ΞϓϦɺ๏ਓҊ݅ͳͲͰར༻͞Ε͍ͯΔ 12 ONE COMPATH ͷ஍ਤ
  9. ©ONE COMPATH CO., LTD. All rights reserved. ! ϕΫλʔ !

    ඪ४ ! ஍ਤϚϐΦϯΞϓϦɺ๏ਓҊ݅ɺaruku&ʢ΢ΥʔΩϯάΞϓϦʣͳͲͰར༻͞Ε ͍ͯΔ ! ௨Γ໊ / ͻΒ͕ͳ / ڥք ͳͲ ! ஍ਤϚϐΦϯΞϓϦͰར༻͞Ε͍ͯΔ 13 ONE COMPATH ͷ஍ਤ
  10. ©ONE COMPATH CO., LTD. All rights reserved. ! ONE COMPATH

    ͷϕΫλʔλΠϧ͸ɺ MapboxVectorTile ͱ͍͏࢓༷Λ࠾༻͍ͯ͠·͢ ! MapboxVectorTileͱ͸ʁ ! Mapbox͕ఆΊͨϕΫλʔλΠϧͷΦʔϓϯͳ࢓༷ 16 ϕΫλʔλΠϧͷੜ੒ͱ഑৴
  11. ©ONE COMPATH CO., LTD. All rights reserved. ! MapboxVectorTileΛඳը͢ΔͨΊʹඞཁͳ΋ͷ !

    ϕΫλʔλΠϧ ! ελΠϧϑΝΠϧ ! εϓϥΠτϑΝΠϧ ! ϑΥϯτϑΝΠϧ 18 ϕΫλʔλΠϧͷੜ੒ͱ഑৴
  12. ©ONE COMPATH CO., LTD. All rights reserved. ! ϕΫλʔλΠϧʢMapboxVectorTileʣ !

    Protocol Buffers ܗࣜ ! Geometryͷ૬ର࠲ඪΛΤϯίʔυͨ͠΋ͷͱଐੑ৘ใͷू·Γ 19 ϕΫλʔλΠϧͷੜ੒ͱ഑৴
  13. ©ONE COMPATH CO., LTD. All rights reserved. ! ελΠϧϑΝΠϧʢMapboxStyleʣ !

    ஍ਤͷσβΠϯΛܾΊΔϑΝΠϧ ! jsonܗࣜ ! ONE COMPATH Ͱ͸ MVT Styler Λ࢖ͬͯɺ
 ࡞੒/ฤूΛߦ͍ͬͯΔ 20 ϕΫλʔλΠϧͷੜ੒ͱ഑৴
  14. ©ONE COMPATH CO., LTD. All rights reserved. ! ελΠϧϑΝΠϧʢMapboxStyleʣ !

    MVT-Style r ! ϦΞϧλΠϜͰσβΠϯͷมߋ͕֬ೝ Ͱ͖Δ ! γϯϓϧͳػೳͰɺ௚ײతʹૢ࡞Ͱ͖ Δ ! ஍ਤ্ͰϨΠϠʔΛ֬ೝͰ͖ΔͷͰศ ར 21 ϕΫλʔλΠϧͷੜ੒ͱ഑৴
  15. ©ONE COMPATH CO., LTD. All rights reserved. ! εϓϥΠτϑΝΠϧ !

    ஍ਤ্ͷΞΠίϯΛ·ͱΊͨεϓϥΠτϑΝΠϧ ! pngϑΝΠϧͱjsonϑΝΠϧͰߏ੒͞ΕΔ 22 ϕΫλʔλΠϧͷੜ੒ͱ഑৴ \lTBNQMFTWH \XJEUI IFJHIU Y Z QJYFM3BUJP^  lTBNQMFTWH \XJEUI IFJHIU Y Z QJYFM3BUJP^  ʜ png json
  16. ©ONE COMPATH CO., LTD. All rights reserved. ! ϑΥϯτϑΝΠϧ !

    ϑΥϯτϑΝΠϧʢttfͳͲʣ͔ΒglyphΛ256୯ҐͰ෼ׂͯͦ͠ΕΛpbfԽͨ͠΋ͷ ! ϩʔΧϧͷϑΥϯτϑΝΠϧΛ࢖͏͜ͱͰෛՙΛܰݮͰ͖Δ ! localIdeographFontFamilyΛࢦఆ 23 ϕΫλʔλΠϧͷੜ੒ͱ഑৴ DPOTUNBQOFXNBQCPYHM.BQ \ DPOUBJOFSNBQ  TUZMF999  DFOUFS< >  [PPN  MPDBM*EFPHSBQI'POU'BNJMZ/PUP4BOT /PUP4BOT$+,4$ TBOTTFSJG ^ 
  17. ©ONE COMPATH CO., LTD. All rights reserved. 24 ༨ஊ !

    ͜Ε༨ஊͳΜͰ͚͢Ͳɾɾɾ ! aruku&ʢ΢ΥʔΩϯάΞϓϦʣͰ͸ϕΫλʔ஍ਤ͕࢖ΘΕ͍ͯΔ
 ࣮͸શ෦ಉ͡λΠϧͰελΠϧϑΝΠϧ͕ҧ͏͚ͩ
  18. ©ONE COMPATH CO., LTD. All rights reserved. 25 ༨ஊ !

    ͞Βʹɺ͜Ε༨ஊͳΜͰ͚͢Ͳɾɾɾ ! ϚϐΦϯͷେ͖ͳڧΈͰ΋͋Δʮඒ͍͠ʯ஍ਤ
 ͜ΕΛ࣮ݱͤ͞ΔͨΊʹiOS൛஍ਤϚϐΦϯͷ ελΠϧϑΝΠϧ͸ɺ20000ߦҎ্
  19. ©ONE COMPATH CO., LTD. All rights reserved. 27 ΫϥΠΞϯτଆͷඳը !

    MapLibre Maps SDK Λར༻ ! Mapbox GL JSͷv1.13.0͕ϑΥʔΫͯ͠ੜ·ΕͨΦʔϓϯιʔεϓϩδΣΫτ ! 2020೥12݄ʹMapbox GL JS͕ver2.0ΛϦϦʔε͢ΔࡍɺΦʔϓϯιʔεΛࣙΊ MapboxಠࣗͰ։ൃΛਐΊΔํ਑ʹ੾Γସ͑ɺAPIར༻ʹΑΔॏ՝੍ۚΛಋೖ͠·͠ ͨɻ
 ͜Εʹ൐͍ɺMapbox GL JSͱ͸ผͷΦʔϓϯιʔεϓϩδΣΫτͱͯ͠MapLibre͕ ੜ·Ε·ͨ͠ɻ
  20. ©ONE COMPATH CO., LTD. All rights reserved. 29 ஍ਤͷੜ੒ ϕΫλʔ

    λΠϧ ϕΫλʔ λΠϧ ϕΫλʔ λΠϧ S3 RDS Postgre s + PostGIS EC2 AWS ੜ੒αʔό ɾ
 ɾ ɾ ஍ਤͷσʔλ͸ PostGISͰ؅ཧ ST_ASMVTͱ͍͏ؔ਺Ͱλ Πϧ৘ใ͕औಘͰ͖Δ ϕΫλʔ λΠϧ ϕΫλʔ λΠϧ ϥελʔ λΠϧ ϥελʔλΠϧ͸ϕΫλʔ λΠϧ͔Βੜ੒ ੜ੒αʔό͸σʔλߋ৽ͷ ࣌ͷΈىಈ ೔ຊશҬͷੜ੒ αʔό6୆Ͱ37࣌ؒ ೔ຊશҬͷੜ੒ αʔό30୆Ͱ67࣌ؒ
  21. ©ONE COMPATH CO., LTD. All rights reserved. 30 ஍ਤͷ഑৴ ϕΫλʔ

    λΠϧ ϕΫλʔ λΠϧ ϕΫλʔ λΠϧ S3 AWS ϕΫλʔ λΠϧ ϕΫλʔ λΠϧ ϥελʔ λΠϧ ελΠϧϑΝΠϧ εϓϥΠτϑΝΠϧ ϕΫλʔ ഑৴αʔό ϥελʔ ഑৴αʔό ϨϯμϦϯά EC2 CFʹΩϟογϡͤ͞Δ͜ͱͰ௨৴ ྔΛ཈͍͑ͯΔ ஍ਤ͸೔ʑߋ৽͞Ε͍ͯΔͷͰ Ωϟογϡ࣌ؒ͸4࣌ؒ ͍ͣΕECSԽΛݕ౼ λΠϧͱ͸ผʹελΠϧ ϑΝΠϧɺεϓϥΠτ ϑΝΠϧ΋S3ʹ഑ஔ
  22. ©ONE COMPATH CO., LTD. All rights reserved. 32 ৽͍͠ϨΠϠ͕Ͱ͖Δ·Ͱ !

    ͜͜·Ͱͷ࿩Λ౿·͑ͯɺͻΒ͕ͳϚοϓΛྫʹ৽͍͠ϨΠϠΛ௥Ճ͢Δ·ͰͷྲྀΕΛઆ ໌͠·͢ ! ͻΒ͕ͳϚοϓͱ͸ʁ ! 2022೥10݄ʹiOS൛஍ਤϚϐΦϯʹ௥Ճ͞ΕͨϨΠϠ ! ͢΂ͯͷ஫ه͕ͻΒ͕ͳͰදࣔ ! σβΠϯ͸ඪ४஍ਤΛ౿ऻ
  23. ©ONE COMPATH CO., LTD. All rights reserved. 33 ৽͍͠ϨΠϠ͕Ͱ͖Δ·Ͱ !

    λΠϧੜ੒ ! ελΠϧϑΝΠϧ࡞੒ ! ϨϏϡʔΛ܁Γฦͯ͠ɺλΠϧ࢓༷/σβΠϯΛݟ௚͠ ! ஍ਤλΠϧϦϦʔε ! ΞϓϦ࣮૷ ! ΞϓϦϦϦʔε
  24. ©ONE COMPATH CO., LTD. All rights reserved. 34 λΠϧੜ੒ !

    θϩ͔ΒλΠϧΛੜ੒͢ΔͷͰ͸ͳ͘ɺඪ४஍ਤʹϓϥεΞϧϑΝඞཁͳ৘ใΛ࣋ͭλΠ ϧΛ࡞Δ ! ͲͷॖईͰͲͷ৘ใΛࡌͤΔ͔Λௐ੔͠ͳ͕ΒઃఆΛߦ͏ + ඪ४஍ਤͷഎܠΛͦͷ··࢖͏ ͻΒ͕ͳ஫هͷλΠϧΛ৽ͨʹ࡞੒
  25. ©ONE COMPATH CO., LTD. All rights reserved. 35 ελΠϧϑΝΠϧ࡞੒ !

    MVT-StylerͰ஫هͷ৭΍େ͖͞ͳͲΛܾΊ͍ͯ͘ ! ͻΒ͕ͳϚοϓͳΒͰ͸ͷ໰୊ͱͯ͠ɺ஫ه͕௕͘ͳΓ͗ͯ͢͠·͍ɺΈͮΒ͘ͳͬͯ͠ ·͏ͷͰɺվߦΛೖΕΔͳͲ޻෉͍ͯ͠Δ ! ࠓճ͸ϕʔεͷ஍ਤ͸ඪ४஍ਤͩͬͨͷͰɺεϓϥΠτϑΝΠϧ͸ෆཁɻΞΠίϯΛ௥Ճ ͨ͠ΓɺృΓͭͿ͍ͨ࣌͠͸εϓϥΠτϑΝΠϧ΋ඞཁ ը૾ͰϙϦΰϯΛృΓͭͿ͍ͯ͠Δɻ ͜͏͍ͬͨ஍ਤΛϦϦʔε͢Δ৔߹͸εϓ ϥΠτϑΝΠϧͷ௥Ճ΋ඞཁ
  26. ©ONE COMPATH CO., LTD. All rights reserved. 36 ϨϏϡʔ !

    ΈΜͳͰ஍ਤΛݟͳ͕Βҙݟަ׵ ! ஫هͷେ͖͞΍ग़͠෼͚ͳͲʹ͍ͭͯ࿩͠߹͍ɺඞཁʹԠͯ͡ɺλΠϧमਖ਼/ελΠϧ ϑΝΠϧमਖ਼Λ܁Γฦ͢ ! ͻΒ͕ͳϚοϓͰ͸ϨϏϡʔ͸ܭ4ճ ϑΣϦʔͷߤ࿏΋ͻΒ͕ͳͰදࣔ Ͱ͖ͳ͍͔ʁ ಓ࿏໊͸΋͏গ͠໨ཱͨͤͯ΋͍ ͍ͷͰ͸ʁ ͓ࢠ͞Μʹ΋࢖ͬͯཉ͍͠ͷͰ༡ Ԃ஍͸ද͍ࣔͨ͠ ౎ಓ෎ݝͷ৭෼͚Ͳ͏͢Δʁ
  27. ©ONE COMPATH CO., LTD. All rights reserved. 37 ஍ਤϦϦʔε !

    ຊ൪λΠϧΛੜ੒ & ελΠϧϑΝΠϧϦϦʔε ϕΫλʔ λΠϧ ϕΫλʔ λΠϧ ϕΫλʔ λΠϧ S3 RDS Postgre s + PostGIS EC2 AWS ੜ੒αʔό ελΠϧϑΝΠϧ ͻΒ͕ͳ஍ਤͷλΠϧੜ੒ ͷઃఆΛϦϦʔε λΠϧੜ੒ MVTStylerͰ࡞੒ͨ͠ελΠϧϑΝΠ ϧΛΞοϓϩʔυ
  28. ©ONE COMPATH CO., LTD. All rights reserved. 38 ΞϓϦ࣮૷ !

    ϨΠϠ௥Ճ & ϞʔμϧΛͻΒ͕ͳʹ ௥Ճ ඪ४஍ਤ ͻΒ͕ͳ஍ਤ
  29. ©ONE COMPATH CO., LTD. All rights reserved. 42 ·ͱΊ !

    GIS͸஍ཧ৘ใΛѻ͏ͨΊͷٕज़ ! ONE COMPATH Ͱ͸ΦʔϓϯͳGISʢFOSS4GʣΛۦ࢖ͯ͠ɺ஍ਤαʔϏεΛ࣮ݱ͍ͯ͠Δ ! ϕΫλʔλΠϧΛར༻͢Δ͜ͱͰɺ͞·͟·ͳ஍ਤσβΠϯ͕௥ՃͰ͖Δ ! ஍ਤͷੜ੒/഑৴͸AWS্Ͱߦ͍ɺAWSͷಛੑΛ׆͔ͨ͠ߏ੒/ӡ༻Λߦͳ͍ͬͯΔ ! ஍ਤϨΠϠΛ௥Ճ͢Δࡍ͸ɺΈΜͳͰҙݟΛग़͠ͳ͕Βࢼߦࡨޡ
  30. ©ONE COMPATH CO., LTD. All rights reserved. 43 ·ͱΊ !

    ࠓ೔͝঺հͨ͠ͷ͸GISͷ΄ΜͷೖΓޱͰ͢ ! ͞ΒʹσΟʔϓͳੈքʹ଍Λ౿ΈೖΕ͍ͨͱ͍͏ํ͕͍ͨΒɺɺ
 
 
 ஍ਤ/ݕࡧͷج൫Λࢧ͑ΔαʔόʔαΠυΤϯδχΞ
 
 ઈࢍืूதͰ͢ʂʂʂʂʂʂʂʂʂʂʂʂʂ