Skip to Content

In this blog, I wanted to analyze significant earthquakes from 2150 BC to present. Data is downloaded from data.gov. This dataset is important because of including latitude and longtitude information of earthquakes. Latitude and longtitude information will be used on google maps in order to visualize exact geo location of earthquakes. We will start with cleaning data and end with identifying a fault line.

1. Cleaning Data

Since the data is starting from 2150 BC, it is a little bit dirty. After visually discovering data, it can be clearly seen that, a lot of earthquakes doesn’t have magnitude information. Gray squares at below images shows years with no magnitude information. Since there were no measurement technology in the past, this is normal. The strange part is, there is an earthquake in 1580 with a magnitude of 6.2, I wonder how this earthquake has been measured in 1580.

/wp-content/uploads/2014/12/2014_12_04_114915_601115.png

Anyway, I filtered non-empty magnitudes and got all the earthquakes with a magnitude information. It seems that 2007 was not a good year for world.

/wp-content/uploads/2014/12/2014_12_04_121301_601116.png


2. Heatmap Extension

Next step is to visualize these earthquakes on a map. For this purpose, I developed an extension using Google Maps Javascript API.

/wp-content/uploads/2014/12/2014_12_04_150403_601117.png

Most challenging part of developing this extension is loading Google API into Lumira. Since we cannot modify html document directly, we have to insert js into HTML document via render.js file. This can be achieved either via requirejs or appending script into HTML like below. Important point is Google API js file must be edited as well. For this reason, I am using a modified version of script file, instead of URL.

/wp-content/uploads/2014/12/2014_12_04_150520_601133.png

We end up with a heatmap, that shows most dangereous parts of World in terms of earthquakes.

/wp-content/uploads/2014/12/2014_12_04_143258_601134.png

3. To Move or Not To Move to California

Now we can analyse different parts of world in a more detailed fashion. I wanted to drill down into California. Map dynamically resizes and focuses according to selected region. Below picture shows a very nice snapshot of dangerous parts of California. If you are willing to relocate to CA, you have to think about it twice, at least you can select somewhere far from ocean.

/wp-content/uploads/2014/12/2014_12_04_144225_601135.png

It can bee seen that big earthquakes in California are around a line that is paralel to ocean. I thought there may be a fault line around here and guess what, there is really one and named San Adreas Fault.

/wp-content/uploads/2014/12/san_andreas_fault_map_380_601148.jpgImage Source: http://geology.com

Lumira has already ESRI integration, however having possibility to create your own map extension using different services makes analyzing data very powerful.

Update: VizPacker and Extension Files

Important Note: Extension requires internet connection in order to load Google Maps.

To report this post you need to login first.

28 Comments

