Skip to content

Commit

Permalink
doc: updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanprbt committed Jun 6, 2024
1 parent 1ecccaf commit 20a90d6
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 25 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ hs_err_pid*

# Misc
javelo.kml
*.png
*.gpx
50 changes: 44 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# JaVelo - Cycling route planner in Switzerland

This project is a semester project for the course **CS108 - Object-Oriented Programming**, given to freshmen in Computer Science faculty at EPFL.
This project is a semester project for the course **CS108 - Object-Oriented Programming**, given to freshmen in Computer Science faculty at EPFL.

It's a cycle route planner, allowing the user to select a departure point, an arrival point and several optional intermediate points to determine a route optimised for cycling. The interface features a navigable map of French-speaking Switzerland, using [OpenStreetMap](https://www.openstreetmap.org/#map=6/46.449/2.210) data. Once the route has been determined, it is displayed on this map above the vertical profile, which shows the detailed gradient over the entire route as well as a few statistics such as length and altitude. The route can be exported in GPX format to the user's computer.
It's a cycle route planner, allowing the user to select a departure point, an arrival point and several optional intermediate points to determine a route optimised for cycling. The interface features a navigable map of French-speaking Switzerland, using [OpenStreetMap](https://www.openstreetmap.org/#map=6/46.449/2.210) data. Once the route has been determined, it is displayed on this map above the vertical profile, which shows the detailed gradient over the entire route as well as a few statistics such as length and altitude. The route can be exported in GPX format.

<img width="912" alt="JaVeloScreenshot" src="https://github.com/CassioManuguerra/JaVelo/assets/66010389/32efc181-ac95-4ced-98ec-b1d4e1842d38">
This project uses an in-house implementation of the [A*](https://en.wikipedia.org/wiki/A*_search_algorithm) search algorithm, which is an extension of [Dijkstra's](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) algorithm. It relies on [JavaFX](https://openjfx.io) for GUI and [JUnit](https://junit.org/junit5/) for testing. When the user clicks somewhere outside the supported area, a simple error message is shown on the screen.

This project uses an in-house implementation of the [A*](https://en.wikipedia.org/wiki/A*_search_algorithm) search algorithm, which is an extension of [Dijkstra's](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) algorithm. It relies on [JavaFX](https://openjfx.io) for GUI and [JUnit](https://junit.org/junit5/) for testing.

Map is displayed using tiles fetched from OpenStreetMap's [API](https://wiki.openstreetmap.org/wiki/Raster_tile_providers) at runtime. In order to streamline the procedure, they are cached in folder `.javelo-cache/` in user's home directory. When the user clicks somewhere outside the supported area, a simple error message is shown on the screen.

## Run instructions
The project uses [Gradle](https://gradle.org) for build and dependency management, which makes run instructions pretty straightforward. Once you cloned the repository, simply run the following command from the `JaVelo/` directory.
The project uses [Gradle](https://gradle.org) for build and dependency management, which makes run instructions pretty straightforward. Once you cloned the repository, simply run the following command from the `JaVelo/` directory.

###### macOS
```shell
Expand All @@ -23,12 +26,47 @@ gradlew.bat run

You can also run the tests or simply build the project using the same `Gradle` wrapper as above, running `./gradlew build` or `./gradlew test`.

If you wish to extend the supported area for other countries, currently used data is located into `src/resources/ch_west/` folder. You must provide the following binary files corresponding to OpenStreetMap data for the zone you wish to use:
If you wish to extend the supported area for other countries, currently used data is located into `src/main/resources/ch_west/` folder. You must provide the following binary files corresponding to OpenStreetMap data for the zone you wish to use:
- `attributes.bin`
- `edges.bin`
- `elevations.bin`
- `nodes.bin`
- `profile_ids.bin`
- `sectors.bin`

This project only offers support for French language, including documentation.
This project only offers support for French language, including documentation.

## Packaging
This project can be packaged to the OS of your choice, either in a fat JAR or in a `*.dmg` (`macOS`), `*.rpm`, `*.deb` (`Linux`), `*.exe` (`Windows`) executable.

The packaging process uses instructions from this [repository](https://github.com/heshanthenura/JavaPackageDemo/blob/master/README.md).

First, create a standalone fat JAR which ships all required dependencies using the custom Gradle task of `build.gradle`. It can be found under `/build/libs` after running the following command.
```sh
./gradlew customFatJar
```

Then, use this JAR and `jpackage` utility to create an executable, which will appear in the project's working directory.
##### macOS
```shell
jpackage --input build/libs --name JaVelo --main-jar JaVeloJAR-1.0-SNAPSHOT.jar --main-class ch.epfl.javelo.Launcher --type dmg --icon src/main/resources/logo.icns
```
##### Linux
It is necessary to install `fakeroot`.
```
apt-get install fakeroot -y
```
###### Debian
```shell
jpackage --input build/libs --name JaVelo --main-jar JaVeloJAR-1.0-SNAPSHOT.jar --main-class ch.epfl.javelo.Launcher --type deb --icon src/main/resources/logo.icns
```
###### RedHat
```shell
sudo yum install rpm-build
jpackage --input build/libs --name JaVelo --main-jar JaVeloJAR-1.0-SNAPSHOT.jar --main-class ch.epfl.javelo.Launcher --type rpm --icon src/main/resources/logo.icns
```
##### Windows
It is necessary to install the [WiX toolset](https://wixtoolset.org/docs/wix3/).
```shell
jpackage --input build/libs --name JaVelo --main-jar JaVeloJAR-1.0-SNAPSHOT.jar --main-class ch.epfl.javelo.Launcher --type msi --win-dir-chooser --icon src/main/resources/logo.icns
```
17 changes: 0 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,6 @@ application {
mainClass = 'ch.epfl.javelo.Launcher'
}

sourceSets {
main {
java {
srcDirs 'src/main/java'
}
resources {
srcDirs "src/main/resources"
}
}
test {
java {
srcDirs 'src/test/java'
}

}
}

dependencies {
implementation 'org.openjfx:javafx-controls:22.0.1'
testImplementation platform('org.junit:junit-bom:5.10.0')
Expand Down
1 change: 0 additions & 1 deletion src/main/java/ch/epfl/javelo/gui/AnnotatedMapManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import ch.epfl.javelo.data.Graph;
import ch.epfl.javelo.projection.PointCh;
import ch.epfl.javelo.projection.PointWebMercator;
import ch.epfl.javelo.projection.SwissBounds;
import ch.epfl.javelo.routing.RoutePoint;
import javafx.beans.binding.Bindings;
import javafx.beans.property.*;
Expand Down

0 comments on commit 20a90d6

Please sign in to comment.