maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.24k stars 639 forks source link

klokantech/tileserver-gl to maptiler/tileserver-gl on Synology DS #600

Closed nexttoyou closed 9 months ago

nexttoyou commented 2 years ago

Unfortunately, I'm unable to migrate from klokantech/tileserver-gl to maptiler/tileserver-gl as Docker on a Synology uses a GUI giving a much different approach than most situations described here. Just copying the config doesn't work as the software won't start with the following error:

The specified path for "styles" does not exist (/usr/src/app/node_modules/tileserver-gl-styles/styles).

If somebody here uses a DS and could help me out it would be deeply appreciated.

omahena commented 1 year ago

I think I managed to make progress on using the provided information for the tileserver-gl and applying it to a docker container on my Synology. I am able to pass the startup tileserver arguments like the config file or a mbtiles file. Are you still trying to get tileserver working?

I am now trying to write a valid minimal config.json file...

nexttoyou commented 10 months ago

Ah, my apologies for the late reply – one should never build a house! Yes, any help would be deeply appreciated as I’d otherwise have to continue to use the old klokantech version.

omahena commented 9 months ago

Completely understand. I must admit so much time has passed that my sleep-deprived brain vaguely remembers I was even tweaking this. But I can do a bit of digging and help out.

omahena commented 9 months ago

I completely understand. Unfortunately, so much time has passed that my sleep-deprived brain barely remembers doing this at all. But I can ssh in and see what I did. How far did you manage to get?

nexttoyou commented 9 months ago

Well, how to put it? I tried to change from klokantech/tileserver-gl to maptiler/tileserver-gl using the exact same configuration and failed. As Synology (more or less like Apple) is disguising everything UNIX/command line in some sort of learning curve unfriendly GUI design I’m stuck as nearly no docker documentation is Synology focussed or even aware of it. While I also have several Raspberry Pi's hanging around I'd, unfortunately, need to do the integration of the map into my website on the Synology as the web sever is running there (a question of IP addresses accessible from the outside).

When trying to start maptiler/tileserver-gl inside of Synology's Container Manager the error message is:

failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/app/docker-entrypoint.sh": stat /app/docker-entrypoint.sh: no such file or directory: unknown

… which says what happened but not what to do – at least not on a Synology.

acalcutt commented 9 months ago

Is there some place you are specifying the docker-entrypoint.sh path yourself? According to the docker file it should be loading /usr/src/app/docker-entrypoint.sh

Other than that, are you able to specify a version, like maptiler/tileserver-gl:v4.9.1. My thinking in maybe it is pulling in an old version

acalcutt commented 9 months ago

Testing with the synology demo, it seems like it at least loads and goes online.... I'm not able to get to it through the demo url though.

image image

image

omahena commented 9 months ago

Sorry for the slow response. Stuck on childcare duty. Will try to have a look during the day.

nexttoyou commented 9 months ago

Is there some place you are specifying the docker-entrypoint.sh path yourself?

Ah, many many thanks for the hint with docker-entrypoint.sh! Unfortunately, it is not possible to change it using the GUI but I was able to do it via SSH. The entry point is now the right one: /usr/src/app/docker-entrypoint.sh

The software finally starts up but still shows no maps. The remaining error mentioned is:

Error reading style file

I hoped it would be possible using the old configuration unchanged but it seems not. Using a quick search in the documentation I find no style file mentioned. Could anybody tell me how it is exactly called and what would be inside of it?

Other than that, are you able to specify a version, like maptiler/tileserver-gl:v4.9.1. My thinking in maybe it is pulling in an old version

It was one version behind and is updated now.

acalcutt commented 9 months ago

How do you pass a directory where you maps and styles get stored with the synology?

Typically in the docker command there is a part that maps a local folder to the internal /data folder For example, in docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl the $(pwd):/data says to map the local folder you are in $(pwd) to /data

inside the docker, tileserver-gl is expecting styles and data files to be in the /data directory. /data is whatever you map it to locally.

acalcutt commented 9 months ago

The path to the styles gets set in the config file, see 'options/paths' in https://maptiler-tileserver.readthedocs.io/en/latest/config.html . The styles paths in 'styles/style' in the config are relative to what is set in paths.

By default the 'root' path in your config would be /data , which is mapped to your local folder. Inside /data you would usually have styles, fonts, configs which you need to specify paths relative to 'root'

