CartoCSS: style a layer based on proximity to another layer

1.9k views Asked by At

I am trying to replicate a google maps style in CartoCSS with Map box studio classic. A default google map has a light brown shading for the industrial area surrounding an airport (as in the screenshot)

Google Maps San Francisco Airport - the target style

Google maps - San Francisco airport

Mapbox San Francisco Airport - the current style

Mapbox San Francisco Airport

The area "underneath" the airport is classed as #Landuse['industrial']. I'm looking for a method to give this area the light brown shading but leaving all other industrial areas unaffected.

I'm thinking down the lines of applying a style to any #Landuse['industrial'] which is in proximity to any #aeroway layer. So the question is: Is this possible and/or is there a better/easier way to achieve the desired style.

1

There are 1 answers

1
tmcw On

It's not possible to style elements based on their proximity in CartoCSS - that kind of geometric filter wouldn't be performant. If the landuse has a unique ID, the best way to solve this problem would be filtering by ID and shading this specific instance.