Talk:Google Summer of Code/2012/Data Tile Service

From OpenStreetMap Wiki
Jump to navigation Jump to search

TileFormat

GeoJson is not compatible with OSM. If you convert OSM XML Format to GeoJSON you lose information.

First of all you lose the node id. The file format is not use able for an osm editor. Second you lose the information if a there are 2 nodes at the same place or if it is the SAME node.

In many cases this is no problem, but maybe you should think about a more independent format that allows to reconstruct all informations. In a second step (server or client) it is still possible to create the geojson.


Possible Format

{
n:[
{id:12341,c:[48.212,15.342],t:{highway:trafficlight,}}
{id:12342,c:[48.212,15.342],t:{natural:tree}}
{id:12343,c:[48.212,15.342]}
]
w:[
{id:222:c[12341,12342,12343]:t:{highway:primary,oneway:yes}
]
}

Formatted:

{
    n: [
        {
            id: 12341,
            c: [
                48.212,
                15.342
            ],
            t: {
                highway: trafficlight,
                
            }
        }{
            id: 12342,
            c: [
                48.212,
                15.342
            ],
            t: {
                natural: tree
            }
        }{
            id: 12343,
            c: [
                48.212,
                15.342
            ]
        }
    ]w: [
        {
            id: 222: c[
                12341,
                12342,
                12343
            ]: t: {
                highway: primary,
                oneway: yes
            }
        ]
    }


--Robotnic 08:34, 23 May 2012 (BST)