nexttoyou commented 9 months ago

How do you pass a directory where you maps and styles get stored with the synology?

In the settings (just like shown in your screenshots).

inside the docker, tileserver-gl is expecting styles and data files to be in the /data directory. /data is whatever you map it to locally.

Yep, that is exactly like it was. Unfortunately, it does not seem to be enough. In my /data directory there is the config.json as well as the corresponding .mbtiles file. The config.json looks like this:

{
  "options": {
    "paths": {
      "root": "/usr/src/app/node_modules/tileserver-gl-styles",
      "fonts": "fonts",
      "styles": "styles",
      "mbtiles": "/data"
    },
    "serveStaticMaps": true,
    "frontPage": false,
    "formatQuality": {
      "jpeg": 90,
      "webp": 90
    },
    "maxSize": 2560,
    "minRendererPoolSizes": [32, 16, 8],
    "maxRendererPoolSizes": [32, 16, 8],
    "pbfAlias": "pbf",
    "serveAllFonts": true,
    "serveAllStyles": true,
    "serveStaticMaps": true,
    "tileMargin": 0
  },
  "styles": {
    "osm-bright": {
      "style": "osm-bright/style.json",
      "tilejson": {
        "bounds": [3.981, 50.645, 4.761, 51.053]
      }
    }
  },
  "data": {
    "v3": {
      "mbtiles": "brussels.mbtiles"
    }
  }
}

I suppose something has changed and I have to read the documentation with a less nervous approach …

acalcutt commented 9 months ago

Hmm, that looks right to me. it would be expecting the style in /data/styles/osm-bright/style.json, so whatever folder you map /data to should have a styles/osm-bright/ folder inside

acalcutt commented 9 months ago

