Skip to content

Commit 700fea4

Browse files
committed
Add search.json / Add basic README.md
1 parent 1d427cc commit 700fea4

File tree

5 files changed

+156599
-63
lines changed

5 files changed

+156599
-63
lines changed

DEVELOPMENT.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Creating new Search data for Addis Ababa
2+
3+
Warning: BBOX Params are flipped!
4+
5+
```
6+
git clone https://github.com/trufi-association/osm-search-data-export.git
7+
cd osm-search-data-export
8+
docker build . --tag osm-search-data-export:latest
9+
docker run --volume /tmp:/data osm-search-data-export --input overpass --bbox "8.82,38.63,9.11,38.91" --output json --outpath /data/search.json
10+
cp /tmp/search.json ../AddisMapTransit/assets/data/ search.json
11+
```

README.md

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,3 @@
1-
# Trufi Core Example
1+
# AddisMapTransit - New app
22

3-
This implementation demonstrates how to use the trufi_core Flutter plugin to build your own public transport app. You can use this folder as a skeleton to start your own app. We assume you have a working [Flutter environment](https://flutter.dev/docs/get-started/install).
4-
5-
## Versions
6-
7-
The example was tested against Flutter 2.8.1 and might cause [problems with Flutter 3](https://github.com/trufi-association/trufi-core/issues/604).
8-
9-
## Set up the backend
10-
11-
The app needs to connect to a backend running on a server to be able to recommend routes. The app does not work without internet connection. But once it fetched the route it can operate without internet connection except for the map background tiles. So you can fetch your route at home and take your ride offline. But anyway you need a backend for the map background tiles and the routing at least. We build the backend called [trufi-server](https://github.com/trufi-association/trufi-server) which you can use. That backend just serves pre-generated data and that needs to be created. This is what we use [trufi-server-resources](https://github.com/trufi-association/trufi-server-resources) for.
12-
13-
That requires Linux. You will use Linux anyway on the production server later on. But you can run [Linux in a VM on Windows](https://www.wikihow.com/Install-Ubuntu-on-VirtualBox) or [on Mac](https://www.wikihow.com/Run-Linux-on-a-Mac) if you don’t use Linux natively. We use Debian or Debian favored systems like Ubuntu. Our backend has some debian related dependencies so better decide for Debian.
14-
15-
## Getting started
16-
17-
`pubspec.yaml` references `trufi_core`. Here we use a relative path, in your final application it should look more like this:
18-
19-
```yaml
20-
trufi_core:
21-
git:
22-
url: https://github.com/trufi-association/trufi-core
23-
ref: main
24-
```
25-
26-
## Modify [lib/main.dart](./example/lib/main.dart)
27-
28-
`lib/main.dart` is used to bootstrap the application. It sets configuration values, theme colors and runs the app. That's it!
29-
30-
Our example uses a `assets/cfg/app_config.json` config to keep some values out of the `main.dart`. You will find a blank version you need to copy over. It is also possible to hardcode these values directly in `main.dart`.
31-
32-
### Search functionality
33-
34-
The app supports searching for POIs to start the journey from and to plan the journey to. That can happen offline or online. Offline has the advantage that it saves your user bandwidth because the search will not consume any data. But it comes with the huge disadvantages of having to release a new version of the app everytime you want to update the offline search index. Only use the offline search engine for small cities otherwise the performance of the app will suffer. Online comes with the advantage of always providing the users with a fresh search experience because you can change the index on the backend more frequently. The disadvantage is that the app sends every typed char to the backend through the internet possibly invading users privacy because every request gets logged. Use this if having internet connection does not prove to be any difficulty and internet connection is cheap as in most developed countries.
35-
36-
To use offline search POI functionality remove `photonUrl` and generate your own version of the `assets/data/search.json` using [osm-search-data-export](https://github.com/trufi-association/osm-search-data-export).
37-
38-
To use online search POI functionality remove `searchAssetPath`, set up the backend with the extension [photon](https://github.com/trufi-association/trufi-server/tree/main/extensions/photon) and the necessary builder [photon-data-builder](https://github.com/trufi-association/trufi-server-resources/tree/main/photon-data-builder). Of course you need to adapt the `photonUrl` value.
39-
40-
## Modify assets, theme and config
41-
42-
Make necessary modifications to [assets](assets), [theme](lib/theme) and config in the generated [Android](android) and [iOS](ios) projects e.g, you will want to replace the app icon with yours.
43-
44-
Don’t forget to change [assets/images/drawer-bg.jpg](assets/images/drawer-bg.jpg)
45-
46-
## Run and rock that thing
47-
48-
Start the application:
49-
50-
```sh
51-
$ flutter run
52-
```
53-
54-
## Additional notes
55-
56-
* If you use MapTiler Cloud as your tiles endpoint you can pass in your [MapTiler key](https://cloud.maptiler.com/account/keys) via the `trufiCfg.map.mapTilerKey` setting.
57-
58-
* For Android: [Create a key store](https://flutter.dev/docs/deployment/android#signing-the-app) or use an existing key, fill the `android/key.properties` with path and password.
3+
This is work in progress.

artwork/addismaptransit2.svg

Lines changed: 5 additions & 4 deletions
Loading

assets/data/search.json

Lines changed: 156580 additions & 1 deletion
Large diffs are not rendered by default.

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void main() async {
2626
mapConfiguration: MapConfiguration(
2727
center: const TrufiLatLng(9.005401, 38.763611),
2828
),
29-
searchAssetPath: "",
29+
searchAssetPath: "assets/data/search.json",
3030
photonUrl: "https://photon.komoot.io",
3131
mapTileProviders: [OpenPlaceGuideMapTile()]
3232
),

0 commit comments

Comments
 (0)