Posted on

Adding radio coverage to LeafletJS or Openlayers

Leaflet ImageLayer demo

LeafletJS (32k stars on Github) and it’s predecessor Openlayers (8k stars) are very popular web mapping libraries in use with companies and organisations the world over. They provide powerful, fast and easy client side 2D maps written in Javascript which can show almost any type of data…

Whilst typically used on public facing web maps with public tile servers like OpenStreetMap, the libraries are versatile enough to be used on private networks with private WMS or TMS tile servers.

Adding the CloudRF API is made possible through our open standards such as JSON, PNG, EPSG:3857, EPSG:4326 and HTTP. In this post we show two new examples for integrating the Area API.

LeafletJS Area API integration

The workflow for Leaflet is as follows:

  • Fetch the selected location, in this case a cursor click and transform to EPSG:4326 co-ordinates (Latitude, Longitude)
function onMapClick(e) {
    addRFLayer(e.latlng.lat,e.latlng.lng);
}
map.on('click', onMapClick);
  • Take a pre-built JSON object containing a complete request representing “a radio”. Replace the transmitter lat and lon fields with our latitude and longitude.
  • Send the full request as a HTTP POST along with an API key in the header to https://api.cloudrf.com/area
  var xhr = new XMLHttpRequest();
  xhr.withCredentials = false;
  xhr.addEventListener("readystatechange", function() {
    if(this.readyState === 4) {
      AddLayerToMap(this.responseText);
    }
  });
  xhr.open("POST", "https://api.cloudrf.com/area");
  xhr.setRequestHeader("key", key);
  xhr.send(request);
  • When the response returns, parse the JSON to extract the PNG_Mercator URL and bounds array.
  • Using Leaflet’s imageOverlay method, place the image upon the map, tweaking the opacity to 50% in the process, with the bounds rearranged in [SOUTH, WEST], [NORTH, WEST] order.
var bounds = json.bounds; // CloudRF uses NORTH,EAST,SOUTH,WEST
var  imageBounds = [[bounds[2], bounds[3]], [bounds[0], bounds[1]]];
L.imageOverlay(json.PNG_Mercator, imageBounds).setOpacity(0.5).addTo(map);

Openlayers Area API integration

The workflow for Openlayers is as follows:

  • Fetch the selected location, in this case a cursor click and transform to EPSG:4326 co-ordinates (Latitude, Longitude)
