User:Contrapunctus

From OpenStreetMap Wiki
Jump to navigation Jump to search

Your friendly neighborhood mapper in Delhi :)

I'd greatly appreciate any financial support for my mapping efforts - help me pay my bills!

OSM Logo This user submits data to OpenStreetMap under the name
contrapunctus.
Babel user information
en-4 This user has near native speaker knowledge of English.
hi-N इस सदस्य को हिन्दी का मातृभाषा के समान ज्ञान है।
de-2 Dieser Benutzer beherrscht Deutsch auf fortgeschrittenem Niveau.
Users by language
Android logo 2019 (stacked).svg Contrapunctus uses an Android-based mobile device.
Vespucci logo Contrapunctus submits data to OpenStreetMap using Vespucci.
JOSM Contrapunctus submits data to OpenStreetMap using JOSM.
Every Door Contrapunctus submits data to OpenStreetMap using Every Door.
OsmAnd icon Contrapunctus uses OsmAnd, mobile map viewing & navigation app.
Organic Maps Contrapunctus uses Organic Maps

PT

Disclaimer - I have only mapped buses in Delhi, India, and have very little experience

1. in mapping other forms of transport e.g. Metro, trains, or trams

2. with public transport in other countries.

After trying many times to make sense of Proposed_features/Refined_Public_Transport, here's what I think would be some nice simplifications to the PTv2 schema -

1. Deprecate stop positions

2. Platforms are where people wait and where PSVs stop (public_transport=platform + bus=yes/train=yes/etc + bench, shelter, tactile_paving etc. If there is no infrastructure, the last three tags make that abundantly clear.)

  • It goes without saying that these are all never on a track or road, and always beside it.
  • This is how PTv2 already functions, but it seems not everyone understands it correctly.

3. stop_area relations should be made when a single stop (on one side of the road) has >1 platforms (e.g. https://www.openstreetmap.org/#map=17/28.53813/77.23235 ). In route relations, stop_area relations should be used in lieu of the platforms. The name=* and any other tags with identical values should be moved from the platforms to the stop_area relation.

  • I don't know if routers can reliably group together such platforms into one stop area themselves - if they can, there is no need for a stop_area relation. It does reduce tag duplication, though.

Problems this doesn't (yet) solve

1. Railways and Metro trains. They have name=* on stations, not platforms (those have a ref=*). On trains, the platform is subject to change, so you want the station and not the platform to go in the route relation. Maybe add stations to railway route relations, instead of platforms?

  • It would also be helpful to allow stations in bus routes, because buses often terminate there and there is no definite platform for them, either.

Scripts for geo: URIs

I hope these are useful to whoever finds them :)

coord2geo

#!/bin/bash

# Tests
# coord2geo "28.5484586, 77.2566089"
# coord2geo "-24.09498, -48.36436"

if [[ $# == 0 ]]; then
    read -t 1 coordinates
else
    coordinates="$1"
fi

if [[ "$coordinates" == "" ]]; then
    printf "Usage: coord2geo [COORDINATES]\n\n"
    printf "Makes a geo: link from COORDINATES, where COORDINATES is
\"<latitude>, <longitude>\"\n\n"
    printf "If COORDINATES is omitted, stdin is used instead.\n\n"
else
    lat="$(echo $coordinates | sed -n "s|\(.*\),.*|\1|p")"
    lon="$(echo $coordinates | sed -n "s|.*, \(.*\)|\1|p")"
    # printf "lat - $lat\nlon - $lon\n"
    printf "geo:$lat,$lon\n"
fi

geo2osm

#!/bin/bash

# Test
# geo2osm "geo:-24.09498,-48.36436?z=19"

if [[ $# == 0 ]]; then
    read -t 1 link
else
    link="$1"
fi

if [[ "$link" == "" ]]; then
    printf "Usage: geo2osm [GEO]\n\n"
    printf "Makes an osm.org link from GEO, where GEO is a geo:
URI.\n\n"
    printf "If GEO is omitted, stdin is used instead.\n\n"
else
    lat="$(echo "$link" | sed -En "s|geo:([0-9\.-]*),.*|\1|p")"
    lon="$(echo "$link" | sed -En "s|geo:.*,([0-9\.-]*).*|\1|p")"
    zoom="$(echo "$link" | sed -En "s|.*\?z=([0-9]*)|\1|p")"

    # test printf -
    # printf "lat $lat\nlon $lon\nzoom $zoom\n"

    if [[ "$zoom" == "" ]]; then
        # doesn't need a zoom value, adds a nice pointer
        printf "https://www.openstreetmap.org/?mlat=$lat&mlon=$lon\n"
    else
        printf "https://openstreetmap.org/#map=$zoom/$lat/$lon/\n"
    fi
fi

geo2osm-browse

 #!/bin/bash

 if [[ $# == 0 ]]; then
     read -t 1 link
 else
     link="$1"
 fi
 xdg-open "$(geo2osm $link)"

Having geo: URIs open on osm.org in your browser

Save the geo2osm and geo2osm-browse scripts in files of the same name in ~/bin/

Make them executable.

cd ~/bin/
chmod u+x geo2osm geo2osm-browse

Open ~/.local/share/applications/mimeapps.list in a text editor and add the following line.

x-scheme-handler/geo=geo.desktop

In the same directory, create a file called geo.desktop containing the following.

[Desktop Entry]
Version=1.0
Type=Application
Exec=/home/YOUR-USERNAME-HERE/bin/geo2osm-browse %u
Icon=geo2osm-browse
StartupNotify=true
Terminal=false
Categories=Utility;
MimeType=x-scheme-handler/geo
Name=Geo: Launcher
Comment=Open geo: links on osm.org

Voila! xdg-open should now open geo: URIs on osm.org in your preferred browser! :D