geostyler
TypeScript icon, indicating that this package has built-in type declarations

16.0.0 • Public • Published

GeoStyler Logo

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

Code: github Package: npm

Documentation: main / latest / 15.0.1

Examples: Demo application

Developer Guide: Developer Guide

Discord Banner 2

📆 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 - Ecosystem

The GeoStyler ecosystem is spread across multiple packages.

flowchart RL
  classDef parserCls fill:#fffdbc,stroke:#333,stroke-width:2px,color:#333;
  classDef toolCls fill:#c2f2ff,stroke:#333,stroke-width:2px,color:#333;
  classDef styleCls fill:white,stroke:#333,stroke-width:2px,color:#333;
  style convert fill:#EEE,color:#333;
  style editAndDisplay fill:#EEE,color:#333;
  style parser fill:#EEE,color:#333;

  subgraph convert[Conversion]
    cli[GeoStyler CLI]:::toolCls
    rest[GeoStyler Rest]:::toolCls
  end
  subgraph editAndDisplay[Edit and Display]
    ui[GeoStyler UI]:::toolCls
    legend[GeoStyler Legend]:::toolCls
  end
  geostylerStyle[/GeoStyler Style Format/]
  subgraph parser["Parsers"]
    direction LR
    sld([SLD]):::parserCls
    ol([OpenLayers]):::parserCls
    lyrx([Arc GIS]):::parserCls
    mapbox([MapLibre/MapbBox]):::parserCls
    qgis([QGIS]):::parserCls
    mapfile([Mapfile]):::parserCls
  end
  convert <--> geostylerStyle
  editAndDisplay <--> geostylerStyle:::styleCls
  geostylerStyle <--> parser

  click geostylerStyle "https://github.com/geostyler/geostyler-style"
  click sld "https://github.com/geostyler/geostyler-sld-parser"
  click qgis "https://github.com/geostyler/geostyler-qgis-parser"
  click lyrx "https://github.com/geostyler/geostyler-lyrx-parser"
  click ol "https://github.com/geostyler/geostyler-openlayers-parser"
  click mapbox "https://github.com/geostyler/geostyler-mapbox-parser"
  click mapfile "https://github.com/geostyler/geostyler-mapfile-parser"
  click cli "https://github.com/geostyler/geostyler-cli"
  click rest "https://github.com/geostyler/geostyler-rest"
  click legend "https://github.com/geostyler/geostyler-legend"
  click ui "https://github.com/geostyler/geostyler"

GeoStyler UI

The main package of the GeoStyler ecosystem is the UI library. It contains a collection of React components that can be used to build a styling UI for geodata. The main components are the <Style /> or <CardStyle /> component which serve as an entry point. The <Style /> component is a full-featured style editor that allows users to create and edit styles for geodata. The <CardStyle / > component offers a streamlined and compact alternative to the <Style / > component, optimized for utilization within drawer or card layouts. The library also contains lots of subcomponents that can be used for particular parts of the style editing process, such as the Symbolizer <Editor /> or the <RuleTable >.

GeoStyler Style

The UI library is built on top of the geostyler-style. This is the centerpiece of the GeoStyler ecosystem. The geostyler-style package is a TypeScript declaration that defines the GeoStyler style format. The style format is used to represent styles in a generic way that can be converted to and from other style formats. 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.

Parsers

The parsers make use of the geostyler-style package to convert between different style formats. The parsers are separate packages that can be used independently of the UI library. The parsers are used to convert between different style formats, such as SLD, OpenLayers, and Mapbox. Each parser is build on top of an interface defined in the geostyler-style package to make sure that read and write operations are consistent across all parsers.

Conversion tools

To convert between styles without a UI you can make use of conversion tools like the geostyler-cli or the geostyler-rest package. The geostyler-cli package is a command-line interface that uses the parsers so you can convert between different style formats directly from the command line. The geostyler-rest package is a REST API that is built on top of the command-line interface.

Legend

The geostyler-legend is a react component that renders a legend based on a GeoStyler style. Combined with the powers of the parsers this allows to render a legend for a variety of style formats.

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 💞

Readme

Keywords

Package Sidebar

Install

npm i geostyler

Weekly Downloads

5,147

Version

16.0.0

License

BSD-2-Clause

Unpacked Size

17.7 MB

Total Files

476

Last publish

Collaborators

  • jansule
  • annarieger
  • terrestris-info
  • marcjansen
  • kaivolland
  • dnlkoch
  • ahennr
  • buehner
  • hwbllmnn
  • lukaslohoff
  • mholthausen
  • jorzekowsky
  • simonseyock
  • hblitza
  • jweskamm
  • bgerber
  • chrismayer