Have questions? Stuck? Please check our FAQ for some common questions and answers.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

Maps are used as a background to place the devices in a topology in geographical locations.

Applications can create and inject maps into the topology view.

This tutorial will show you:

  • How and where to get map data
  • How to extract specfic data from the data set
  • Optimise the extracted data for improved performance
  • Adding the map to an ONOS Application

Creating a new map

First of all we need to download a data set. A good resource to get map data from is Natural Earth Data. For this tutorial we will be using 'Download without boundary lakes'.
Once the zip file has been downloaded extract it and open up terminal.

cd to directory
cd ~/Desktop/ne_10m_admin_0_countries_lakes

Extract Map Data

Next we need to get only the countries that we require for the map we're making. For this example we will create a map of South America.
To do this return to terminal and type:

ogr2ogr -f GeoJSON -where "CONTINENT=\"South America\"" south_america.json ne_10m_admin_0_countries_lakes.shp

If successful this will create a new file called south_america.json. This still needs to be a converted to a topojson file before we can add it to the ONOS Application.

Convert to a topojson file

To convert the newly created json file we need to run another command in terminal

topojson -o south_america.topojson --properties name=NAME -- south_america.json

If the map you're creating has a complex coastline it may need to be simplified to improve the performance in ONOS.
To do this we just need to run the above command with an added parameter.

topojson -o south_america.topojson --simplify-proportion 0.2 --properties name=NAME -- south_america.json

--simplify-proportion is a little bit trial and error in finding the perfect number.

 

  • No labels