Maybe try changing "root" to /data . right now it is the default styles folder, so things would be relative to that path (and you can't change that since it is inside the docker node_modules folder)

nexttoyou commented 9 months ago

The file /data/styles/osm-bright/style.json is definitely not present and that would be the error. I do not know why it worked like this before and have to find out first. Also I'd have to find such a file. Please give me some time to resolve this.

acalcutt commented 9 months ago

Oh, I think I see what is happening. Maybe the default styles in /usr/src/app/node_modules/tileserver-gl-styles have changed.

When I look in my styles folder I don't have osm-bright, only basic-preview image

So maybe you can try keeping

      "root": "/usr/src/app/node_modules/tileserver-gl-styles",
      "fonts": "fonts",
      "styles": "styles",
      "mbtiles": "/data"

but change the style from osm-bright/style.json to basic-preview/style.json

This would allow you to use the default built in style. If you wanted your own styles you would do like I said above and change root to "root": "/data" and add you own styles and fonts folders in /data

acalcutt commented 9 months ago

If that works, getting the old styles can be done, but they are no longer included in the default styles

I wrote this post on getting back the original styles that klokantech/tileserver-gl had https://github.com/maptiler/tileserver-gl/discussions/1071#discussioncomment-7643152

acalcutt commented 9 months ago

btw, I just want to mention I was wrong when I said it expected your style at /data/styles/osm-bright/style.json

because your root directory is /usr/src/app/node_modules/tileserver-gl-styles it is expecting the style at /usr/src/app/node_modules/tileserver-gl-styles/styles/osm-bright/style.json (root path + style path + styles/style path) this does not exist in the current release

When I looked initially I though your root folder was set to "root": "/data", which would make the style be at the path I mentioned /data/styles/osm-bright/style.json (root path + style path + styles/style path)

usually if you want to add your own styles, you do the second way and put the fonts and styles folder in your local folder that maps to /data

omahena commented 9 months ago

I had a look at what I am running and how I configured it 10 months ago... I can't say which version of the repos it is... I used the "latest" at the time unfortunately.

maptiler/tileserver-gl latest 85fb91fa86cd 10 months ago 771MB

Docker registry appears to be down at the moment. :(

I noticed that you are running a Container Manager. My Docker on the Synology is called Docker. We should consider a possible version / CPU architecture issue. Prepared Docker images might differ as well.

image

And here some details: image

I am using this image:

root@DS918+:/volume1/@docker# docker image inspect 85fb91fa86cd
[
    {
        "Id": "sha256:85fb91fa86cd1bda12b43fa3d25a8519d837bca4fd5a10e3a7f5b59895b4eaa3",
        "RepoTags": [
            "maptiler/tileserver-gl:latest"
        ],
        "RepoDigests": [
            "maptiler/tileserver-gl@sha256:76a9d4337405b7d029cf48b1cce5b22b172c74164ef0c689c4dead379455f3b8"
        ],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2023-03-19T16:08:26.916708554Z",
        "Container": "",
        "ContainerConfig": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": null,
            "Cmd": null,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null,
            "DDSM": false
        },
        "DockerVersion": "",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "node:node",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "8080/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NODE_ENV=production",
                "CHOKIDAR_USEPOLLING=1",
                "CHOKIDAR_INTERVAL=500"
            ],
            "Cmd": null,
            "Healthcheck": {
                "Test": [
                    "CMD-SHELL",
                    "node /usr/src/app/src/healthcheck.js"
                ]
            },
            "Image": "",
            "Volumes": {
                "/data": {}
            },
            "WorkingDir": "/data",
            "Entrypoint": [
                "/usr/src/app/docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "org.opencontainers.image.ref.name": "ubuntu",
                "org.opencontainers.image.version": "20.04"
            },
            "Shell": [
                "/bin/bash",
                "-o",
                "pipefail",
                "-c"
            ],
            "DDSM": false
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 771373514,
        "VirtualSize": 771373514,
        "GraphDriver": {
            "Data": null,
            "Name": "btrfs"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:62789ffcd78ce0eae545b2743541d5c063270fe9f45477acacf2031b93cea70f",
                "sha256:992aa99fabf487b81dc52eeda9fde302d39e0ab4d1cc8c1cc24e828d52d570c0",
                "sha256:47e41e42cbc07ae47cd36227bad6bda1de4c2af5f54fc03334e392019c286438",
                "sha256:59cab3d13ab7a73f272f315977d3c76a2ad1791f4834fe865c143ef687f13212",
                "sha256:8e37ea01bb9a97571d047494eac3c3159dd1804b6095c0b8c7b2053f1560d9a1",
                "sha256:dbf2cc83cfb326c7170e7c3a4027ddf98c9807308b425e850adf3e1b8de88c8e",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]

root@DS918+:/volume1/@docker# docker container ls
CONTAINER ID   IMAGE                             COMMAND                  CREATED         STATUS                  PORTS                                                                                                                                                                            NAMES
81bf3d6f2b4d   maptiler/tileserver-gl:latest     "/usr/src/app/docker…"   6 months ago    Up 24 hours (healthy)   0.0.0.0:82->8080/tcp                                                                                                                                                             maptiler-tileserver-gl

root@DS918+:/volume1/@docker# docker container inspect 81bf3d6f2b4d
[
    {
        "Id": "81bf3d6f2b4d46a15ea54bb6afeb2c6c9b2b99b68d13f9a86fce254332b19ec7",
        "Created": "2023-07-31T20:37:31.985280527Z",
        "Path": "/usr/src/app/docker-entrypoint.sh",
        "Args": [
            "--mbtiles",
            "/data/planet.mbtiles",
            "--verbose"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 10543,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2024-01-29T11:30:56.905376296Z",
            "FinishedAt": "2024-01-29T11:21:29.112597979Z",
            "Health": {
                "Status": "healthy",
                "FailingStreak": 0,
                "Log": [
                    {
                        "Start": "2024-01-30T12:49:05.184577398+01:00",
                        "End": "2024-01-30T12:49:05.387661616+01:00",
                        "ExitCode": 0,
                        "Output": "STATUS: 200\n"
                    },
                    {
                        "Start": "2024-01-30T12:49:35.429765242+01:00",
                        "End": "2024-01-30T12:49:35.610798797+01:00",
                        "ExitCode": 0,
                        "Output": "STATUS: 200\n"
                    },
                    {
                        "Start": "2024-01-30T12:50:05.650281509+01:00",
                        "End": "2024-01-30T12:50:05.82622391+01:00",
                        "ExitCode": 0,
                        "Output": "STATUS: 200\n"
                    },
                    {
                        "Start": "2024-01-30T12:50:35.852626024+01:00",
                        "End": "2024-01-30T12:50:36.042503386+01:00",
                        "ExitCode": 0,
                        "Output": "STATUS: 200\n"
                    },
                    {
                        "Start": "2024-01-30T12:51:06.07918996+01:00",
                        "End": "2024-01-30T12:51:06.259436456+01:00",
                        "ExitCode": 0,
                        "Output": "STATUS: 200\n"
                    }
                ]
            },
            "StartedTs": 1706527856,
            "FinishedTs": 1706527289
        },
        "Image": "sha256:85fb91fa86cd1bda12b43fa3d25a8519d837bca4fd5a10e3a7f5b59895b4eaa3",
        "ResolvConfPath": "/volume1/@docker/containers/81bf3d6f2b4d46a15ea54bb6afeb2c6c9b2b99b68d13f9a86fce254332b19ec7/resolv.conf",
        "HostnamePath": "/volume1/@docker/containers/81bf3d6f2b4d46a15ea54bb6afeb2c6c9b2b99b68d13f9a86fce254332b19ec7/hostname",
        "HostsPath": "/volume1/@docker/containers/81bf3d6f2b4d46a15ea54bb6afeb2c6c9b2b99b68d13f9a86fce254332b19ec7/hosts",
        "LogPath": "/volume1/@docker/containers/81bf3d6f2b4d46a15ea54bb6afeb2c6c9b2b99b68d13f9a86fce254332b19ec7/log.db",
        "Name": "/maptiler-tileserver-gl",
        "RestartCount": 0,
        "Driver": "btrfs",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "docker-default",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/volume1/docker/tileserver-data:/data:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "db",
                "Config": {}
            },
            "NetworkMode": "bridge",
            "PortBindings": {
                "8080/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "82"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "CgroupnsMode": "host",
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NODE_ENV=production",
                "CHOKIDAR_USEPOLLING=1",
                "CHOKIDAR_INTERVAL=500",
                "DOOKIE=1"
            ],
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": null,
            "Name": "btrfs"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/volume1/docker/tileserver-data",
                "Destination": "/data",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "maptiler-tileserver-gl",
            "Domainname": "",
            "User": "node:node",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "8080/tcp": {}
            },
            "Tty": true,
            "OpenStdin": true,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NODE_ENV=production",
                "CHOKIDAR_USEPOLLING=1",
                "CHOKIDAR_INTERVAL=500",
                "DOOKIE=1"
            ],
            "Cmd": [
                "--mbtiles",
                "/data/planet.mbtiles",
                "--verbose"
            ],
            "Healthcheck": {
                "Test": [
                    "CMD-SHELL",
                    "node /usr/src/app/src/healthcheck.js"
                ]
            },
            "Image": "maptiler/tileserver-gl:latest",
            "Volumes": {
                "/data": {}
            },
            "WorkingDir": "/data",
            "Entrypoint": [
                "/usr/src/app/docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "org.opencontainers.image.ref.name": "ubuntu",
                "org.opencontainers.image.version": "20.04"
            },
            "DDSM": false
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "b9d7126e81db91c136c38f62833d74c8e74c005112eef582bb36a163d900e3ab",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "8080/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "82"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/b9d7126e81db",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "b1b72b9626cce5a50cb6d9bb4589ee43d259ba3cd314ab5beaf019eb634f938a",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "89b77724f14bc5df1d33d0121ad6c207dfed10cba2216172e5a23747534c819c",
                    "EndpointID": "b1b72b9626cce5a50cb6d9bb4589ee43d259ba3cd314ab5beaf019eb634f938a",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02",
                    "DriverOpts": null
                }
            }
        }
    }
]
omahena commented 9 months ago

