Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43789
    MartinP
    Participant

    Hello,

    I am trying to generate a very small regional map from scratch using your map transform and mapping xml files and the mapsforge-creator pipeline. This works very well but suddenly the sea around coastlines (blue color) has vanished.
    As soon as I remove the OpenAndroMaps transform and mapping files the sea is draw again correctly.

    My question is: Do you do some additional processing for the sea/coastline area?

    Best,

    #43793
    Avatar photoChristianK
    Keymaster

    OpenAndroMaps has a completly different mapping for the coastlines.
    We use Jochen Topfs Scripts to preprozess the coastlines right from the OSM Database to a shapefile for the whole planet.

    You can download these shapefiles right here, but you have to convert ’em to osm-files.
    https://osmdata.openstreetmap.de/

    Using native coastlines without preprozessing is always a risk cause usually there are numerous bugs with coastlines from mappers causing flooded areas on map.

    #43809
    MartinP
    Participant

    I tried a different method by using the coastline split but with the same result:

    
    # Land
    ogr2ogr -overwrite -progress -skipfailures -clipsrc $LEFT $BOTTOM $RIGHT $TOP "$WORK_PATH/land.shp" "$DATA_PATH/land-polygons-split-4326/land_polygons.shp"
    ogr2osm --id 22951459320 --positive-id --add-version --add-timestamp -f -o "$WORK_PATH/land.osm" "$WORK_PATH/land.shp"
    
    # Sea
    cp sea.osm "$WORK_PATH"
    sed -i "s/\$BOTTOM/$BOTTOM/g" "$WORK_PATH/sea.osm"
    sed -i "s/\$LEFT/$LEFT/g" "$WORK_PATH/sea.osm"
    sed -i "s/\$TOP/$TOP/g" "$WORK_PATH/sea.osm"
    sed -i "s/\$RIGHT/$RIGHT/g" "$WORK_PATH/sea.osm"
    
    # Sea (alternative method)
    : '
    ogr2ogr -overwrite -progress -skipfailures -clipsrc $LEFT $BOTTOM $RIGHT $TOP "$WORK_PATH/sea.shp" "$DATA_PATH/coastlines-split-4326/lines.shp"
    ogr2osm --id 2295145932000 --positive-id --add-version --add-timestamp  -f -o "$WORK_PATH/sea.osm" "$WORK_PATH/sea.shp"
    '
    
    # Merge
    CMD="$OSMOSIS_HOME/bin/osmosis --rb file=$WORK_PATH/$NAME.pbf \
                                   --rx file=$WORK_PATH/sea.osm --s --m"
    for f in $WORK_PATH/land*.osm; do
     CMD="$CMD --rx file=$f --s --m"
    done
    CMD="$CMD --wb file=$WORK_PATH/merge.pbf omitmetadata=true"
    echo $CMD
    $CMD
    
    # Map
    if [ "$SKIP_MAP_CREATION" != "true" ]; then
      CMD="$OSMOSIS_HOME/bin/osmosis --rb file=$WORK_PATH/merge.pbf"
      [ $MAP_TRANSFORM_FILE ] && CMD="$CMD --tt file=$MAP_TRANSFORM_FILE"
      CMD="$CMD --mw file=$WORK_PATH/$NAME.map \
                     type=$3 \
                     bbox=$BOTTOM,$LEFT,$TOP,$RIGHT \
                     map-start-position=$LAT,$LON \
                     map-start-zoom=8 \
                     tag-values=$TAG_VALUES \
                     threads=$THREADS \
                     progress-logs=$PROGRESS_LOGS"
      [ $PREFERRED_LANGUAGES ] && CMD="$CMD preferred-languages=$PREFERRED_LANGUAGES"
      [ $MAP_TAG_CONF_FILE ] && CMD="$CMD tag-conf-file=$MAP_TAG_CONF_FILE"
      echo $CMD
      $CMD || exit 1

    `

    #43832
    MartinP
    Participant

    Problem solved. There was some bug with the ogr2osm command.

    1 user thanked author for this post.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.