Giter VIP home page Giter VIP logo

geostyler-mapbox-parser's Introduction

GeoStyler Logo

Test, Coverage & Docs (main) Create & publish versioned documentation Coverage Status License

Code: github Package: npm

Documentation: main / latest / 11.1.1

Examples: Demo application

Developer Guide: Developer Guide

Discord Banner 2

🚀 GeoStyler Code Sprint 2024

We are happy to announce the third GeoStyler Code Sprint from 17.-21.06.2024 in Paris. Be part of it! More infos on https://geostyler.org/.

📆 Monthly meetings

On the first tuesday of every month, there is a video meeting on the GeoStyler Discord at 2pm CET. The meeting is for all contributors, users or other people interested in GeoStyler.

What is this all about?

The GeoStyler is a generic styler for geodata*.

GeoStyler provides a set of UI Components for map styling. Just like a modular building block system all components can be stacked together to create a nice UI for your web applications. To simplify the setup, we also provide some high-level components (based on our building blocks) that already do the work for you. These include among many others Symbolizer Editors, RuleTables and a fully-fledged StyleEditor including filters and scaleDenominators.

Furthermore, GeoStyler allows for the translation between multiple styling formats, i.e. SLD, OpenLayers, QGIS, Mapbox. Since we are following the concept of micro packages, these translators (we call them parsers) can be used as standalone libraries, without the need to include the UI components as a dependency. Just take a look at StyleParser Implementations.

* geodata as a single dataset (layer) not a complete map appearance.

If you are missing any UI components, formats or even have a custom style format, feel free to open a PR. We are happy for any kind of contributions.

To see the GeoStyler in action have a look at the demo application. It demonstrates the GeoStyler UI components as a standalone application.

Every parser works as a standalone library, too. So you can easily translate between style formats.

For example a small SLD to OpenLayers-Style parser (untested code 😄):

import SLDParser from "geostyler-sld-parser";
import OpenLayersParser from "geostyle-openlayers-parser";
const sldParser = new SLDParser();
const olParser = new OpenLayersParser();

const sldToOL = async (sld) => {
  const { output: geostylerStyle } = await sldParser.readStyle(someSld);
  const { output: olStyle } = await olParser.writeStyle(geostylerStyle);
  return olStyle;
};

export default sldToOl;

Installation

Run

npm i geostyler

from within your project directory to add GeoStyler as a dependency. Please be aware of the peerDependencies that come along with GeoStyler.

Components can be used as follows:

import {wanted-geostyler-compoment} from 'geostyler';

//... your component code
render() {
  return (
    <wanted-geostyler-component
      foo=""
      bar={}
    />
  );
}

GeoStyler - Behind the Scenes

Internally we are using our own style definition called GeoStyler Style (see TypeScript Declaration Files), which takes the best from SLD and Mapbox. We are not trying to establish just another standard, but we need an exchange format that is flexible and highly compatible with current styling standards. Understanding GeoStyler Style is only necessary for developers of the project, not for users! Our style parsers all read and write from and to GeoStyler Style to keep the complexity low. As a positive side effect this lets you translate from any supported style to any other supported style.

Imagine your previous project was based on QGIS and now you want to setup your own web application. With GeoStyler you can still use your QGIS styles and either save all future formats in qml as well, or you simply translate all your old styles to another format e.g. OpenLayers styles or SLD. It's simple as that!

To populate the UI with information from imported data we provide a set of data parsers (defined in GeoStyler Data). Currently, we support GeoJSON, Shapefile and WFS.

With these two formats there come two interfaces. You can implement these interfaces to create a parser. Compare the list of existing parsers below.

Architecture

Related projects

TypeScript Declaration Files

DataParser Implementations

StyleParser Implementations

More

Developer Guide

For our guidelines for contributions, please take a look at CONTRIBUTING.md. Head there if you need general advice for first contributing steps (code or documentation).

More detailed information to ensure a great development experience when working on geostyler is summarized in DEVELOPING.md. You'll find hints with regard to developing UI components or guidance when you want to enhance (or create) parsers for style formats or data formats there.

Additionally, please read through our code of conduct.

We look forward to seeing you contribute soon!

License

GeoStyler is released under the BSD 2-Clause license. Please see the file LICENSE in the root of this repository.

Thanks to all contributors ❤

Avatars of contributors of GeoStyler

Funding & financial sponsorship

Maintenance and further development of this code can be funded through the GeoStyler Open Collective. All contributions and expenses can transparently be reviewed by anyone; you see what we use the donated money for. Thank you for any financial support you give the GeoStyler project 💞

geostyler-mapbox-parser's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geostyler-mapbox-parser's Issues

Support for MarkSymbolizer

Hi! just found your project and really like the idea. We have been working on something internally but solely focused on converting from QGIS to Mapbox.

I am currently running into an issue trying to convert a QGIS graduated style to Mapbox. The error states that the MarkSymbolizer is not supported, but I was unable to figure out what type I should be specified for the conversion to work.

Let me know if you need any other information, and how we could help.

Command:

geostyler -s qml -t mapbox -o test.mapbox style_test.qml 
✖ Error during translation of file "style_test.qml": Error: Cannot get Style. Unsupported MarkSymbolizer

