0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

UNVTスタイルアップデート時のproduce-gsc-6とcoesite4の変更

Posted at

はじめに

国連のUN Street Mapのスタイルが新しくなり、それに伴いUNVTのスタイルも同様のものに合わせて変更しました。
本記事では、UNVTスタイルアップデート時の、produce-gsc-6レポジトリcoesite4レポジトリのどのファイルを変更したのかを記載しました。

produce-gsc-6レポジトリの修正

まずは、produce-gsc-6のレポジトリから作業をしていきます。

produce-gsc-6のクローン

produce-gsc-6をローカルにクローンします。20251031produce-gsc-6styleChangeという名前のフォルダにクローンしました。

git clone https://github.com/unvt/produce-gsc-6.git 20251031produce-gsc-6styleChange

modify.jsの修正

次に、/produce-gsc-small/modify.jsの修正を行います。
これまでは、f.properties.gridcode == 20の場合にはminzoomが2、それ以外ではminzoomが3としてきましたが、すべての場合でminzoomが0となるよう設定を変更します。これは、minzoomが1などの場合においても、ベクトルタイルを作成しておき、表示するためです。

modify.js
un_glc30_global_lc_ss_a: (f) => {
  f.tippecanoe = {
    layer: "landcover",
    minzoom: 3,
    maxzoom: 5,
  };
  if (f.properties.gridcode == 20) {
    f.tippecanoe.minzoom = 2;
  }
  if (f.properties.gridcode == 20 || f.properties.gridcode == 30) {
    //    f.tippecanoe.minzoom = 2 //test
    delete f.properties["objectid"];
    delete f.properties["objectid_1"];
    return f;
  } else {
    return null;
  }
};

これを以下のとおり、ZL0から作成するよう修正します。

modify.js
un_glc30_global_lc_ss_a: (f) => {
  f.tippecanoe = {
    layer: "landcover",
    // minzoom: 3,  //20250828
    minzoom: 0,
    maxzoom: 5,
  };
  // if (f.properties.gridcode == 20) {
  // f.tippecanoe.minzoom = 2
  // }
  if (f.properties.gridcode == 20 || f.properties.gridcode == 30) {
    delete f.properties["objectid"];
    delete f.properties["objectid_1"];
    return f;
  } else {
    return null;
  }
};

実際にproduce-gsc-6レポジトリを更新する

上述した変更を実際のレポジトリに反映させました。

coesite4レポジトリの修正

次に、coesite4レポジトリで作業していきます。

coesite4のクローン

まずは、coesite4をローカルにクローンします。20251031coesite4styleChangeという名前のフォルダにクローンしました。

git clone https://github.com/unvt/coesite4.git 20251031coesite4styleChange

新たに作成したスタイルファイルを置き換え

以下が新たに作成したスタイルファイルであり、それらを以前のものと置き換えます。

UN Street Map 2.0に対応したUNVT GeoPortal用のスタイルファイル

/esri/UniteStreetMapVector/style.json

UN Street Map 2.0に対応したUNVT MapLibre用のスタイルファイル

上から、Standard, Building-3d, Contour Map用のスタイルファイルです。

  • /public/styles/style-std.json
  • /public/styles/style-prod.json
  • /public/styles/style-el.json

spriteファイルの追加

sprite-2.0フォルダを以下のように追加しました。
/public/sprite-2.0

実際にcoesite4レポジトリを更新する

上述した変更を実際のレポジトリに反映させました。

反映したコードで正常に動くか再確認

次に反映したコードで正常に動くか再確認するために、VDI上で実行してみます。
modify.jsを修正しているので、反映させるためには、produce-gsc-6レポジトリの
/produce-gsc-small/index_un-s.js
を再度実行して、ズームレベル0-5のmbtilesファイルを作成し、それをホスティングサーバにコピーしておく必要があります。
実行したところ、すべてのファイルについて正常に地図が表示されました。

まとめ

本記事では、UNVTスタイルアップデート時の、produce-gsc-6レポジトリとcoesite4レポジトリの変更点についてまとめました。

Reference

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?