Code Monkey home page Code Monkey logo

basic-borders's Introduction

Red Cross Basic Borders Database

Overview

Sometimes you just need a country border to put on a simple leaflet map. The Basic Borders Database supplies the simplified geometry for a given country. The geometry is based on Natural Earth with manipulation and simplification by Red Cross International Services.

Service Endpoint

There are currently is only one endpoint for all services http://webviz.redcross.org/basicborders/.

The service returns a either a JSON or JSONP object by requesting either the 3 digit ISO 3166-1 code or the Country Name.

Parameters

  • qtype (string): Options are 'iso' or 'name'. Where 'iso' is the three digit ISO 3166-1 code. 'iso' is the default
  • geom (string): The amount of simplification needed where high is the most simplified. Returning orginal geometry can be slow depending on the size of the geometry. Options are 'high', 'med', or 'orginal'. The default is 'high'.
  • year (integer): Returns the borders for the given year. Default is current year. Note this feature is not yet implemented.
  • callback (string): If present response will be in JSONP format.

Sample Post:

var postArgs = {
  qtype: "name",
  geom: "high",
  year: "2013"
};

var url = 'http://webviz.redcross.org/basicborders/';

//Send POST, using JSONP
$.getJSON(url + "?callback=?", postArgs).done(function (data) {
  handleNameSearchResponse(data);
}).fail(function (jqxhr, textStatus, error) {
  var err = textStatus + ', ' + error;
  console.log("Request Failed: " + err);
});

The service can also return a world file by using 'world' as your query. http://webviz.redcross.org/basicborders/world?callback=callback

Simple Sample GET Request: http://webviz.redcross.org/basicborders/VAT?callback=callback

Sample Response:

callback && callback({
   "type":"FeatureCollection",
   "features":[
      {
         "type":"Feature",
         "properties":{
            "name":"Vatican",
            "year":2013,
            "adm0_a3":"VAT"
         },
         "geometry":{
            "type":"Polygon",
            "coordinates":[
               [
                  [
                     12.453125,
                     41.9028930664062
                  ],
                  [
                     12.453125,
                     41.9039306640625
                  ],
                  [
                     12.4541015625,
                     41.9039306640625
                  ],
                  [
                     12.4541015625,
                     41.9028930664062
                  ],
                  [
                     12.453125,
                     41.9028930664062
                  ]
               ]
            ]
         }
      }
   ]
});

Disclaimer

The Basic Borders Database is not an inclusive list of all world countries. The inclusion, exclusion, or geometry of a country does not imply the expression of any opinion on the part of the American Red Cross concerning the legal status of a territory or of its authorities.

basic-borders's People

Stargazers

Mark McDonnell avatar Andris Kardos avatar

Watchers

James Cloos avatar Robert Banick avatar Dale Kunce avatar  avatar

basic-borders's Issues

Incorrect geo JSON

The result of the service has the geometry contained within the properties object instead or as a sibling to the properties object.

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.