The style_test.qml:

<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis styleCategories="Symbology" version="3.22.4-Białowieża">
  <renderer-v2 type="graduatedSymbol" attr="ele" referencescale="-1" enableorderby="0" forceraster="0" graduatedMethod="GraduatedColor" symbollevels="0">
    <ranges>
      <range upper="139.869270640800011" symbol="0" label="3 - 140" render="true" lower="3.125683782000000"/>
      <range upper="276.612857499600011" symbol="1" label="140 - 277" render="true" lower="139.869270640800011"/>
      <range upper="413.356444358400040" symbol="2" label="277 - 413" render="true" lower="276.612857499600011"/>
      <range upper="550.100031217200012" symbol="3" label="413 - 550" render="true" lower="413.356444358400040"/>
      <range upper="686.843618075999984" symbol="4" label="550 - 687" render="true" lower="550.100031217200012"/>
    </ranges>
    <symbols>
      <symbol type="marker" clip_to_extent="1" force_rhr="0" name="0" alpha="1">
        <data_defined_properties>
          <Option type="Map">
            <Option type="QString" name="name" value=""/>
            <Option name="properties"/>
            <Option type="QString" name="type" value="collection"/>
          </Option>
        </data_defined_properties>
        <layer class="SimpleMarker" locked="0" pass="0" enabled="1">
          <Option type="Map">
            <Option type="QString" name="angle" value="0"/>
            <Option type="QString" name="cap_style" value="square"/>
            <Option type="QString" name="color" value="255,255,255,255"/>
            <Option type="QString" name="horizontal_anchor_point" value="1"/>
            <Option type="QString" name="joinstyle" value="bevel"/>
            <Option type="QString" name="name" value="circle"/>
            <Option type="QString" name="offset" value="0,0"/>
            <Option type="QString" name="offset_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="offset_unit" value="MM"/>
            <Option type="QString" name="outline_color" value="35,35,35,255"/>
            <Option type="QString" name="outline_style" value="solid"/>
            <Option type="QString" name="outline_width" value="0"/>
            <Option type="QString" name="outline_width_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="outline_width_unit" value="MM"/>
            <Option type="QString" name="scale_method" value="diameter"/>
            <Option type="QString" name="size" value="2"/>
            <Option type="QString" name="size_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="size_unit" value="MM"/>
            <Option type="QString" name="vertical_anchor_point" value="1"/>
          </Option>
          <prop v="0" k="angle"/>
          <prop v="square" k="cap_style"/>
          <prop v="255,255,255,255" k="color"/>
          <prop v="1" k="horizontal_anchor_point"/>
          <prop v="bevel" k="joinstyle"/>
          <prop v="circle" k="name"/>
          <prop v="0,0" k="offset"/>
          <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
          <prop v="MM" k="offset_unit"/>
          <prop v="35,35,35,255" k="outline_color"/>
          <prop v="solid" k="outline_style"/>
          <prop v="0" k="outline_width"/>
          <prop v="3x:0,0,0,0,0,0" k="outline_width_map_unit_scale"/>
          <prop v="MM" k="outline_width_unit"/>
          <prop v="diameter" k="scale_method"/>
          <prop v="2" k="size"/>
          <prop v="3x:0,0,0,0,0,0" k="size_map_unit_scale"/>
          <prop v="MM" k="size_unit"/>
          <prop v="1" k="vertical_anchor_point"/>
          <data_defined_properties>
            <Option type="Map">
              <Option type="QString" name="name" value=""/>
              <Option name="properties"/>
              <Option type="QString" name="type" value="collection"/>
            </Option>
          </data_defined_properties>
        </layer>
      </symbol>
      <symbol type="marker" clip_to_extent="1" force_rhr="0" name="1" alpha="1">
        <data_defined_properties>
          <Option type="Map">
            <Option type="QString" name="name" value=""/>
            <Option name="properties"/>
            <Option type="QString" name="type" value="collection"/>
          </Option>
        </data_defined_properties>
        <layer class="SimpleMarker" locked="0" pass="0" enabled="1">
          <Option type="Map">
            <Option type="QString" name="angle" value="0"/>
            <Option type="QString" name="cap_style" value="square"/>
            <Option type="QString" name="color" value="255,191,191,255"/>
            <Option type="QString" name="horizontal_anchor_point" value="1"/>
            <Option type="QString" name="joinstyle" value="bevel"/>
            <Option type="QString" name="name" value="circle"/>
            <Option type="QString" name="offset" value="0,0"/>
            <Option type="QString" name="offset_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="offset_unit" value="MM"/>
            <Option type="QString" name="outline_color" value="35,35,35,255"/>
            <Option type="QString" name="outline_style" value="solid"/>
            <Option type="QString" name="outline_width" value="0"/>
            <Option type="QString" name="outline_width_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="outline_width_unit" value="MM"/>
            <Option type="QString" name="scale_method" value="diameter"/>
            <Option type="QString" name="size" value="2"/>
            <Option type="QString" name="size_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="size_unit" value="MM"/>
            <Option type="QString" name="vertical_anchor_point" value="1"/>
          </Option>
          <prop v="0" k="angle"/>
          <prop v="square" k="cap_style"/>
          <prop v="255,191,191,255" k="color"/>
          <prop v="1" k="horizontal_anchor_point"/>
          <prop v="bevel" k="joinstyle"/>
          <prop v="circle" k="name"/>
          <prop v="0,0" k="offset"/>
          <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
          <prop v="MM" k="offset_unit"/>
          <prop v="35,35,35,255" k="outline_color"/>
          <prop v="solid" k="outline_style"/>
          <prop v="0" k="outline_width"/>
          <prop v="3x:0,0,0,0,0,0" k="outline_width_map_unit_scale"/>
          <prop v="MM" k="outline_width_unit"/>
          <prop v="diameter" k="scale_method"/>
          <prop v="2" k="size"/>
          <prop v="3x:0,0,0,0,0,0" k="size_map_unit_scale"/>
          <prop v="MM" k="size_unit"/>
          <prop v="1" k="vertical_anchor_point"/>
          <data_defined_properties>
            <Option type="Map">
              <Option type="QString" name="name" value=""/>
              <Option name="properties"/>
              <Option type="QString" name="type" value="collection"/>
            </Option>
          </data_defined_properties>
        </layer>
      </symbol>
      <symbol type="marker" clip_to_extent="1" force_rhr="0" name="2" alpha="1">
        <data_defined_properties>
          <Option type="Map">
            <Option type="QString" name="name" value=""/>
            <Option name="properties"/>
            <Option type="QString" name="type" value="collection"/>
          </Option>
        </data_defined_properties>
        <layer class="SimpleMarker" locked="0" pass="0" enabled="1">
          <Option type="Map">
            <Option type="QString" name="angle" value="0"/>
            <Option type="QString" name="cap_style" value="square"/>
            <Option type="QString" name="color" value="255,128,128,255"/>
            <Option type="QString" name="horizontal_anchor_point" value="1"/>
            <Option type="QString" name="joinstyle" value="bevel"/>
            <Option type="QString" name="name" value="circle"/>
            <Option type="QString" name="offset" value="0,0"/>
            <Option type="QString" name="offset_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="offset_unit" value="MM"/>
            <Option type="QString" name="outline_color" value="35,35,35,255"/>
            <Option type="QString" name="outline_style" value="solid"/>
            <Option type="QString" name="outline_width" value="0"/>
            <Option type="QString" name="outline_width_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="outline_width_unit" value="MM"/>
            <Option type="QString" name="scale_method" value="diameter"/>
            <Option type="QString" name="size" value="2"/>
            <Option type="QString" name="size_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="size_unit" value="MM"/>
            <Option type="QString" name="vertical_anchor_point" value="1"/>
          </Option>
          <prop v="0" k="angle"/>
          <prop v="square" k="cap_style"/>
          <prop v="255,128,128,255" k="color"/>
          <prop v="1" k="horizontal_anchor_point"/>
          <prop v="bevel" k="joinstyle"/>
          <prop v="circle" k="name"/>
          <prop v="0,0" k="offset"/>
          <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
          <prop v="MM" k="offset_unit"/>
          <prop v="35,35,35,255" k="outline_color"/>
          <prop v="solid" k="outline_style"/>
          <prop v="0" k="outline_width"/>
          <prop v="3x:0,0,0,0,0,0" k="outline_width_map_unit_scale"/>
          <prop v="MM" k="outline_width_unit"/>
          <prop v="diameter" k="scale_method"/>
          <prop v="2" k="size"/>
          <prop v="3x:0,0,0,0,0,0" k="size_map_unit_scale"/>
          <prop v="MM" k="size_unit"/>
          <prop v="1" k="vertical_anchor_point"/>
          <data_defined_properties>
            <Option type="Map">
              <Option type="QString" name="name" value=""/>
              <Option name="properties"/>
              <Option type="QString" name="type" value="collection"/>
            </Option>
          </data_defined_properties>
        </layer>
      </symbol>
      <symbol type="marker" clip_to_extent="1" force_rhr="0" name="3" alpha="1">
        <data_defined_properties>
          <Option type="Map">
            <Option type="QString" name="name" value=""/>
            <Option name="properties"/>
            <Option type="QString" name="type" value="collection"/>
          </Option>
        </data_defined_properties>
        <layer class="SimpleMarker" locked="0" pass="0" enabled="1">
          <Option type="Map">
            <Option type="QString" name="angle" value="0"/>
            <Option type="QString" name="cap_style" value="square"/>
            <Option type="QString" name="color" value="255,64,64,255"/>
            <Option type="QString" name="horizontal_anchor_point" value="1"/>
            <Option type="QString" name="joinstyle" value="bevel"/>
            <Option type="QString" name="name" value="circle"/>
            <Option type="QString" name="offset" value="0,0"/>
            <Option type="QString" name="offset_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="offset_unit" value="MM"/>
            <Option type="QString" name="outline_color" value="35,35,35,255"/>
            <Option type="QString" name="outline_style" value="solid"/>
            <Option type="QString" name="outline_width" value="0"/>
            <Option type="QString" name="outline_width_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="outline_width_unit" value="MM"/>
            <Option type="QString" name="scale_method" value="diameter"/>
            <Option type="QString" name="size" value="2"/>
            <Option type="QString" name="size_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="size_unit" value="MM"/>
            <Option type="QString" name="vertical_anchor_point" value="1"/>
          </Option>
          <prop v="0" k="angle"/>
          <prop v="square" k="cap_style"/>
          <prop v="255,64,64,255" k="color"/>
          <prop v="1" k="horizontal_anchor_point"/>
          <prop v="bevel" k="joinstyle"/>
          <prop v="circle" k="name"/>
          <prop v="0,0" k="offset"/>
          <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
          <prop v="MM" k="offset_unit"/>
          <prop v="35,35,35,255" k="outline_color"/>
          <prop v="solid" k="outline_style"/>
          <prop v="0" k="outline_width"/>
          <prop v="3x:0,0,0,0,0,0" k="outline_width_map_unit_scale"/>
          <prop v="MM" k="outline_width_unit"/>
          <prop v="diameter" k="scale_method"/>
          <prop v="2" k="size"/>
          <prop v="3x:0,0,0,0,0,0" k="size_map_unit_scale"/>
          <prop v="MM" k="size_unit"/>
          <prop v="1" k="vertical_anchor_point"/>
          <data_defined_properties>
            <Option type="Map">
              <Option type="QString" name="name" value=""/>
              <Option name="properties"/>
              <Option type="QString" name="type" value="collection"/>
            </Option>
          </data_defined_properties>
        </layer>
      </symbol>
      <symbol type="marker" clip_to_extent="1" force_rhr="0" name="4" alpha="1">
        <data_defined_properties>
          <Option type="Map">
            <Option type="QString" name="name" value=""/>
            <Option name="properties"/>
            <Option type="QString" name="type" value="collection"/>
          </Option>
        </data_defined_properties>
        <layer class="SimpleMarker" locked="0" pass="0" enabled="1">
          <Option type="Map">
            <Option type="QString" name="angle" value="0"/>
            <Option type="QString" name="cap_style" value="square"/>
            <Option type="QString" name="color" value="255,0,0,255"/>
            <Option type="QString" name="horizontal_anchor_point" value="1"/>
            <Option type="QString" name="joinstyle" value="bevel"/>
            <Option type="QString" name="name" value="circle"/>
            <Option type="QString" name="offset" value="0,0"/>
            <Option type="QString" name="offset_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="offset_unit" value="MM"/>
            <Option type="QString" name="outline_color" value="35,35,35,255"/>
            <Option type="QString" name="outline_style" value="solid"/>
            <Option type="QString" name="outline_width" value="0"/>
            <Option type="QString" name="outline_width_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="outline_width_unit" value="MM"/>
            <Option type="QString" name="scale_method" value="diameter"/>
            <Option type="QString" name="size" value="2"/>
            <Option type="QString" name="size_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="size_unit" value="MM"/>
            <Option type="QString" name="vertical_anchor_point" value="1"/>
          </Option>
          <prop v="0" k="angle"/>
          <prop v="square" k="cap_style"/>
          <prop v="255,0,0,255" k="color"/>
          <prop v="1" k="horizontal_anchor_point"/>
          <prop v="bevel" k="joinstyle"/>
          <prop v="circle" k="name"/>
          <prop v="0,0" k="offset"/>
          <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
          <prop v="MM" k="offset_unit"/>
          <prop v="35,35,35,255" k="outline_color"/>
          <prop v="solid" k="outline_style"/>
          <prop v="0" k="outline_width"/>
          <prop v="3x:0,0,0,0,0,0" k="outline_width_map_unit_scale"/>
          <prop v="MM" k="outline_width_unit"/>
          <prop v="diameter" k="scale_method"/>
          <prop v="2" k="size"/>
          <prop v="3x:0,0,0,0,0,0" k="size_map_unit_scale"/>
          <prop v="MM" k="size_unit"/>
          <prop v="1" k="vertical_anchor_point"/>
          <data_defined_properties>
            <Option type="Map">
              <Option type="QString" name="name" value=""/>
              <Option name="properties"/>
              <Option type="QString" name="type" value="collection"/>
            </Option>
          </data_defined_properties>
        </layer>
      </symbol>
    </symbols>
    <source-symbol>
      <symbol type="marker" clip_to_extent="1" force_rhr="0" name="0" alpha="1">
        <data_defined_properties>
          <Option type="Map">
            <Option type="QString" name="name" value=""/>
            <Option name="properties"/>
            <Option type="QString" name="type" value="collection"/>
          </Option>
        </data_defined_properties>
        <layer class="SimpleMarker" locked="0" pass="0" enabled="1">
          <Option type="Map">
            <Option type="QString" name="angle" value="0"/>
            <Option type="QString" name="cap_style" value="square"/>
            <Option type="QString" name="color" value="213,180,60,255"/>
            <Option type="QString" name="horizontal_anchor_point" value="1"/>
            <Option type="QString" name="joinstyle" value="bevel"/>
            <Option type="QString" name="name" value="circle"/>
            <Option type="QString" name="offset" value="0,0"/>
            <Option type="QString" name="offset_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="offset_unit" value="MM"/>
            <Option type="QString" name="outline_color" value="35,35,35,255"/>
            <Option type="QString" name="outline_style" value="solid"/>
            <Option type="QString" name="outline_width" value="0"/>
            <Option type="QString" name="outline_width_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="outline_width_unit" value="MM"/>
            <Option type="QString" name="scale_method" value="diameter"/>
            <Option type="QString" name="size" value="2"/>
            <Option type="QString" name="size_map_unit_scale" value="3x:0,0,0,0,0,0"/>
            <Option type="QString" name="size_unit" value="MM"/>
            <Option type="QString" name="vertical_anchor_point" value="1"/>
          </Option>
          <prop v="0" k="angle"/>
          <prop v="square" k="cap_style"/>
          <prop v="213,180,60,255" k="color"/>
          <prop v="1" k="horizontal_anchor_point"/>
          <prop v="bevel" k="joinstyle"/>
          <prop v="circle" k="name"/>
          <prop v="0,0" k="offset"/>
          <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
          <prop v="MM" k="offset_unit"/>
          <prop v="35,35,35,255" k="outline_color"/>
          <prop v="solid" k="outline_style"/>
          <prop v="0" k="outline_width"/>
          <prop v="3x:0,0,0,0,0,0" k="outline_width_map_unit_scale"/>
          <prop v="MM" k="outline_width_unit"/>
          <prop v="diameter" k="scale_method"/>
          <prop v="2" k="size"/>
          <prop v="3x:0,0,0,0,0,0" k="size_map_unit_scale"/>
          <prop v="MM" k="size_unit"/>
          <prop v="1" k="vertical_anchor_point"/>
          <data_defined_properties>
            <Option type="Map">
              <Option type="QString" name="name" value=""/>
              <Option name="properties"/>
              <Option type="QString" name="type" value="collection"/>
            </Option>
          </data_defined_properties>
        </layer>
      </symbol>
    </source-symbol>
    <colorramp type="gradient" name="[source]">
      <Option type="Map">
        <Option type="QString" name="color1" value="255,255,255,255"/>
        <Option type="QString" name="color2" value="255,0,0,255"/>
        <Option type="QString" name="discrete" value="0"/>
        <Option type="QString" name="rampType" value="gradient"/>
      </Option>
      <prop v="255,255,255,255" k="color1"/>
      <prop v="255,0,0,255" k="color2"/>
      <prop v="0" k="discrete"/>
      <prop v="gradient" k="rampType"/>
    </colorramp>
    <classificationMethod id="EqualInterval">
      <symmetricMode astride="0" symmetrypoint="0" enabled="0"/>
      <labelFormat trimtrailingzeroes="1" format="%1 - %2" labelprecision="0"/>
      <parameters>
        <Option/>
      </parameters>
      <extraInformation/>
    </classificationMethod>
    <rotation/>
    <sizescale/>
  </renderer-v2>
  <blendMode>0</blendMode>
  <featureBlendMode>0</featureBlendMode>
  <layerGeometryType>0</layerGeometryType>
