unvt / charites

It is an application to style vector tiles easily
https://unvt.github.io/charites/
MIT License
49 stars 13 forks source link

Convert does not run properly on windows #77

Open ozo360 opened 2 years ago

ozo360 commented 2 years ago

Describe the bug If you run convert in a Windows environment, you will get unwanted single quotes in the layers section. This will cause the build to fail.

To Reproduce Steps to reproduce the behavior:

  1. curl https://gsi-cyberjapan.github.io/gsivectortile-mapbox-gl-js/std.json | charites convert - style.yml
  2. charites build style.yml style.json
  3. See error

Expected behavior Make the output the same as when you convert in a Linux environment. Remove the single quotes and it works fine.

Screenshots

convert style.yml

version: 8
glyphs: https://maps.gsi.go.jp/xyz/noto-jp/{fontstack}/{range}.pbf
sources:
  gsibv-vectortile-source-1-4-16:
    type: vector
    tiles:
      - https://cyberjapandata.gsi.go.jp/xyz/experimental_bvmap/{z}/{x}/{y}.pbf
    minzoom: 4
    maxzoom: 16
    attribution: >-
      <a href="https://maps.gsi.go.jp/vector/"
      target="_blank">地理院地図Vector(仮称)</a>
layers:
  - '!!inc/file layers\gsibv-vectortile-layer-761.yml'
  - '!!inc/file layers\gsibv-vectortile-layer-762.yml'
  - '!!inc/file layers\gsibv-vectortile-layer-763.yml'
  - '!!inc/file layers\gsibv-vectortile-layer-764.yml'
  - '!!inc/file layers\gsibv-vectortile-layer-765.yml'
  - '!!inc/file layers\gsibv-vectortile-layer-766.yml'
  - '!!inc/file layers\gsibv-vectortile-layer-767.yml'
  - '!!inc/file layers\gsibv-vectortile-layer-768.yml'

Charites Version:

Desktop (please complete the following information):

naogify commented 2 years ago

@ozo360 Thank you for a great ticket! 👍
I'll investigate in a few days.

ubukawa commented 2 years ago

Hello! I have a similar error. Let me share my experience. Thank you!

Describe the bug

When I convert a style.json into yaml files, some layers have ">-" and line change (attached image) in the list. I could not see any differences among layers ' expression in the source file.

To reproduce

start charites in docker, then run

charites convert test.json test/style.yml
{"version":8,"sprite":"../sprites/sprite_S","glyphs":"../fonts/{fontstack}/{range}.pbf","sources":{"esri":{"type":"vector","url":"../../"}},
"layers": [{
    "id": "background",
    "type": "background",
    "paint": {
      "background-color": {
        "stops": [[7, "#FFFCF7"], [10, "#FAF9F6"]]
      }
    }
  }, {
    "id": "Landuse(slash)LND_Natural_M(slash)Farmland(slash)fill",
    "type": "fill",
    "source": "esri",
    "source-layer": "LND_Natural_M",
    "filter": ["==", "_symbol", 2],
    "minzoom": 8,
    "layout": {},
    "paint": {
      "fill-opacity": {
        "stops": [[8, 0], [9, 1]]
      },
      "fill-color": "#F2F2DC"
    }
  }, {
    "id": "Landuse(slash)LND_Natural_M(slash)Farmland(slash)pattern",
    "type": "fill",
    "source": "esri",
    "source-layer": "LND_Natural_M",
    "filter": ["==", "_symbol", 2],
    "minzoom": 12,
    "layout": {},
    "paint": {
      "fill-pattern": "LND_Farmland"
    }
  }, {
    "id": "Hydrography(slash)HYD_Waterways_L(slash)Stream(slash)halo",
    "type": "line",
    "source": "esri",
    "source-layer": "HYD_Waterways_L",
    "filter": ["==", "_symbol", 1],
    "minzoom": 11,
    "layout": {
      "line-cap": "round",
      "line-join": "round"
    },
    "paint": {
      "line-color": "rgba(250,249,246,0.5)",
      "line-blur": 1,
      "line-width": {
        "stops": [[11.53, 3], [18.17, 6]]
      }
    }
  }],
  "_ssl": true
}
version: 8
sprite: ../sprites/sprite_S
glyphs: ../fonts/{fontstack}/{range}.pbf
sources:
  esri:
    type: vector
    url: ../../
layers:
  - !!inc/file layers/background.yml
  - !!inc/file layers/Landuse(slash)LND_Natural_M(slash)Farmland(slash)fill.yml
  - >-
    !!inc/file
    layers/Landuse(slash)LND_Natural_M(slash)Farmland(slash)pattern.yml
  - >-
    !!inc/file
    layers/Hydrography(slash)HYD_Waterways_L(slash)Stream(slash)halo.yml
_ssl: true

Expected behaviour

layer list does not have two lines.

OS

Windows 10. Docker Desktop (for windows) Charites run on unvt/nanban

some screen shot

charites-error3

ubukawa commented 2 years ago

This page may help us to understand what happens during the conversion. Thank you!

https://qiita.com/T-ubu/items/6e31a6bc5a458b91d4cd