Skip to main content

Useful tools and scripts related to Mapillary

Project description

# Mapillary: Python API


A big thanks to the guys at [@Mapillary] for publishing many great [Python tools for Mapillary].

## Install

Latest version from **Github Repo**

$ git clone
$ cd mapillary_tools
$ python install

Stable version from **PyPi**

$ pip install mapillary

## Compatibility

Mapillary API is tested on the following Python versions:

- 2.7

## Command Line Interface

$ mapillary -h

| Parameter | Description |
| `command` | Mapillary API |
| `input` | Input: File Path |
| `-o`, `--out` | Output: File Path |
| `-e`, `--email` | Mapillary: Email |
| `-u`, `--username` | Mapillary: Username |
| `-p`, `--password` | Mapillary: Password |
| `-g`, `--gpx` | GPX Track: File Path |
| `-b`, `--bearing` | GPX: Bearing offset |
| `-t`, `--time` | GPX: Time offset |
| `-h`, `--help` | Help File |


## Geotag Photos

This process will add GPS information to all photos inside a folder correlated from a GPX Track.

**WARNING** This will overwrite any existing GPS EXIF to the existing files

$ mapillary geotag "<File Path>" --gpx "<GPX File Path>"

### Bearing Offset

If your camera was pointed to the right (90 Degrees), you can include a `bearing` offset to correct the **GPSImageDirection**

$ mapillary geotag "<File Path>" --gpx "<GPX File Path>" --bearing 90

### Time Offset

If the **Timestamp** of your GPS and camera are not in sync, you can include a `time` offset (Seconds) to adjust the **GPSDateTime**.

$ mapillary geotag "<File Path>" --gpx "<GPX File Path>" --time 2

### Successful GeoTag

A typical output for a successful Geotag process

$ mapillary geotag "100GOPRO" -g "GoPro 4.gpx"
Saving file: 100GOPRO/G0018624.JPG
Saving file: 100GOPRO/G0028783.JPG
Saving file: 100GOPRO/G0018600.JPG
Saving file: 100GOPRO/G0028752.JPG

## Manual Uploads

The Standard manual upload method requires your Mapillary credential

$ mapillary upload "<File Path>" -u "<Username>" \
-e "<>" -p "<Password>"

### Using Environment Variables

Using environment variables you can send your Mapillary credentials safely.

1. Connect the the following URL for to retrieve the **Hashes**.

2. Export env variables `MAPILLARY_PERMISSION_HASH` & `MAPILLARY_SIGNATURE_HASH`, you can edit `~/.bashrc` to store them to your terminal.

3. Use the Mapillary `upload` command with your `Username`.

$ export $MAPILLARY_PERMISSION_HASH=<permission_hash>
$ export $MAPILLARY_SIGNATURE_HASH=<signature_hash>
$ mapillary upload "<File Path>" -u "<Username>"

### Successful Upload

A typical successful upload will look like the following:

$ mapillary upload "GoPro" -u "deniscarriere"

[SUCCESS] Mapillary connection established.
Uploading sequence 3e41e334-3a50-4e41-8206-dae2a4d24e5a.
Uploading: G0047731.JPG
Uploading: G0047747.JPG
Uploading: G0047736.JPG
Uploading: G0047742.JPG
Success: G0047736.JPG
Success: G0047768.JPG
Success: G0047751.JPG
Finalizing upload will submit all successful uploads and ignore all failed.
If all files were marked as successful, everything is fine, just press 'y'.
Finalize upload? [y/n]: y
Upload a DONE file to tell the backend that the sequence
is all uploaded and ready to submit.
Uploading: DONE
Success: DONE
Done uploading.

[Python tools for Mapillary]:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mapillary, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size mapillary-0.0.2-py2.py3-none-any.whl (28.8 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size mapillary-0.0.2.tar.gz (24.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page