</qgis>

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update dependency @types/mapbox-gl to v2.7.21
  • chore(deps): update commitlint monorepo to v18.6.1 (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update dependency eslint to v8.57.0
  • chore(deps): update dependency webpack to v5.91.0
  • fix(deps): update dependency geostyler-style to v8.1.0
  • chore(deps): update actions/cache action to v4
  • chore(deps): update commitlint monorepo to v19 (major) (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update dependency @terrestris/eslint-config-typescript to v5
  • chore(deps): update dependency conventional-changelog-conventionalcommits to v8
  • chore(deps): update dependency eslint to v9
  • chore(deps): update semantic-release monorepo (major) (@semantic-release/github, @semantic-release/npm, @semantic-release/release-notes-generator, semantic-release)
  • chore(deps): update wagoid/commitlint-github-action action to v6
  • fix(deps): update dependency @types/mapbox-gl to v3
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/commitlint.yml
  • actions/checkout v4
  • wagoid/commitlint-github-action v5
.github/workflows/on-pull-request.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/cache v3
.github/workflows/on-push-master.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/cache v3
.github/workflows/release.yml
  • actions/checkout v4
  • actions/setup-node v4
  • cycjimmy/semantic-release-action v4
npm
package.json
  • @types/mapbox-gl ^2.7.18
  • geostyler-style ^8.0.0
  • @babel/polyfill ^7.12.1
  • @commitlint/cli ^18.4.3
  • @commitlint/config-conventional ^18.4.3
  • @semantic-release/changelog ^6.0.3
  • @semantic-release/git ^10.0.1
  • @semantic-release/github ^9.2.3
  • @semantic-release/npm ^11.0.1
  • @semantic-release/release-notes-generator ^12.1.0
  • @terrestris/eslint-config-typescript ^3.1.0
  • @types/jest ^29.5.8
  • @types/lodash ^4.14.201
  • @types/node ^20.9.0
  • @typescript-eslint/eslint-plugin ^5.62.0
  • @typescript-eslint/eslint-plugin-tslint ^5.62.0
  • @typescript-eslint/parser ^5.62.0
  • conventional-changelog-conventionalcommits ^6.1.0
  • coveralls ^3.1.1
  • eslint ^8.53.0
  • jest ^29.7.0
  • semantic-release ^22.0.8
  • terser-webpack-plugin ^5.3.9
  • ts-jest ^29.1.1
  • ts-loader ^9.5.0
  • typescript ^5.2.2
  • webpack ^5.89.0
  • webpack-cli ^5.1.4
  • node >=18
  • npm >=9

  • Check this box to trigger a request for Renovate to run again on this repository

Distinct Rule id's

If multiple rules will be created from a single layer, all rules will have the same name, even though rules should be distinguishable by name.

[mapbox-parser] Handle distinct mapbox attribute expressions

PARSER

MAPBOX

FEATUREREQUEST

Description:

Currently we only support parsing of attribute expressions if only one attribute contains an expression or if all expressions of multiple attributes are equal. We should also support distinct expressions on multiple attributes.

mapbox integration level

Question

I'm not sure to understand the level of completion of this package. Is there a roadmap I've missed ?

I have – a lot – of mapbox styles that need to be converted to SLD. My idea was to parse and convert them using this package, but the expressions not handled seems to be passed to geostyler "as is" : not processed at all in the resulting SLD.

Example :

mapbox
{
  "version": 8,
  "name": "iceland numeric test",
  "sprite": "",
  "glyphs": "",
  "sources": {
    "MX-3Q41Y-AH46I-1QGD9-SRC": {
      "type": "vector",
      "layerInfo": {
        "name": "mx_vector_2r63w_aailg_s7xbb_mfprt"
      },
      "attribution": "<a>iceland_test_numeric</a>",
      "tiles": []
      "promoteId": "gid"
    }
  },
  "layers": [
    {
      "id": "MX-3Q41Y-AH46I-1QGD9@8TqF9",
      "source": "MX-3Q41Y-AH46I-1QGD9-SRC",
      "filter": [
        "all",
        ["==", ["typeof", ["get", "amount"]], "number"],
        [">", ["get", "amount"], 0],
        ["<=", ["get", "amount"], 10.12]
      ],
      "source-layer": "MX-3Q41Y-AH46I-1QGD9",
      "metadata": {
        "type": "number",
        "position": 1,
        "priority": 1
      },
      "type": "circle",
      "paint": {
        "circle-color": "#023858",
        "circle-radius": 15
      }
    },
    {
      "id": "MX-3Q41Y-AH46I-1QGD9@W82FL",
      "source": "MX-3Q41Y-AH46I-1QGD9-SRC",
      "filter": ["all", ["!=", ["typeof", ["get", "amount"]], "number"]],
      "source-layer": "MX-3Q41Y-AH46I-1QGD9",
      "metadata": {
        "type": "number",
        "position": 0,
        "priority": 1
      },
      "type": "circle",
      "paint": {
        "circle-color": "#f60675",
        "circle-radius": 15
      }
    },
    {
      "id": "MX-3Q41Y-AH46I-1QGD9@rRHVt",
      "source": "MX-3Q41Y-AH46I-1QGD9-SRC",
      "filter": [
        "all",
        ["==", ["typeof", ["get", "amount"]], "number"],
        ["==", ["get", "amount"], 0]
      ],
      "source-layer": "MX-3Q41Y-AH46I-1QGD9",
      "metadata": {
        "type": "number",
        "position": 0,
        "priority": 1
      },
      "type": "circle",
      "paint": {
        "circle-color": "#fff7fb",
        "circle-radius": 15
      }
    }
  ]
}
gstyle
{
  "output": {
    "name": "iceland numeric test",
    "rules": [
      {
        "name": "MX-3Q41Y-AH46I-1QGD9@8TqF9",
        "filter": [
          "&&",
          ["==", ["typeof", ["get", "amount"]], "number"],
          [">", ["get", "amount"], 0],
          ["<=", ["get", "amount"], 10.12]
        ],
        "symbolizers": [
          {
            "kind": "Mark",
            "color": "#023858",
            "radius": 15,
            "wellKnownName": "circle"
          }
        ]
      },
      {
        "name": "MX-3Q41Y-AH46I-1QGD9@W82FL",
        "filter": ["&&", ["!=", ["typeof", ["get", "amount"]], "number"]],
        "symbolizers": [
          {
            "kind": "Mark",
            "color": "#f60675",
            "radius": 15,
            "wellKnownName": "circle"
          }
        ]
      },
      {
        "name": "MX-3Q41Y-AH46I-1QGD9@rRHVt",
        "filter": [
          "&&",
          ["==", ["typeof", ["get", "amount"]], "number"],
          ["==", ["get", "amount"], 0]
        ],
        "symbolizers": [
          {
            "kind": "Mark",
            "color": "#fff7fb",
            "radius": 15,
            "wellKnownName": "circle"
          }
        ]
      }
    ]
  }
}

sld
<?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">
  <NamedLayer>
    <Name>iceland numeric test</Name>
    <UserStyle>
      <Name>iceland numeric test</Name>
      <Title>iceland numeric test</Title>
      <FeatureTypeStyle>
        <Rule>
          <Name>MX-3Q41Y-AH46I-1QGD9@8TqF9</Name>
          <Filter xmlns="http://www.opengis.net/ogc"/>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>circle</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#023858</CssParameter>
                </Fill>
              </Mark>
              <Size>30</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
        <Rule>
          <Name>MX-3Q41Y-AH46I-1QGD9@W82FL</Name>
          <Filter xmlns="http://www.opengis.net/ogc"/>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>circle</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#f60675</CssParameter>
                </Fill>
              </Mark>
              <Size>30</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
        <Rule>
          <Name>MX-3Q41Y-AH46I-1QGD9@rRHVt</Name>
          <Filter xmlns="http://www.opengis.net/ogc"/>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>circle</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#fff7fb</CssParameter>
                </Fill>
              </Mark>
              <Size>30</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Thanks :)

[mapbox-parser] TextSymbolizer & IconSymbolizer undistinguishable

PARSER

MAPBOX

QUESTION

Description:

Mapbox merges the attributes of TextSymbolizer and IconSymbolizer in a single type symbol, where TextSymbolizer related attributes contain the prefix text- and IconSymbolizer related attributes the prefix icon-. However, since all symbol-type properties are optional, we cannot reason if only a Text or an IconSymbolizer should be created, or if both should be created.

Now is the question on how to handle this problem. Should we simply always create both symbolizers or should we only create those symbolizers where e.g. at least one value is not undefined?

The result of both "solutions" would create a non-bijective parser.

GeoStyler should support spritesheets

Feature Request

mapbox is based on sprite sheets. The sprite property is referreing to an url that points to a .png and .json file, by standard the mentioned mapbox sprite api is not used.

https://docs.mapbox.com/style-spec/reference/root/#sprite

Either mapbox parser can create a base64 image or the other parsers needs to accept spritesheets and handle them.

First option: geostyler-mapbox-parser could get a feature flag if it should request and transform the spritesheets.

Second option: add sprite data information to geostyler style (spriteimage, position, size). OpenLayers supports sprites: properties offset, size in https://openlayers.org/en/latest/apidoc/module-ol_style_Icon-Icon.html

Handle distinct mapbox attribute expressions

Currently we only support parsing of attribute expressions if only one attribute contains an expression or if all expressions of multiple attributes are equal. We should also support distinct expressions on multiple attributes.

Return mapbox-style instead of string

Currently the output of the writeStyle is a string created with JSON.stringify. We should change this to be the mapbox-style itself. It will be a breaking change tho.

Provide alternative for fetching sprite data

Feature Request

Is your feature request related to a problem? Please describe.
With #308 it is possible to fetch sprite informations from a (remote) URI. There may be environements where fetching is not possible or wanted.

Describe the solution you'd like
@simonseyock suggested to provide an alternative to get the need informations without using fetch or any requests.

Describe alternatives you've considered

  • add the possibility to pass an instance of a fetch method to handle the stuff yourself
  • add the data directly via constructor

background layer type stops conversion

Bug

Describe the bug
Attempting to translate a MapBox style from https://github.com/openmaptiles/osm-bright-gl-style/ throws an unsupported error due to the following block:

  "layers": [
    {
      "id": "background",
      "type": "background",
      "paint": {"background-color": "#f8f4f0"}
    },

https://github.com/openmaptiles/osm-bright-gl-style/blob/8af4769692d0f9219d0936711609d580b34bf365/style.json#L35

To Reproduce

Run the GeoStyler client on the file:

.\geostyler-cli -s "mapbox" -o bright.geostyler /osm-bright-gl-style/style.json


✖ Error during translation of file "/osm-bright-gl-style/style.json": Error: Could not parse mapbox style. Unsupported layer type.
                We support types 'fill', 'line', 'circle' and 'symbol' only.

Expected behavior
Ideally the translation would happen, and output a warning about not supported layers, but continue to translate the remainder.

Desktop (please complete the following information):

  • v3.0.0 of GeoStyler Client

Refactoring TODOs

Due to the growing complexity (expressions, async handling, …) the code is getting messy so we need to do some refactoring.
Suggested TODOs are:

  • Split code into more files (at least read and write)
  • Split mapboxLayersToGeoStylerRules into mulitple functions
  • Cleanup handling of metadata (currently fragile state manipulation)

Feel free to add or suggest more.

Reading non-hex Colors

Bug

Describe the bug

If a color value is not an expression, we currently simply pass the color value of a mapbox-style as-is to the geostyler-style. However, these values might come in the format of rgba(r, g, b, a), whereas geostyler-style expects hex-values. So we have to check for those values and replace them with their hex-color value in order for geostyler to work as expected.

Expected behavior

Color values that are not hex-colors should be replaced with hex-colors when reading a mapbox style.

Example mapbox-style with rgba color values.

 {
      "id": "boundaries",
      "type": "fill",
      "source": "terrestris_boundaries",
      "source-layer": "vector_osm_world_boundaries",
      "layout": {"visibility": "visible"},
      "paint": {
        "fill-color": "rgba(255, 255, 255, 0.82)",
        "fill-outline-color": "rgba(0, 0, 0, 1)",
        "fill-opacity": 1
      }
    },

[mapbox-parser] Distinct Rule id's

PARSER

MAPBOX

FEATUREREQUEST

Description:

If multiple rules will be created from a single layer, all rules will have the same name, even though rules should be distinguishable by name.

TextSymbolizer & IconSymbolizer undistinguishable

Mapbox merges the attributes of TextSymbolizer and IconSymbolizer in a single type symbol, where TextSymbolizer related attributes contain the prefix text- and IconSymbolizer related attributes the prefix icon-. However, since all symbol-type properties are optional, we cannot reason if only a Text or an IconSymbolizer should be created, or if both should be created.

Now is the question on how to handle this problem. Should we simply always create both symbolizers or should we only create those symbolizers where e.g. at least one value is not undefined?

The result of both "solutions" would create a non-bijective parser.

Filters for integers don't work

Bug

The filter value for number comparisons (=/</>/<=/>=) is being stored as a string rather than an integer in the mbtiles output. This causes the expressions to fail when loading in Mapbox GL.

To Reproduce
Steps to reproduce the behavior:

  1. Create a style that uses a numerical expression
  2. Pass it to MapboxParser.writeStyle

Expected filter output

[ ">=", "Median income", 56390.333333333321207 ],
**Actual filter output:

[ ">=", "Median income", "56390.333333333321207" ],

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Split fill and outline properties in separate symbolyzers

The mapbox style specification has only a fill-outline-color concerning the outline on a layer of type=fill (https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#paint-fill-fill-outline-color) whereas other style formats (SLD, QML...) have many other properties. Every other outline properties are non-existent for a Fill layer. This is the issue behind this outline_width concern geostyler/geostyler#1811.

The trick would be to split a Symboliser in two separated layers : a Fill layer (https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#fill) and a Line layer (https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#line).

So when converting from e.g. SLD or QML to Mapbox, one symbolizer would lead to two.

In addition, we could use the metadata field (https://docs.mapbox.com/mapbox-gl-js/style-spec/root/#metadata) to make Mapbox style specs generated from Geostyler convertible back to other style formats with merging of outline and fill (thanks @ahocevar for the suggestion)

Parse RasterSymbolizer

Question

Hello,

I can convert a text I have from geostyler-style to Raster. But I cannot convert it to a mapbox layer of Raster type in geostyler-mapbox-parser.

When I examined it, the subject of Raster in 2019 by @jansule fell into pull requests. Even in their own branches (branchName : rasterSymbolizer), I even saw the relevant codes. Raster conversion operations seemed to be done. But related blocks
I could not find it in the master branch of geostyler-mapbox-parser.

I have a raster sld information and how can I convert it as a mapbox layer. Can you help with this?

geostyler-mapbox-parser : latest version
Geostyler-style : latest version

I apologise if I used a wrong expression.

There may be some problems in converting sld to mbStyle

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/geostyler-mapbox-parser/build/dist/MapboxStyleParser.js b/node_modules/geostyler-mapbox-parser/build/dist/MapboxStyleParser.js
index 6cc17f1..8977a0b 100644
--- a/node_modules/geostyler-mapbox-parser/build/dist/MapboxStyleParser.js
+++ b/node_modules/geostyler-mapbox-parser/build/dist/MapboxStyleParser.js
@@ -821,7 +821,7 @@ var MapboxStyleParser = /** @class */ (function () {
                 layout = this.getLayoutFromTextSymbolizer(symbolizerClone);
                 break;
             case 'Mark':
-                if (symbolizer.wellKnownName === 'Circle') {
+                if (symbolizer.wellKnownName.toLowerCase() === 'circle') {
                     layerType = 'circle';
                     paint = this.getPaintFromCircleSymbolizer(symbolizerClone);
                     layout = this.getLayoutFromCircleSymbolizer(symbolizerClone);

This issue body was partially generated by patch-package.

Add ambivalent expressions to metadata

Feature Request

Is your feature request related to a problem? Please describe.

Some mapbox expressions do not have a clear 1:1 relationship with expressions in geostyler-style. E.g. the e expression (https://github.com/geostyler/geostyler-mapbox-parser/blob/beta-4/src/Expressions.ts#L200). This might lead to ambivalence when parsing there and back.

Describe the solution you'd like

It might be helpful to add those expressions to the metadata so that we maintain a bijective relation between mapbox style and geostyler-style.

Describe alternatives you've considered
None

Additional context
None

[mapbox-parser] List of Features - Overview

PARSER

MAPBOX

Description: List of Features

  • parse FillSymbolizer
  • parse LineSymbolizer
  • parse IconSymbolizer (only with workaround)
  • parse TextSymbolizer
    • parse static text
    • parse placeholder text
    • parse formatted text (currently only parsing label text in readStyle)
    • parse different fonts (e.g. font-awesome)
  • parse MarkSymbolizer
    • parse Circle
    • parse WellKnownNames
  • parse Filter (limited to supported expressions)
  • parse scaleDenominator

mapbox specifics:

  • parse sources of style (only documentation of workaround)
  • parse source of layer (only documentation of workaround)
  • parse mapbox functions
    • stops
    • property
    • base
    • type
    • default
    • colorSpace
    • zoom functions
    • property functions
    • zoom-and-property functions
  • parse RasterLayer
  • parse BackgroundLayer
  • parse mapbox expressions (currently all used expressions have to be equal in terms of structure)
    • parse case expression
    • parse get expression
    • parse format expression
    • parse logical expressions
    • ...
  • parse Fill-Extrusion
  • parse Heatmap
  • parse Hillshade

Parse Layout properties

Currently, we are only parsing paint properties. We should also support parsing of layout properties.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.