Search in sources :

Example 6 with EnhancedProperties

use of uk.me.parabola.util.EnhancedProperties in project mkgmap by openstreetmap.

the class SeaGenerator method loadPrecompTile.

/**
 * Loads the precomp sea tile with the given filename.
 * @param filename the filename of the precomp sea tile
 * @return all ways of the tile
 * @throws FileNotFoundException if the tile could not be found
 */
private Collection<Way> loadPrecompTile(InputStream is, String filename) {
    OsmPrecompSeaDataSource src = new OsmPrecompSeaDataSource();
    EnhancedProperties props = new EnhancedProperties();
    props.setProperty("style", "empty");
    src.config(props);
    log.info("Started loading coastlines from", filename);
    try {
        src.parse(is, filename);
    } catch (FormatException e) {
        log.error("Failed to read " + filename);
        log.error(e);
    }
    log.info("Finished loading coastlines from", filename);
    return src.getElementSaver().getWays().values();
}
Also used : EnhancedProperties(uk.me.parabola.util.EnhancedProperties) FormatException(uk.me.parabola.imgfmt.FormatException)

Example 7 with EnhancedProperties

use of uk.me.parabola.util.EnhancedProperties in project mkgmap by openstreetmap.

the class OsmMapDataSource method createConverter.

/**
 * Create the appropriate converter from osm to garmin styles.
 */
protected void createConverter() {
    EnhancedProperties props = getConfig();
    Style style = StyleImpl.readStyle(props);
    setStyle(style);
    usedTags.addAll(style.getUsedTags());
    usedTags.addAll(NameFinder.getNameTags(props));
    converter = new StyledConverter(style, mapper, props);
}
Also used : EnhancedProperties(uk.me.parabola.util.EnhancedProperties) FormatStyle(java.time.format.FormatStyle) StyledConverter(uk.me.parabola.mkgmap.osmstyle.StyledConverter)

Aggregations

EnhancedProperties (uk.me.parabola.util.EnhancedProperties)7 FileNotFoundException (java.io.FileNotFoundException)2 FormatException (uk.me.parabola.imgfmt.FormatException)2 Style (uk.me.parabola.mkgmap.reader.osm.Style)2 File (java.io.File)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 FormatStyle (java.time.format.FormatStyle)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 SAXParser (javax.xml.parsers.SAXParser)1 SAXParserFactory (javax.xml.parsers.SAXParserFactory)1 SAXException (org.xml.sax.SAXException)1 Coord (uk.me.parabola.imgfmt.app.Coord)1 GeneralRouteRestriction (uk.me.parabola.imgfmt.app.net.GeneralRouteRestriction)1 MapCollector (uk.me.parabola.mkgmap.general.MapCollector)1 MapLine (uk.me.parabola.mkgmap.general.MapLine)1 MapPoint (uk.me.parabola.mkgmap.general.MapPoint)1 MapRoad (uk.me.parabola.mkgmap.general.MapRoad)1 MapShape (uk.me.parabola.mkgmap.general.MapShape)1