Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonpoole/josmtemplateparser
Parser for JOSM name templates
https://github.com/simonpoole/josmtemplateparser
josm openstreetmap vespucci
Last synced: 8 days ago
JSON representation
Parser for JOSM name templates
- Host: GitHub
- URL: https://github.com/simonpoole/josmtemplateparser
- Owner: simonpoole
- License: mit
- Created: 2021-09-15T21:10:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-09T11:48:40.000Z (4 months ago)
- Last Synced: 2024-09-09T14:01:58.732Z (4 months ago)
- Topics: josm, openstreetmap, vespucci
- Language: Java
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![build status](https://github.com/simonpoole/JosmTemplateParser/actions/workflows/javalib.yml/badge.svg)](https://github.com/simonpoole/JosmTemplateParser/actions) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=JosmTemplateParser&metric=alert_status)](https://sonarcloud.io/dashboard?id=JosmTemplateParser) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=JosmTemplateParser&metric=coverage)](https://sonarcloud.io/dashboard?id=JosmTemplateParser) [![sonarcloud bugs](https://sonarcloud.io/api/project_badges/measure?project=JosmTemplateParser&metric=bugs)](https://sonarcloud.io/component_measures?id=JosmTemplateParser&metric=bugs) [![sonarcloud maintainability](https://sonarcloud.io/api/project_badges/measure?project=JosmTemplateParser&metric=sqale_rating)](https://sonarcloud.io/component_measures?id=JosmTemplateParser&metric=Maintainability) [![sonarcloud security](https://sonarcloud.io/api/project_badges/measure?project=JosmTemplateParser&metric=security_rating)](https://sonarcloud.io/component_measures?id=JosmTemplateParser&metric=Security) [![sonarcloud reliability](https://sonarcloud.io/api/project_badges/measure?project=JosmTemplateParser&metric=reliability_rating)](https://sonarcloud.io/component_measures?id=JosmTemplateParser&metric=Reliability)
# JosmTemplateParser
## Usage
try {
JosmTemplateParser parser = new JosmTemplateParser(new ByteArrayInputStream(filterString.getBytes()));
List formatters = parser.formatters();
.....
} catch (ParseException pex) {
...
} catch (Error err) {
...
}
Your OSM elements object must either implement the Meta interface or be wrapped in an object that implements it. The object can then be passed to the _Formatter.format_ method, resp. _Util.listFormat_.Currently there is no documentation of the grammar outside of [Name template details](https://josm.openstreetmap.de/wiki/TaggingPresets#name_templatedetails) which however has multiple errors and inconsistencies.
Note that the _{special:localName}_ template simply returns the value of the name tag.
## Including in your project
You can either download the jar from github or add the following to your build.gradle
...
repositories {
...
mavenCentral()
...
}
...
dependencies {
...
compile 'ch.poole.osm:JosmTemplateParser:0.2.0'
...
}