map.on('click', function(evt){
  var pt = ol.proj.transform(evt.coordinate, 'EPSG:3857', 'EPSG:4326');
  addRFLayer(pt[1],pt[0]);
});

  • Take a pre-built JSON object containing a complete request representing “a radio”. Replace the transmitter lat and lon fields with our latitude and longitude.
  • Send the full request as a HTTP POST along with an API key in the header to https://api.cloudrf.com/area
  •   var xhr = new XMLHttpRequest();
      xhr.withCredentials = false;
      xhr.addEventListener("readystatechange", function() {
        if(this.readyState === 4) {
          AddLayerToMap(this.responseText);
        }
      });
      xhr.open("POST", "https://api.cloudrf.com/area");
      xhr.setRequestHeader("key", key);
      xhr.send(request);

  • When the response returns, parse the JSON to extract the PNG_Mercator URL and bounds array.
  • Using openlayers’ Image method, place the image upon the map, tweaking the opacity to 50% in the process, with the bounds rearranged in [WEST,SOUTH,EAST,NORTH] order.
  • var imageLayer = new ol.layer.Image({
    opacity: 0.5,
    source: new ol.source.ImageStatic({
    url: json.PNG_Mercator,
    projection: map.getView().getProjection(),
    imageExtent: ol.proj.transformExtent(boundsWSEN, 'EPSG:4326', 'EPSG:3857')
    })
    });
    map.addLayer(imageLayer);

    Source code

    Get examples for both slippy maps at https://github.com/Cloud-RF/CloudRF-API-clients

    API reference

    API documentation and examples are at https://docs.cloudrf.com

    A Swagger OpenAPI3.0 specification is at https://cloudrf.com/documentation/developer/swagger-ui/

    Other uses

    Beyond heatmaps here are a few suggestions:

    1. Draw a polyline to simulate a link with the /path API
    2. Draw a freehand route to test a route with the /points API
    3. Draw a sectorial antenna as a polygon with an azimuth and beamwidth and send to the /area API
    4. Use the Trilateration colour schema to model a detected signal or a distant handset with the /area API
    Posted on

    Mapping mesh networks

    Mesh network

    Mobile ad-hoc networks (MANET) are an increasingly popular architecture in emergency services and Defence communications. Unlike classic repeater based networks, MANET radio network communications do not have fixed infrastructure so must form self-healing, self-routing networks.

    MANET radio modules are well suited to working either off-grid away in remote areas or for providing resilience and independence in well served cities which may be suffering from power and/or network failure.

    The bandwidth requirements and throughput of MANET networks varies substantially by waveform. Some are designed for range, others maximum throughput. For this reason, manufacturers offer a range of frequency modules.

    Why RF planning tools don’t get used for emergency networks

    RF planning software has evolved substantially in the 30 years it’s been used to build out fixed infrastructure networks. Time sensitive customers such as the emergency services have a difficult relationship with these tools. They need them, and often buy them, but don’t have the time to use them to their full capabilities. As a result they rarely get used on anything except training and exercises. Even then the numbers of staff directly interfacing with them will be very small, even in very large organisations of radio users.

    The focus for most RF tools is planning with static sites. Whether that’s clicking on a map or uploading a spreadsheet of hundreds of locations it’s still static. MANET requires dynamic inputs and continuous computation which is where APIs come to the fore…

    An API for MANET

    Cloud-RF’s latest API has a function designed for ad-hoc networks called ‘points’. The points API functions like a point-to-point profile in terms of it’s input and output except it accepts an array of transmitters. This means you can test 10,50 or 500 transmitter nodes back to a single receiver in a single API call. It’s also fast as you’d expect and can model a link every millisecond so the 870 distinct links demonstrated in the video were processed in under a second, every second.

    For more information on the points API see our documentation here: https://docs.cloudrf.com

    Radio mapping planning

    In this video, we demonstrate the Cloud-RF points API to model a MANET network (Mobile Ad-hoc Network). For this demo 30 nodes were moved around a 16km track covering a variety of terrain. Each node was tested against 29 siblings for a total of 870 links per second.


    Coloured links denote good (green) average (amber) and poor (red) links between the nodes and map to 5dB, 10dB and 20dB signal-to-noise ratios. Only links exceeding 5dB SNR are shown or it looks like a bad game of kerplunk!

    The radio settings used were L band (1-2GHz) with only 1 watt of power. This conservative start setting was chosen to show a dynamic range of links. Later in the video the template is switched at the database to demonstrate the impact or gain of using different bands such as 2.4GHz and 500MHz.

    Integrating your data

    The demo video used mock data and an unpublished script to present the results as a KML. The source of the data is irrelevant so long as it’s accurate and time sensitive. This could be a radio vendor’s dashboard or database. Many of the leading vendors such as DTC, Harris, Persistent Systems, Silvus and Trellisware have location aware GPS modules and software interfaces to display reported radio positions.

    The required format for a point is WGS84 decimal degrees. The height is taken from the template which is defined within the body of the points request. The new APIv2 makes defining a template easy as a JSON object so you can have a local archive of template .json files.

    A suggested workflow for API integration for dynamic points is as follows:

    1. Fetch a list of all radio locations as decimal degrees
    2. Choose a template as a JSON object
    3. Make an API request using the data and a client script to https://api.cloudrf.com/points
    4. Parse the JSON response to extract the results for each node
    5. Put the results on a map as lines
    6. Style the lines based upon your own local rules for your equipment, QoS and waveform eg. < 5dB is red

    Download example client scripts from our Github site: https://github.com/Cloud-RF/CloudRF-API-clients

    For assistance with integration and hosting options email support@cloudrf.com

    Autonomous vehicles

    Where this points API will really add value is in mapping and assisting autonomous vehicles who are invariably fitted with MANET radio modules. Whether it’s a drone or a UGV, this API can be used to rapidly exercise multiple routes to help make better decisions.

    Posted on

    RF penetration demonstration

    During infantry training, soldiers are shown firsthand the impact of different weapons upon different materials to help them make better decisions about good cover versus bad cover. Spoiler: The railway sleeper doesn’t make it 🙁

    As tactical radios have moved several hundred megahertz up the spectrum from their cold-war VHF roots, material attenuation is a serious issue which needs demonstrating to enable better route selection and siting. Unlike shooting at building materials it’s hard to visualise invisible radio signals, and therefore teach good siting, but equally important as ground based above-VHF signals are easily blocked in urban environments.

    This blog provides a visual demonstration of the physical relationship between different wavelengths and attenuating obstacles only. It does not compare modulation schemas, multi-path, radios or technologies.

    Bricks and wavelengths

    Clutter data refers to obstacles above the ground such as trees and buildings. Cloud-RF has 9 classes of clutter data within the service which you can use and build with. Each class (Bricks +) has a different attenuation rate measured in decibels per metre (dB/m). This rate is a nominal value based upon the material density and derived from the ITU-R P.833-7 standard and empirical testing with broadcast signals in European homes.

    A signal can only endure a limited amount of attenuation before it is lost into the noise floor. In free space attenuation is minimal but with obstacles it can be substantial. This is why a Wi-Fi router in a window can be hard to use within another room in the house but the same router is detectable from a hill a mile away.

    The attenuation rate is an average based upon a hollow building with solid walls.

    Common building materials attenuate signals to different amounts based on their density and the signals wavelength.

    A higher wavelength signal such as L band (1-2GHz) will be attenuated more than VHF (30-300MHz) for example.

    A long wavelength signal like HF will suffer minimal attenuation making it better suited to communicating through multiple brick walls.

    The layer cake house

    A brick house is not just brick. It’s bricks, concrete blocks, glass, insulation, stud walls, furniture and surfaces of varying absorption and reflection characteristics. Modelling every building material and multi-path precisely, is possible, given enough data and time due to the exponential complexity of multi-path but wholly impractical.

    A trade-off for accurate urban modelling is to assign a local attenuation value. It’s local since building regulations vary by country and era so a 1930s brick house in the UK has different characteristics to a 1960s timber house in Germany. Taking the brick house we can identify the nominal value by adding up the materials and dividing it by the size.

    For example, 2 x solid 10dB brick walls plus a 5 dB margin for interior walls and furniture would be 25dB. Divide this by a 10m size and you have 2.5dB/m. Using some local empirical testing you can quickly refine this for useful value for an entire city (assuming consistent architecture) but in reality the *precise* value will vary by each property, even on a street of the same design, due to interior layouts and furniture.

    Range setup

    We created nine 4 metre tall targets using each of the 9 clutter classes in attenuation order from left-to-right, measuring 10x10m and fired radio-bulletsTM at them from a distance of 300m using the same RF power of 1W.

    The following bands were compared: HF 20MHz, VHF 70MHz, UHF 700MHz, UHF 1200MHz, UHF 2.4GHz. SHF 5.8GHz.

    The ITU-R P.525 model was used to provide a consistent reference.

    Only the stronger direct-ray is modelled. Multipath effects mean that reflections will reach into some of the displayed null zones, with an inherent reflection loss for each bounce, but these are nearly impossible to model accurately and in a practical time.

    Here are the results.

    HF 20MHz

    VHF 70MHz

    UHF 700MHz

    UHF 1200MHz

    UHF 2.4GHz

    SHF 5.8GHz

    Findings

    • Dense materials, especially concrete, attenuates higher frequency signals more than natural materials like trees
    • Lower UHF signals perform much better than SHF with the same power
    • Higher frequencies with low power can be blocked by a single house, even after only 300m
    • HF eats bricks for breakfast!

    Summary

    Modern tactical UHF radios, and their software eco-systems, are unrecognisable from their cold-war VHF ‘voice only’ ancestors in terms of capabilities but have an Achilles heel in the form of material penetration. To get the best coverage the network density must be flexed to match the neighbourhood.

    This is obvious when comparing rolling terrain with a urban environment but the building materials and street sizes in the urban environment will make a significant difference too. Ground units which communicated effectively in a city in one country may find the same tactics and working ranges ineffective in another city with the same radios and settings. Understanding the impact of material penetration will help planning and communication.

    Posted on

    Crunch a spreadsheet on Windows

    Windows CSV

    Using the CloudRF API 2.0, you can process an entire spreadsheet of site data in one go to make a complete network coverage map. This tutorial assumes you are a Windows user with minimal programming experience. It uses the free scripts available to download as a ZIP from

    https://github.com/Cloud-RF/CloudRF-API-clients

    Power users can use the Python clients to integrate into their back-end system(s) for a light but powerful upgrade to your workflows. Trust us when we say our 32C servers are more powerful than yours!

    1. Prepare your data

    Your data needs to be in a basic comma separated CSV spreadsheet (known as MS-DOS CSV format in Microsoft Excel). The top row should be column headers defined at https://docs.cloudrf.com but can be whatever names you like so long as they map to the JSON request template.

    You can find example CSV files called ‘area.csv’ and ‘path.csv’ in the examples or download them from here:

    Sites template

    The CSV file is used for variables like location.

    https://github.com/Cloud-RF/CloudRF-API-clients/blob/master/Windows/3sites.csv

    Hardware/request template

    The JSON file used for fixed values like power. Note it has placeholders which map to variables in the CSV…

    https://github.com/Cloud-RF/CloudRF-API-clients/blob/master/Windows/drone.json

    2. Setup your configuration file

    Open a console in the ‘windows’ folder (Shift right click to open the power menu) in the folder you unzipped and run area.exe with no arguments. This will create a blank ‘cloudrf.ini’ file. Edit this file in a text editor so it contains your credentials and a destination folder for files, relative to your location:

    [user]
    key = 101-IBIZA.DEMO.KEY
    
    [api]
    strict_ssl = True
    base_url = https://api.cloudrf.com
    
    [data]
    dir = data
    
    

    3. Process your data

    Open a console in the ‘windows’ folder in the folder with the .exe files. Call the program followed by the CSV file and an output format eg. KMZ.

    area.exe -i 3sites.csv -t drone.json
    

    Or for the Path Profile API with PNG chart images…

    path.exe -i link.csv -t drone.json

    If your data is well formatted, you will see results appear in your terminal for each row. Any errors will report the offending line from the JSON which normally means a missing or misspelled column name in the CSV.

    points.exe -i route.csv -t drone.json

    Use your results

    Everything you do is stored on the server. The demo script also pulls down a KMZ file for each calculation but if you want to see your finished result, login to the web interface at https://cloudrf.com/ui and open your archive. You will find your spreadsheet has become a coverage map! You can use the data either in the web interface, download it from there as a KMZ, SHP or TIFF file. If you want to publish or share the data you can get a URL or HTML embed code to host the layer on your own website.

    Create a super layer

    You can merge all your sites into one layer for convenience with the ‘mesh’ API.

    Create a super layer by visiting this URL in any browser with your UID and network name. The layer can be named whatever you like but will belong to the ‘mesh’ network group within you archive. If you have lots of large sites this can take a minute a site so be patient and check your archive later.

    https://api.cloudrf.com/mesh?uid={your UID}&network={your network}&name={superlayer}

    Change and repeat

    Once you’ve got your result its quite common to wonder what effect a different parameter might have. To change a value for all columns, change it for the first row eg. set txw (Transmitter power in Watts) to 2 then copy that value into all the rows below. Save the CSV file and reprocess with the command as before. You will need a new network name (net) to keep your new files separate. In your web archive you can then go and select the network with the old parameters and delete it by checking the box and clicking the trash can icon.

    Alternative languages / scripts

    The simple API can be used with any other language. You can find examples of Javascript forms from the API clients downloaded in the example above and more languages over at https://api.cloudrf.com. Expert users don’t even need a desktop as you can use CURL from a shell environment:

    Posted on

    Exporting to QGIS with SHP

    Exporting your data to a GIS platform such as ESRI Arcmap or QGIS allows you to tightly integrate RF coverage layers with other business intelligence such as customer locations.
    The TIFF and SHP export formats offered by the expert plan will let you open the layers in a GIS platform. For maximum control over styling you can choose a greyscale colour key called ‘Greyscale GIS’ within the interface or API (col=9) which has a different numeric value for each dB level. This high level of granularity means you can style your shape file to the nearest dB.

    Styling CloudRF shape files in QGIS 2.18

    1. Create your coverage layer using the greyscale GIS colour schema.
    2. Download the layer as an ESRI shape file (SHP) and open in QGIS
    3. Right click the layer and open its properties, then ‘style’
    4. Change the type to ‘Graduated’ then pick a colour schema or define your own
    5. Click classify to load in the dB/dBm values. Note that a negative -60dB value will be (+)60 due to the way the levels are represented as positive grey pixel values.
    Posted on

    GIS platforms

    Through the use of popular raster and vector overlay standards (GTIFF, SHP, KMZ) CloudRF supports most popular GIS platforms.

    Downloaded GIS layers are available in projections EPSG 4326 (WGS-84) or EPSG 3857 (Web mercator).

    Features

    A comprehensive list of the system’s features and capabilities is here.

    Google earth (KMZ)

    Cloud-RF has a unique interactive layer for Google earth called ‘Keyhole Radio’. This allows you to perform planning direct from within the platform without the need for a web browser. Get all your data layers together on one map.

    QGIS

    CloudRF exports to GTIFF and SHP formats both of which are compatible with the popular open source QGIS platform.

    Mapinfo

    CloudRF exports to GTIFF and SHP formats both of which are compatible with the popular Mapinfo platform.

    ESRI ArcGIS

    CloudRF exports to GTIFF and SHP formats both of which are compatible with the popular ESRI Arc family of GIS platforms.