Skip to content

Commit

Permalink
updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
himynamesdave committed Apr 6, 2022
1 parent 3fb1c63 commit af65396
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
.python-version

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
## Python GeoJSON generator from telemetry GPS Coordinates

*built in python 3*

The multiline.geojson file contains the multiline for the entire path in the dataset, and can be uploaded as a layer for a custom style on mapbox. This was done to shorten the URL requests as there is an 8000 character limit. You can create your own mapbox style, the alter the geojsonrequest script and replace the "mitchelbourne/cl1......" with your own style.
Turn GoPro telemetry into a video map overlay.

Packages used: geojson, json, os, requests, urllib, argparse

1. Paste telemetry data into the data.json file
2. Run the generategeojson python file to create the geojson files from the data set.
3. Open the geojsonrequest and paste in your mapbox api key into the access_key variable
4. Run the geojson request python file, this will generate the images into the images folder.
## Usage

0. Install required packages `pip3 install -r requirements.txt`
1. First extract the telemetry file (as json) from your GoPro video using [gopro-telemetry](https://github.com/JuanIrache/gopro-telemetry/). [Detailed instructions about how to do this can be found in this post](https://www.trekview.org/blog/2022/gopro-telemetry-exporter-getting-started/).
2. Run the `python3 generategeojson.py -f TELEMETRY.json` to create the `.geojson` files from the data set (making sure to replace `TELEMETRY.json` with the telemetry file created at step 1). The resulting `.geojson` files will be saved in the directory `geojson-files/`.
3. The `multiline.geojson` file generated contains the multiline for the entire path in the dataset, and [should be uploaded as a layer for a custom style on MapBox here](https://studio.mapbox.com/styles).
* Note: This was done to shorten the URL requests as [there is an 8192 character limit](https://docs.mapbox.com/api/overview/#url-length-limits), therefore the entire `.geojson` file for the `LineString` cannot be passed in a single request.
4. Open the `geojsonrequest.py` and:
* paste in your MapBox API key into the `access_key` variable. [You can get a MapBox API key here](https://account.mapbox.com/) that will allow you [50,000 free static image lookups each month](https://www.mapbox.com/pricing/#glstatic).
* paste in your username and layer replacing `USERNAME/STYLE_ID/`. For example `trekview/cl1nbz22z002614pn626zhm7`
5. Run `python3 geojsonrequest.py`. This will generate .jpg map images in the directory `mapbox-images/`.

## License

The code of this site is licensed under a [MIT License](/LICENSE).
1 change: 0 additions & 1 deletion multiline.geojson

This file was deleted.

1 change: 0 additions & 1 deletion mytelemetry.json

This file was deleted.

3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
geojson==2.5.0
requests==2.27.1
urllib3==1.26.9

0 comments on commit af65396

Please sign in to comment.