TopoJSON

TopoJSON
Ontwerp en ontwikkeling
Ontwikkelaar(s) Michael (Mike) Bostock
Geschreven in JavaScript
Status en tijdlijn
Status Inactief
Recentste versie 3.0.2 (2 september 2017)[1] Bewerken op Wikidata
Onderdelen
Licentie(s) BSD
Links
Website (en) Projectpagina
Versiebeheer Broncode
Portaal  Portaalicoon   Informatica


TopoJSON is een bestandsformaat, console script en client-side JavaScript-bibliotheek voor het opslaan en verwerken van GIS data met georuimtelijke topologie. Het is geoptimaliseerd voor gebruik op het web, met nadruk op (minimaliseren van) bestandsgrootte en snelheid, en ontwikkeld door Mike Bostock.

Bestandsformaat

TopoJSON is een extensie van GeoJSON, dat weer een specifieke vorm is van het JSON bestandsformaat. Een belangrijk voordeel op GeoJSON is dat een TopoJSON bestand lijnen beschrijft als bogen, gemaakt van een serie punten, en vervolgens zowel complexe polylines als polygonen beschrijft als herhaling van deze (eerder gedefinieerde) bogen. Vormen zijn een herhaling van bogen, en bogen zijn een herhaling van punten: elke boog is maar een keer gedefinieerd, maar kan meerdere keren voorkomen, waardoor redundantie wordt verminderd, en de bestandsgrootte kleiner kan blijven.

Javascript-bibliotheek

De client-side JavaScript-bibliotheek converteert de TopoJSON bestanden naar GeoJSON waardoor andere systemen zoals D3.js deze GIS data kunnen gebruiken om SVG beelden te genereren.

Console script

Het console script maakt het mogelijk GIS bestanden (shapefiles, GeoJSON, etc.) te converteren naar lichtere TopoJSON bestanden, alsook andere basisverwerkingen zoals simplificatie, samenvoeging, toevoegen van externe data, et cetera.

Schema

Gegeven een GIS vorm vlak bij de coördinaten latitude 0⁰ en longitude 0⁰ kan een zeer beperkt, maar valide en compleet topojson bestand met alle metadata, Polygon, LineString, Point elementen, arcs en properties als volgt worden opgesteld:

Topojson vormen (Visualisatie en relevante onderdelen)
{
"type":"Topology", 
"transform":
    {
    "scale": [1,1], 
    "translate": [0,0]
    }, 
"objects": 
    { "two-squares": 
        { 
        "type": "GeometryCollection", 
        "geometries": 
            [ 
            {"type": "Polygon", "arcs":[[0,1]],"properties": {"name": "Left_Polygon" }},
            {"type": "Polygon", "arcs":[[2,-1]],"properties": {"name": "Right_Polygon" }}
            ]
        }
    },
    "one-line":
        {
        "type":"GeometryCollection",
        "geometries":
            [
            {"type": "LineString", "arcs": [3],"properties":{"name":"Under_LineString"}}
            ]
        },
    "two-places":
        {
        "type":"GeometryCollection",
        "geometries":
            [
            {"type":"Point","coordinates":[0,0],"properties":{"name":"Origine_Point"}},
            {"type":"Point","coordinates":[0,-2],"properties":{"name":"Under_Point"}}
            ]
        }
"arcs":
    [
    [[1,2],[0,-2]],
    [[1,0],[-1,0],[0,2],[1,0]],
    [[1,2],[1,0],[0,-2],[-1,0]],
    [[0,-1],[2,0]]
    ]
}

Zie ook

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.