Ah, I was trying to write my response for three days now and didn't notice the lively conversation that already developed. Thanks for jumping in @acalcutt.

nexttoyou commented 9 months ago

Ah, I was trying to write my response for three days now and didn't notice the lively conversation that already developed. Thanks for jumping in @acalcutt.

Hey, no worries! You were the first one who wanted to help. That already counted a lot to me! I'm still experimenting and will give feedback later.

omahena commented 9 months ago

How do you pass a directory where you maps and styles get stored with the synology?

This is how you pass a directory to a docker container:

image

The important thing to note is that Synology expects you to pass a Synology "shared folder" on one of the NAS disk volumes and not an absolute path. The absolute path to my "/data" folder would be "/volume1/data". So Synology is sprinkling some magic to make things "user friendly" and re-mapping /data to /volume1/data (in my case).

My map data and configuration are configured like this: image

I chose a super-simple config for the time being. It looks like my config is using the docker image provided styles: /usr/src/app/node_modules/tileserver-gl-styles. This one is in one of these subvolumes (not sure how to figure out which one): image

To use the copy I have with my map tiles I could specify the /data/tileserver-gl-styles... I think. :)

omahena commented 9 months ago

I'm still experimenting and will give feedback later.

Awesome. Since you have some partial success with the docker container, the image version and docker version should be fine. There must be some configuration/path issue. Since Synology adds a layer of "user friendliness" (aka obfuscation)... It is easy to miss something.

