Skip to content

Missing datas in SLD file after conversion : Mapbox to SLD #463

@stoffy28

Description

@stoffy28

Look at this sample Mapbox file :

{
  "version": 8,
  "name": "Basic",
  "metadata": {
    "mapbox:autocomposite": false,
    "mapbox:type": "template",
    "maputnik:renderer": "mbgljs",
    "openmaptiles:version": "3.x",
    "openmaptiles:mapbox:owner": "openmaptiles",
    "openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t"
  },
  "sources": {
    "openmaptiles": {
      "type": "vector",
      "url": "https://api.maptiler.com/tiles/v3-openmaptiles/tiles.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL"
    }
  },
  "sprite": "https://openmaptiles.github.io/maptiler-basic-gl-style/sprite",
  "glyphs": "https://api.maptiler.com/fonts/{fontstack}/{range}.pbf?key=get_your_own_OpIi9ZULNHzrESv6T2vL",
  "layers": [
    {
      "id": "landuse-residential",
      "type": "fill",
      "source": "openmaptiles",
      "source-layer": "landuse",
      "filter": [
        "all",
        ["==", "$type", "Polygon"],
        ["in", "class", "residential", "suburb", "neighbourhood"]
      ],
      "layout": {"visibility": "visible"},
      "paint": {"fill-color": "hsl(47, 13%, 86%)", "fill-opacity": 0.7}
    },
    {
      "id": "landcover_grass",
      "type": "fill",
      "source": "openmaptiles",
      "source-layer": "landcover",
      "filter": ["==", "class", "grass"],
      "paint": {"fill-color": "hsl(82, 46%, 72%)", "fill-opacity": 0.45}
    },
    {
      "id": "landcover_wood",
      "type": "fill",
      "source": "openmaptiles",
      "source-layer": "landcover",
      "filter": ["==", "class", "wood"],
      "paint": {
        "fill-color": "hsl(82, 46%, 72%)",
        "fill-opacity": {"base": 1, "stops": [[8, 0.6], [22, 1]]}
      }
    }
  ],
  "id": "basic"
}

I convert it to SLD with geostyler-cli release 5.0.4.

After conversion to SLD, here is the output file :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:se="http://www.opengis.net/se">
	<NamedLayer>
		<Name>Basic</Name>
		<UserStyle>
			<Name>Basic</Name>
			<Title>Basic</Title>
			<FeatureTypeStyle>
				<Rule>
					<Name>landuse-residential</Name>
					<Filter xmlns="http://www.opengis.net/ogc"/>
				</Rule>
				<Rule>
					<Name>landcover_grass</Name>
					<Filter xmlns="http://www.opengis.net/ogc">
						<PropertyIsEqualTo>
							<PropertyName>class</PropertyName>
							<Literal>grass</Literal>
						</PropertyIsEqualTo>
					</Filter>
				</Rule>
				<Rule>
					<Name>landcover_wood</Name>
					<Filter xmlns="http://www.opengis.net/ogc">
						<PropertyIsEqualTo>
							<PropertyName>class</PropertyName>
							<Literal>wood</Literal>
						</PropertyIsEqualTo>
					</Filter>
				</Rule>
			</FeatureTypeStyle>
		</UserStyle>
	</NamedLayer>
</StyledLayerDescriptor>

All datas like 'filter', 'layout', 'paint' are gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions