protomaps / basemaps

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

no Min Height in buildings layer #323

Closed JfrAziz closed 1 month ago

JfrAziz commented 1 month ago

I want to show 3D building from buildings layer, and for some buildings we need min_height. here the result:

image

for comparison from openfreemap:

image

{
      "id": "buildings-3d",
      "type": "fill-extrusion",
      "source": "protomaps",
      "source-layer": "buildings",
      "minzoom": 14,
      "paint": {
        "fill-extrusion-base": [
          "get",
          "min_height"
        ],
        "fill-extrusion-color": "hsl(35,8%,85%)",
        "fill-extrusion-height": [
          "get",
          "height"
        ],
        "fill-extrusion-opacity": 1
      }
    },

I am not familiar with layers generation, but is this line correct?

https://github.com/protomaps/basemaps/blob/f7bcb4869434030ba23271f43e9dbcf6bfc5d63f/tiles/src/main/java/com/protomaps/basemap/layers/Buildings.java#L20

nvkelso commented 1 month ago

This looks like a bug (should be min_height), can you submit a PR?

bdon commented 1 month ago

minimum default building height when the height is null

Right, we should probably add a toggle for 3D/non-3D buildings in our default style... or default to one or the other?

JfrAziz commented 3 weeks ago

just for update, looks like new version still no min_height. here when I inspect with maputnik

image

bdon commented 3 weeks ago

are you using the hosted api.protomaps.com or your own file?

JfrAziz commented 3 weeks ago

my own file, from build, just check another location, some location has min_height. image

bdon commented 3 weeks ago

here is the latest file with date November 6 that has min_height for London eye

https://pmtiles.io/?url=https%3A%2F%2Fdemo-bucket.protomaps.com%2Fv4.pmtiles#map=17.9/51.502967/-0.119692

can you tell me what is the version for the file you are looking at? visible with pmtiles show

JfrAziz commented 3 weeks ago

sorry, caching issues. I see outdated version after update.

image

thanks for help, here the styles I am using

{
  "id": "buildings-3d",
  "type": "fill-extrusion",
  "source": "protomaps",
  "source-layer": "buildings",
  "minzoom": 14,
  "paint": {
    "fill-extrusion-base": [
      "coalesce",
      ["get", "min_height"],
      0
    ],
    "fill-extrusion-color": "hsl(35,8%,85%)",
    "fill-extrusion-height": [
      "coalesce",
      ["get", "height"],
      10
    ],
    "fill-extrusion-opacity": 1
  },
  "filter": [
    "any",
    ["!", ["has", "kind_detail"]],
    ["!=", ["get", "kind_detail"], "no"]
  ]
}

that kind_detail = no that has min_height 1.5 and height 136 make London Eye boxed.

image