You must be Logged on to comment or reply to a post.

  1. Daniel Davis

    Great piece of work – My only concern about all of these is the amazing amount of examples where we have extended Lumira – sounds great but the other side of the coin is just that…

    Look what you can’t do with Lumira out the box… there is still SO MUCH that the product needs to do without 3rd parties extending the product. We (SAP) should be doing this ourselves in the out the box product.

    (0) 
    1. Mustafa Aydogdu Post author

      I agree with you Daniel. Most of the extensions must be provided out of the box.

      I believe, as Lumira developed, more extensions will be part of the product.

      (0) 
  2. Ty Miller

    There’s a balance between what should be in Lumira and what should be easily available to Lumira. We are doing two things to achieve this balance:

    1. A marketplace where partner created extensions can be published and then directly downloaded to Lumira from within Lumira like you do with apps on your smart phone
    2. A global repository where optional SAP developed extensions are available for download from within Lumira. Example: DAE for BW. Most SAP BI customers don’t have BW in their landscape and they don’t need a driver for it so we shouldn’t make it a default part of the product
    (0) 
    1. Mustafa Aydogdu Post author

      I recognized that a couple of my extensions are not working on 1.23.

      There are some changes on extension side of 1.23. I am trying to figure it out.

      I will update the extension as soon as I fix it.

      (0) 
  3. Daniel Davis

    With the 1.23 release there seems to be many things that we perhaps should be told BEFORE the product auto-updates. Many extensions have simply stopped working… Now I have a new dialog when saving old LUMS files that they are now saved in a NEW FILE FORMAT…

    that’s just pre-school 101 – The Lumira.ini  file get re-written every time and does not keep a copy of the old one – poor design, the file formats chance and we only find out AFTER the product installs, I have virtual machines that I do not want to update but can no longer send LUMS files to customer and prospects as they no longer open in a version that was only installed a month ago.

    We keep telling our customers about the extendibility of Lumira (something my customers tell me is just not ideal as competitors have it in the product out the box) and to cap it all the things they then extend stop working.

    It feels a little underdone – don’t get me wrong I do love Lumira but please don’t just ‘do it’ but ‘do it right’ please.

    </RantOver>

    Daniel

    (0) 
  4. Robert Russell

    Hi Mustafa,

    I managed to get the extension working (on my copy of Lumira 1.23).

    After trying my own extensions with some headaches with 1.23 I found if I set the parameters I mention in my comment to Julien’s Google Maps extension

    SAP Lumira Extension: Google Maps

    Also for both extensions I moved the data definition (fdata slice call in this case) before the require.js call and it was more stable for me changing the data.

    So for your heatmap extension I adapted the code as follows. Not sure how this will show in this Jive editor but here it is……

       

    var fdata = data.slice()  

       

    mapDiv = container;

          //load google maps api if it wasnt loaded before.

      //requirejs and async plugin is used in order to load google maps api asynchronously
      //you can check async plugin’s developer blog for more information.
      //http://blog.millermedeiros.com/requirejs-2-0-delayed-module-evaluation-and-google-maps/
       require.config({
       paths: {
       async: ‘../sap/bi/bundles/sap/viz/ext/googlemapsheatmap/async’ //If you are deploying extension for Lumira, aysn.js file must be somewhere  that lumira can access.
       //async: ‘C:/LumiraFiles/async’ //If you are working with vizPacker, locate your async.js file to location that vizpacker can access.
       }
       }); 
       require([‘async!https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=visualization‘],
       function ( ) {
       initializeHeatMap();
       });

    I’d be interested if changing the parameters and changing the code works for anyone else.

    Cheers

    Robert

    heatmap.PNG

    (0) 
    1. Mustafa Aydogdu Post author

      Hi Robert,

      I changed parameters as below, and code as you stated, however extension still doesnt work on my pc.

      -Dhilo.cef.frame.debug=true

      -Dhilo.cef.cache.enabled=false

      I have another extension using requirejs, that is also not working.

      (0) 
  5. Mustafa Aydogdu Post author

    I updated extension to work on Lumira 1.25. Now it is working on 1.25 without any problem on my pc. I hope it works for everybody.

    You can download new version from above links.

    (0) 
  6. Daniel Davis

    Mustafa,

    Great example but I cannot get mine working on 1.25 – I point to the ZIP, add it, restart… load the CSV, create visualisation with Mag, Long and Lat – ALL WHITE screen, any ideas?

    Thanks and Regards

    Daniel

    (0) 
      1. Daniel Davis

        I’m at home so not on either of the SAP networks.

        /wp-content/uploads/2015/05/e2_699795.jpg

        Can you send a direct link for the zip file so I can try again?

        /wp-content/uploads/2015/05/error_699794.jpg

        Thanks and Regards

        Daniel

        (0) 
  7. Daniel Davis

    It gets stranger 🙁 I reinstalled Lumira 1.25 fresh, added the zip, went through all the usual steps… and opened the lums file – amazing the heatmap was there and visible and working… I do anything with Lumira and when I return to the visualisation it’s white again.

    Bizarre!

    I tested Wifi vs Cable, 2 networks, with and without proxy, refresh, recreate, reinstall and now I have to get on with other stuff. Very strange

    Thanks for advice

    Regards

    Daniel

    (0) 
  8. Colm OMahony

    Mustafa,

     

    Is the extension only for Desktop Lumira?

    Or should it be possible to use opening a Lumira document through LaunchPad?

    Works nicely for me on Desktop but blank white page displaying when opened through launchpad.

     

    Regards,

     

    Colm.

    (0) 

Leave a Reply