npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

geostyler-cli

v4.2.0

Published

A command line interface for [GeoStyler](https://geostyler.org) to convert between various formats for styling of geographic data.

Downloads

116

Readme

GeoStyler CLI

A command line interface for GeoStyler to convert between various formats for styling of geographic data.

tl;dr

npx geostyler-cli --output new-qgis-style.qml my-existing.sld

Requirements

geostyler-cli can either be run as a standalone application or installed using Node.js.

Standalone application

Binaries are available for Linux, MacOS, and Windows on the Releases page. Download the zip file for your operating system, unzip, navigate to the folder and run the geostyler command:

geostyler-cli --output new-qgis-style.qml my-existing.sld

Usage without installation ⚡

Node.js includes npx, this allows you to run commands from an npm package without having to install it.

npx geostyler-cli -s sld -t qgis -o output.qml input.sld

Global installation

Installation 💾

Node.js includes npm - the JavaScript package manager. To install the geostyler command globally:

npm install -g geostyler-cli

You can then use the new geostyler-cli command, e.g.:

geostyler-cli -s sld -t qgis -o output.qml input.sld

To process a folder of files:

geostyler-cli -s sld -t qgis -o /outputdir /inputdir

Update 🚀

npm update -g geostyler-cli

Uninstalling 😔

npm uninstall -g geostyler-cli

Syntax and examples

To convert a single file:

geostyler-cli [options] -o /path/to/output.ext /path/to/input.ext
# example, relying on file extensions to select the parsers
geostyler-cli -o point_simple.sld testdata/point_simple.qml
# example with explicit parsers
geostyler-cli -s qml -t sld -o point_simple.sld testdata/point_simple.qml

To convert all files in a directory:

geostyler-cli [options] -t qgis -o /path/to/output /path/to/input/
# example
geostyler-cli -s sld -t qgis -o ./output-sld testdata/sld

To output the GeoStyler format to stdout (only available for a single file), don't set an output file or parser:

geostyler-cli [options] /path/to/input.ext
# print the GeoStyler format to stdout (relying on the file extension to select the parser)
geostyler-cli testdata/point_simple.qml
# print an SLD output to stdout
geostyler-cli -t sld testdata/point_simple.qml

Options

  • -h / --help Display the help and exit.
  • -o / --output Output filename or directory. Required when the source is a directory. For a file leave this empty to write to stdout. [string]
  • -s / --source Source parser, either mapbox, mapfile or map, sld or se for SLD - the parser will read the version from the file, and qgis or qml for QGIS QML files. If not given, it will be guessed from the extension of the input file. Mandatory if the the target is a directory.
  • -t / --target Target parser, either mapbox, sld (for SLD 1.0), se (for SLD 1.1), and qgis or qml for QGIS QML files. If not given, it will be guessed from the extension of the output file. Mapfiles are not currently supported as target. Mandatory if the the target is a directory.
  • -v / --version Display the version of the program.

Developing

In your clone of the repo, in the root directory:

npm install   # get dependencies
npm run build # build from possibly changed source
# now you can call your build like this:
npm start -- -s sld -t qgis -o output.qml testdata/point_simplepoint.sld

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 💞