Skip to content

tools/wiki-place: Extract geocoordinates from Wikipedia article #26

@Amgine0

Description

@Amgine0

Most en.WP place articles include coordinates in a machine-readable format:

<span id="coordinates">
    <a href="/wiki/Geographic_coordinate_system" title="Geographic coordinate system">Coordinates</a>: <span class="plainlinks nourlexpansion"><a class="external text" href="//tools.wmflabs.org/geohack/geohack.php?pagename=%C3%98stfold&amp;params=59_20_00_N_11_20_00_E_source:itwiki_region:NO_type:adm1st">
        <span class="geo-default">
            <span class="geo-dms" title="Maps, aerial photos, and other data for this location">
                <span class="latitude">59°20′00″N</span> 
                <span class="longitude">11°20′00″E</span>
            </span>
        </span>
        <span class="geo-multi-punct"> / </span>
        <span class="geo-nondefault">
            <span class="geo-dec" title="Maps, aerial photos, and other data for this location">59.33333°N 11.33333°E</span>
            <span style="display:none"> / 
                <span class="geo">59.33333; 11.33333</span>
            </span>
        </span>
    </a>
</span>

These are added using the {{coord}} template if you are parsing the wikitax. In this example: {{coord|59|20|00|N|11|20|00|E|source:itwiki_region:NO_type:adm1st|display=title}} from https://en.wikipedia.org/wiki/%C3%98stfold

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions