Git Product home page Git Product logo

preset-utils's Introduction

Preset utils

A couple of utils for processing JOSM format presets for OSM editors and related stuff.

The repo further contains all Vespucci preset xlmns files, a copy of the JOSM one (JOSM currently doesn't version the file), and a number of xslt scripts to convert preset files. In particular src/main/resources/toJOSM.xslt will convert a preset file using the extensions supported by Vespucci to a JOSM compatible one (naturally the functionality will be loss too).

To run any of the commands below get the fat jar from the releases in this repository and then run

java -cp preset-utils-all-0.40.1.jar ch.poole.osm.presetutils.......

for example

java -cp preset-utils-all-0.40.1.jar ch.poole.osm.presetutils.Preset2Pot -h

Preset2Pot

Generates a gettext format translation template file from the preset file.

Usage

-i,--input <arg>    input preset file, default: standard in
-o,--output <arg>   output .pot file, default: standard out

Preset2Html

Generate a simple HTML page displaying the contents of the preset file.

Replaces

${ICONPATH} with icons/png/

${ICONTYPE} with .png

with other words it assumes that the icons are available in PNG format in icons/png.

Further it expects preset.css in the directory website

Usage

-i,--input <arg>      input preset file, default: standard in
-j,--josm <arg>       download link JOSM format, default: none
-o,--output <arg>     output .html file, default: standard out
-v,--vespucci <arg>   download link vespucci format, default: none

Synonyms

Retrieve synonym values from the iD editor repository and output a json object containing them.

Usage

 -u,--url <arg>        base url, required
 -l,--lang <arg>       language code to retrieve the synonyms for, default: en
 -o,--output <arg>     output json file, default: standard out
 -x,--exclude <args>   skip any entries that contain the terms (for example "military")
 -r,--remove           remove empty output files

ID2JOSM

Generate a JOSM preset from the iD preset configuration, retrieving some values from taginfo similar to what iD does.

Note:

  • this does not include any icons from the preset (but it does include references) and while it is mainly useful for statistical and comparison purposes, the output is fully functional.
  • if querying taginfo is not turned off, a fair bit of debugging output is written and the querying is rate limited (aka slow).

Currently ignored iD preset features are "matchScore", "countryCodes", "replacement", "removeTags", "icon", "imageURL" and "terms" (the Synonym tool can be used to turn the term field in to something useful).

Usage

 -o,--output <arg>     output xml file, default: standard out
 -c,--chunk            if set iD field definitions will be converted to JOSM preset "chunks", if not set the fields
                       are expanded inline
 -n,--notaginfo        don't query taginfo for values and keys
 -j,--josmonly         don't use Vespucci extensions to the JOSM preset format
 -f,--fieldsurl        url to file containing field definitions, default those in the id-tagging-schema repository
 -p,--preseturl        url to file containing preset definitions, default those in the id-tagging-schema repository
 -t,--translationurl   url to file containing translations, default those in the id-tagging-schema repository

PresetStats

Generate a list of tag combinations (first and 2nd level) from the presets and generate some stats on number of keys and values.

Usage

-i,--input <arg>      input preset file, default: standard in
-o,--output <arg>     output file, default: standard out
-t,--taginfo          query taginfo for tag counts, default: off
-d,--ignoredeprecated ignore deprecated items, default: false

MergePresetStats

Combine a taglist generated by PresetStats for multiple presets

Usage

-i,--input <args>     input preset stats files (at least one)
-o,--output <arg>     output file, default: standard out

TagsFromTaginfo

Generate a list of tag combinations (first and 2nd level) in the format generated by PresetStats from taginfo

Usage

-o,--output <arg>     output file, default: standard out
-m,--minimum <arg>    minimum occurrence count, subtags have to reach at least 1/5 of this default: 500
-n,--nosubtags        don't query and output subtags

ComparePresets

Compare two tag lists in the format generated by PresetStats

Usage

-i,--input <args>     input preset stats file
-r,--reference <arg>  reference preset stats file
-d,--depth <arg>      number of hierarchy steps to consider, 0 = all and is the default

CheckPreset

Do some consistency checks on a preset, this should be used additionally to validation against the xlmns specification.

Usage

-i,--input <args>     input preset file

Issues will be logged and in case of an error a non-zero status is returned.

preset-utils's People

Contributors

simonpoole avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

sarabjeet108

preset-utils's Issues

ID2JOSM - add input

I'm trying to convert some presets from in ID fork with ID2JOSM. But the urls for the fields and presets files are hard-coded in the source code (and they return a 404).
Could you consider adding them as an input for the script ?

NoClassDefFoundError

When I try to use the following command from the readme, I get an java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException error from java.

java -cp preset-utils-0.28.0.jar ch.poole.osm.presetutils.Preset2Pot -h

Is there something wrong in the doc or in the released jar ?

Make subgroups clearer

Please make subgroups clearer, maybe via indentation.

Playground equipment is a subgroup of Leisure. But it's not that obvious on the website, that the row starting with Picnic Site belongs to Leisure and not to Playground equipment

screenshot presets website

Follow up to #5

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.