Code Monkey home page Code Monkey logo

geojson-ld's Introduction

geojson-ld

Describing and extending GeoJSON with JSON-LD

JSON-LD is JSON for linking data and it's a web standard: http://www.w3.org/TR/json-ld/. It offers a path for upgrading existing GeoJSON data.

A JSON-LD context defines terms and other things and allows GeoJSON documents to be more specific about data, e.g, what "type" and "id" and the keys of "properties" mean to the rest of the web. Additionally, JSON-LD's "@type" and "@id" provide a means of integrating GeoJSON with other schemas.

This GeoJSON-LD project is focussed on publishing a vocabulary of GeoJSON terms and a base JSON-LD context for GeoJSON data, but also aims to help organizations develop good practices for upgrading GeoJSON data.

Example

Below is an example of using JSON-LD to declare that the features of a collection are also schema.org Places and that their "description" property is the same thing as a schema.org decription. Bringing optional namespaces to the "properties" grab bag is perhaps the best thing that JSON-LD can do for GeoJSON data. Note that http://example.com/vocab# is used as the @vocab URI until GeoJSON-LD is published.

{ 
  "@context": {
    "@vocab": "http://example.com/vocab#",
    "Place": "http://schema.org/Place",
    "name": "http://schema.org/name"
  },
  "type": "FeatureCollection",
  "@id": "http://example.com/collections/1",
  "features": [
    { 
      "type": "Feature",
      "@type": ["Feature", "Place"],
      "id": "1",
      "@id": "http://example.com/collections/1/features/1",
      "properties": {"name": "Fort Collins, Colorado" },
      "geometry": {"type": "Point", "coordinates": [-105.078056, 40.559167]}
    },
    { 
      "type": "Feature",
      "@type": ["Feature", "Place"],
      "id": "2",
      "@id": "http://example.com/collections/1/features/2",
      "properties": {"name": "Boulder, Colorado" },
      "geometry": {"type": "Point", "coordinates": [-105.251945, 40.027435]}
    }
  ]
}

Paste the JSON text above into a Gist like this and you'll see that it's ordinary GeoJSON as well as linked data.

Development

This is a work in progress. See https://github.com/geojson/geojson-ld/issues.

A demo vocabulary including the GeoJSON terms above is online at http://geojson.org/vocab.

geojson-ld's People

Contributors

adoyle avatar dret avatar jasnell avatar jyutzler avatar sfsheath avatar sgillies avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.