h-geo parsing tests

This page was design to test the parsing of h-geo. These tests are part of the micorformats 2 test suite.

Just a name (h-geo parsing test)

On my way to The Bricklayer's Arms (Geo: 51.513458;-0.14812)

The expected JSON output:


{
    "items": [{ 
        "type": ["h-geo"],
        "properties": {
            "name": ["51.513458;-0.14812"]
        }
    }]
}

Broken into properties (h-geo parsing test)

We are meeting at The Bricklayer's Arms (Geo: 51.513458: -0.14812)

The expected JSON output:


{
    "items": [{ 
        "type": ["h-geo"],
        "properties": {
            "name": ["The Bricklayer's Arms"],
            "latitude": ["51.513458"],
            "longitude": ["-0.14812"]
        }
    }]
}

Geo with a altitude property (h-geo parsing test)

My favourite hill in the lakes is Pen-y-ghent (Geo: 54.155278, -2.249722). It raises to 694m.

The expected JSON output:


{
    "items": [{ 
        "type": ["h-geo"],
        "properties": {
            "name": ["Pen-y-ghent"],
            "latitude": ["54.155278"],
            "longitude": ["-2.249722"],
            "altitude": ["694"]
        }
    }]
}

Value-title class pattern (h-geo parsing test)

N 51° 51.345, W -0° 14.812

The expected JSON output:


{
    "items": [{ 
        "type": ["h-geo"],
        "properties": {
            "latitude": ["51.513458"],
            "longitude": ["-0.14812"],
            "name": ["N 51° 51.345, W -0° 14.812"]
        }
    }]
}

The <abbr> tag pattern (h-geo parsing test)

The Bricklayer's Arms

The expected JSON output:


{
    "items": [{ 
        "type": ["h-geo"],
        "properties": {
            "latitude": ["51.513458"],
            "longitude": ["-0.14812"],
            "name": ["The Bricklayer's Arms"]
        }
    }]
}

The <abbr> Tag Pattern (h-geo parsing test)

N 37° 24.491, W 122° 08.313

The expected JSON output:


{
    "items": [{ 
        "type": ["h-geo"],
        "properties": {
            "latitude": ["37.408183"],
            "longitude": ["-122.13855"],
            "name": ["N 37° 24.491, W 122° 08.313"]
        }
    }]
}

Change log:

Contributors :