orbisgis / orbismap

Libraries to manage style parsing and rendering
GNU General Public License v3.0
4 stars 3 forks source link

XML writer and reader #4

Open ebocher opened 4 years ago

ebocher commented 4 years ago
ebocher commented 4 years ago

Bellow an example of json encoding with a SQL like expression

{
  "Feature2DStyle": {
    "Name": "Unnamed Style",
    "Rule": {
      "Name": "Area color expression",
      "AreaSymbolizer": {
        "Name": "Color area expression",
        "Level": 0,
        "PenStroke": {
          "SolidFill": {
            "Color": "#000000",
            "Opacity": 1
          },
          "Width": 0.25,
        },
        "SolidFill": {
          "Color": "expression(CASE WHEN ST_AREA(the_geom)> 50000 then 'red' else 'blue' end)"
        }
      }
    }
  }
}
ebocher commented 4 years ago

And in xml

<Feature2DStyle>
  <Name>Unnamed Style</Name>
  <Rule>
    <Name>Area color expression</Name>
    <AreaSymbolizer>
      <Name>Color according a type</Name>
      <Uom>PX</Uom>
      <Level>0</Level>
      <PenStroke>
        <SolidFill>
          <Color>#000000</Color>
          <Opacity>1.0</Opacity>
        </SolidFill>
        <Width>0.25</Width>
      </PenStroke>
      <SolidFill>
        <Color>expression(CASE WHEN ST_AREA(the_geom)&gt; 50000 then 'red' else 'blue' end)</Color>
      </SolidFill>
    </AreaSymbolizer>
  </Rule>
</Feature2DStyle>