I'll let you poke your box... Let us know what you discover. I hope my config dumps will help you discover the issue.

Just in case it is a test issue... :) My test tile works ok and this is how I access tile data: http://your_synology_ip:83/styles/basic-preview/18/141441/93530.png

image

nexttoyou commented 9 months ago

So maybe you can try keeping

      "root": "/usr/src/app/node_modules/tileserver-gl-styles",
      "fonts": "fonts",
      "styles": "styles",
      "mbtiles": "/data"

but change the style from osm-bright/style.json to basic-preview/style.json

This would allow you to use the default built in style. If you wanted your own styles you would do like I said above and change root to "root": "/data" and add you own styles and fonts folders in /data

Just to confirm: this already works perfectly! The next step would be the return of the old osm-bright style where I’m still struggling a bit.

omahena commented 9 months ago

Just to confirm: this already works perfectly! The next step would be the return of the old osm-bright style where I’m still struggling a bit.

Thanks for clarifying. I unfortunately do not know much about old style adaptation. They probably didn't reinvent the wheel and a side-by-side diff will give you what you need. I assume you have the old osm-bright style?

nexttoyou commented 9 months ago

All seems to be freely available but must be integrated first. This is by far no big priority but should be possible.

Thanks for clarifying. I unfortunately do not know much about old style adaptation. They probably didn't reinvent the wheel and a side-by-side diff will give you what you need. I assume you have the old osm-bright style?

All seems to be freely available but must be integrated first. This is by far no big priority but should be possible.

acalcutt commented 9 months ago

Just to confirm: this already works perfectly! The next step would be the return of the old osm-bright style where I’m still struggling a bit.

Thanks for clarifying. I unfortunately do not know much about old style adaptation. They probably didn't reinvent the wheel and a side-by-side diff will give you what you need. I assume you have the old osm-bright style?

Basically, the next step to get the old styles and fonts back, is you would put a 'styles' and 'fonts' folder into the path with your config file (looks like that is /volume1/docker/tileserver-data/ )

Inside 'styles' and 'fonts', put in the styles and fonts mentioned here https://github.com/maptiler/tileserver-gl/discussions/1071#discussioncomment-7643152

In you config, change the root path to /data "root": "/data",

Once you have /volume1/docker/tileserver-data/styles/osm-bright/style.json, you can put back osm-bright/style.json in your config

acalcutt commented 9 months ago

If you do actually have those styles in /volume1/docker/tileserver-data/tilserver-gl-styles/ you could set both the root and styles paths like

      "root": "/data",
      "styles": "tilserver-gl-styles",

then it would be expecting /volume1/docker/tileserver-data/tilserver-gl-styles/osm-brigt/style.json extenally and /data/tilserver-gl-styles/osm-brigt/style.json inside the docker

nexttoyou commented 9 months ago

My /data folder is currently under /volume1/docker/tileserver-gl/data. I have downloaded all the necessary files like you explained but, unfortunately, am still struggling to make it work.

nexttoyou commented 9 months ago

An ls -l /volume1/docker/tileserver-gl/data results in:

-rwxrwxrwx+ 1 nexttoyou users       724 Jan 31 15:29 config.json
drwxrwxrwx+ 1 nexttoyou users       224 Jan 31 15:24 fonts
drwxrwxrwx+ 1 nexttoyou users       154 Jan 31 15:00 styles

In /volume1/docker/tileserver-gl/data/fonts you'll find:

drwxrwxrwx+ 1 nexttoyou users 7504 Jan 31 15:21 'Noto Sans Bold'
drwxrwxrwx+ 1 nexttoyou users 7504 Jan 31 15:22 'Noto Sans Italic'
drwxrwxrwx+ 1 nexttoyou users 7504 Jan 31 15:24 'Noto Sans Regular'
drwxrwxrwx+ 1 nexttoyou users 7504 Jan 31 14:44 'Open Sans Bold'
drwxrwxrwx+ 1 nexttoyou users 7504 Jan 31 14:44 'Open Sans Italic'
drwxrwxrwx+ 1 nexttoyou users 7504 Jan 31 14:43 'Open Sans Regular'
drwxrwxrwx+ 1 nexttoyou users 7504 Jan 31 14:44 'Open Sans Semibold'

