Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choropleth or graduated map #19

Open
ebocher opened this issue Nov 30, 2022 · 3 comments
Open

Choropleth or graduated map #19

ebocher opened this issue Nov 30, 2022 · 3 comments

Comments

@ebocher
Copy link
Collaborator

ebocher commented Nov 30, 2022

Existing conformance classes required for this use case:

  • basic vector feature styling

Example stylesheet:

Below a CSS encoding to describe a graduated map to display fraction of vegation on a grid (HIGH_VEGETATION_FRACTION property).

*{
  stroke: #000000;
  stroke-width: 1px;
  [HIGH_VEGETATION_FRACTION>=0 OR HIGH_VEGETATION_FRACTION<=0.200]
  {
     fill: yellow;
  };
  [HIGH_VEGETATION_FRACTION>0.200 OR HIGH_VEGETATION_FRACTION<0.500]
  {
     fill: orange;
  };
  [HIGH_VEGETATION_FRACTION>0.500]
  {
     fill: red;
  };
}

Describe any capability not already addressed by existing conformance classes:

Example image illustrating the portrayal use case:

choropleth_filter_grid_impervious_fraction

about #17

@maxcollombin
Copy link
Collaborator

maxcollombin commented Dec 8, 2022

Mapbox JSON encoding

{
  "version": 8,
  "name": "Default Styler",
  "layers": [
    {
      "filter": [
        ">",
        "HIGH_VEGETATION_FRACTION",
        0.5
      ],
      "id": "",
      "type": "fill"
    },
    {
      "filter": [
        "<=",
        "HIGH_VEGETATION_FRACTION",
        0.5
      ],
      "id": "",
      "type": "fill"
    }
  ]
}

@maxcollombin
Copy link
Collaborator

SLD encoding

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor
	xmlns="http://www.opengis.net/sld"
	xmlns:sld="http://www.opengis.net/sld"
	xmlns:gml="http://www.opengis.net/gml"
	xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0">
	<sld:NamedLayer>
		<sld:Name>Default Styler</sld:Name>
		<sld:UserStyle>
			<sld:Name>Default Styler</sld:Name>
			<sld:FeatureTypeStyle>
				<sld:Name>name</sld:Name>
				<sld:Rule>
					<ogc:Filter>
						<ogc:PropertyIsGreaterThan>
							<ogc:PropertyName>HIGH_VEGETATION_FRACTION</ogc:PropertyName>
							<ogc:Literal>0.5</ogc:Literal>
						</ogc:PropertyIsGreaterThan>
					</ogc:Filter>
					<sld:PolygonSymbolizer>
						<sld:Fill>
							<sld:CssParameter name="fill">#ff0000</sld:CssParameter>
						</sld:Fill>
						<sld:Stroke/>
					</sld:PolygonSymbolizer>
				</sld:Rule>
				<sld:Rule>
					<ogc:Filter>
						<ogc:PropertyIsLessThanOrEqualTo>
							<ogc:PropertyName>HIGH_VEGETATION_FRACTION</ogc:PropertyName>
							<ogc:Literal>0.5</ogc:Literal>
						</ogc:PropertyIsLessThanOrEqualTo>
					</ogc:Filter>
					<sld:PolygonSymbolizer>
						<sld:Fill>
							<sld:CssParameter name="fill">#ffff00</sld:CssParameter>
						</sld:Fill>
						<sld:Stroke/>
					</sld:PolygonSymbolizer>
				</sld:Rule>
				<sld:VendorOption name="ruleEvaluation">first</sld:VendorOption>
			</sld:FeatureTypeStyle>
		</sld:UserStyle>
	</sld:NamedLayer>
</sld:StyledLayerDescriptor>

@jerstlouis
Copy link
Member

CCSSS Encoding version:

{
  stroke: { black; width: 1px }
  [highVegetationFract between 0 and 0.200]     { fill: { yellow }; };
  [highVegetationFract between 0.200 and 0.500] { fill: { orange }; };
  [highVegetationFract > 0.500]                 { fill: { red } };
}

jerstlouis added a commit to jerstlouis/styles-and-symbology that referenced this issue Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants