protomaps / basemaps

Basemap PMTiles generation and cartographic styles for OpenStreetMap data and more
https://maps.protomaps.com/
Other
347 stars 44 forks source link

More simplification on country borders #200

Closed wipfli closed 6 months ago

wipfli commented 9 months ago

Country borders could use a bit more simplification. I think they have too many points and look a bit noise sometimes.

Example: Switzerland

image

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
    <script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js"></script>
    <link href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" rel="stylesheet" />
    <style>
        body {
            margin: 0;
            padding: 0;
        }

        #map {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>

<body>
    <div id="map"></div>
    <script>
        const map = new maplibregl.Map({
            container: 'map',
            center: [8.265, 45.681], // starting position [lng, lat]
            zoom: 6.23, // starting zoom
            hash: true,
            style: {
    "version": 8,
    "sources": {
        "protomaps": {
            "type": "vector",
            "attribution": "<a href=\"https://github.com/protomaps/basemaps\">Protomaps</a> © <a href=\"https://openstreetmap.org\">OpenStreetMap</a>",
            "url": "https://tiles.swiss-map.cc/protomaps-z10.json"
        }
    },
    "layers": [
        {
            "id": "boundaries_country",
            "type": "line",
            "source": "protomaps",
            "source-layer": "boundaries",
            "filter": [
                "<=",
                "pmap:min_admin_level",
                2
            ]
        }
    ]
}
        });
    </script>

</body>

</html>
raphi commented 8 months ago

@wipfli It depends on everyone's needs. In my case, I need the most precise boundaries possible.

I think it should be compatible with the maximum of use cases, and if you need a simplified version of it, you could generate a pmtiles customised to your specific needs.

bdon commented 6 months ago

Resolved by #223

wipfli commented 5 months ago

Thank you.