This repository holds an application that calculates the location entropy of a given data. It also holds its related unit tests with the code coverage of 96.88%.
- Scala: For both implementation and tests.
- Apache Spark: To transform the data into dataset and dataframes for required calculation.
- ScalaTest: Used framework to write the unit tests.
- Scoverage: To check the coverage of the written tests.
The data used here is of type *.geojson and taken from this url: https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson
Run the following command:
sbt clean test
For checking the coverage:
- Run
sbt coverage test - Then, run
sbt coverageReport - See the report from
target/scala-2.11/scoverage-report/index.html
- First package the application by running
sbt package - Move the real world data (
earthquake-record.geojson) into thetarget/scala-2.11folder. - Use the
spark-submitand run this command:spark-submit --class "App" --master local[4] location-entropy-calculator_2.11-0.1.0-SNAPSHOT.jar - See the result from the created file
calculated-location-entropy.txt.