In /volume1/docker/tileserver-gl/data/styles you'll find:

drwxrwxrwx+ 1 nexttoyou users 216 Jan 31 15:00 osm-bright

In /volume1/docker/tileserver-gl/data/styles/osm-bright/ you'll find:

-rwxrwxrwx+ 1 nexttoyou users   905 Jan 10  2020 index.html
drwxrwxrwx+ 1 nexttoyou users   134 Jan 31 15:00 preview
-rwxrwxrwx+ 1 nexttoyou users 10696 Jan 10  2020 sprite@2x.json
-rwxrwxrwx+ 1 nexttoyou users 44711 Jan 10  2020 sprite@2x.png
-rwxrwxrwx+ 1 nexttoyou users 10637 Jan 10  2020 sprite.json
-rwxrwxrwx+ 1 nexttoyou users 17419 Jan 10  2020 sprite.png
-rwxrwxrwx+ 1 nexttoyou users 99178 Jan 10  2020 style-cdn.json
-rwxrwxrwx+ 1 nexttoyou users 99015 Jan 10  2020 style-local.json
-rwxrwxrwx+ 1 nexttoyou users 99116 Jan 10  2020 style-mb.json

And last but not least my config.json now looks like this:

{
  "options": {
    "paths": {
      "root": "/data",
      "fonts": "fonts",
      "styles": "styles",
      "mbtiles": "/data"
    },
    "serveStaticMaps": true,
    "frontPage": false,
    "formatQuality": {
      "jpeg": 90,
      "webp": 90
    },
    "maxSize": 2560,
    "minRendererPoolSizes": [32, 16, 8],
    "maxRendererPoolSizes": [32, 16, 8],
    "pbfAlias": "pbf",
    "serveAllFonts": true,
    "serveAllStyles": true,
    "serveStaticMaps": true,
    "tileMargin": 0
  },
  "styles": {
    "osm-bright": {
      "style": "osm-bright/style.json",
      "tilejson": {
        "bounds": [3.981, 50.645, 4.761, 51.053]
      }
    }
  },
  "data": {
    "v3": {
      "mbtiles": "brussels.mbtiles"
    }
  }
}

Still tinkering …

acalcutt commented 9 months ago

Maybe instead of "styles": "styles", try "styles": "/data/styles",

acalcutt commented 9 months ago

Your file structure all looks fine to me at least

acalcutt commented 9 months ago

Are you still getting the same style not found error?

acalcutt commented 9 months ago

Oh, one thing to note is there is no style.json in that osm-bright folder. I usually rename style-local.json to style.json

nexttoyou commented 9 months ago

Bingo!

omahena commented 9 months ago

Ha. Cool! :)

BTW this is the old osm_bright on my system:

root@DS918+:/volume1/@docker/btrfs/subvolumes# ll ./e754b8b3bf602e533bdc49fb2f2c026abbe88789142d21591df2eedabc537b65/usr/src/app/node_modules/tileserver-gl-styles/styles/osm-bright/
total 184
drwxr-xr-x 1 root root    116 Aug 26  2019  ./
drwxr-xr-x 1 root root     52 Aug 26  2019  ../
-rw-r--r-- 1 root root  10470 Sep  1  2017 'sprite@2x.json'
-rw-r--r-- 1 root root  42749 Sep  1  2017 'sprite@2x.png'
-rw-r--r-- 1 root root  10409 Sep  1  2017  sprite.json
-rw-r--r-- 1 root root  16255 Sep  1  2017  sprite.png
-rw-r--r-- 1 root root 102155 Sep  1  2017  style.json

Let me know if you'd like me to send it to you for reference.

acalcutt commented 9 months ago

Just an FYI, there have been schema updates to the osm-bright style since 2017, so if you use it with a newer openmaptiles mbtiles file you may want to update the style from the 2017 version. If you are still using it with an old openmaptiles mbtiles file you probably do want the older version of the style.

The release at https://github.com/openmaptiles/osm-bright-gl-style/releases was updated in 2020 to work with the newer OMT 3.11 schema