Skip to main content

Get pictures near an area

Project description

Mapilliary nearby

@readwithai - X - blog - machine-aided reading - 📖⚡️🖋️

Get photos near a location using the Mapillary open source streetview image database.

Motivation

I like to set up my computer so that it reinforces habits. I am planning to visit another country for a while and learn some languages. A nice way to reinforce this and make this real is to regularly set my background to images in this area.

This tool lets you fetch images in an area. Which you can then set as your background using an appropriate tool.

Installation

This program uses the mapillary API. To do this, you must create an app for your use of this url.

  1. Go to https://www.mapillary.com/dashboard/developers
  2. Click Register application
  3. Fill in any details you like
  4. Unforunately, you need to add a redirect URL and a company website. But these can be any value
  5. The app must have read permission.
  6. Once the App is registered copy the client token.

You can then install mapillary-nearby with pipx.

pipx install mapillary-nearby

Usage

Find the latitude and longitude of the location where you want to take images from. I like to use Wikipedia for this - most pages for cities have this information. Get this in decimal rather than minute/second based format.

You can then run, for example

mapillary-nearby --lat 56.156389 --long 10.209722  --radius 5000m  test.jpeg

To fetch a random photo within 5km on this location and write it to test.jpeg

Caveats

Upon using this I immediately wanted to know where the pictures were taken. I may add some sort of feature to display locations on a map.

This tool only fetched an image you need to do the "last mile" of setting he background. On linux systems you can use feh.

This software probably doesn't work with windows - but will be easy to adapt for those familiar with Python. Pull requests to add support for windows will be quickly merged.

Support

This makes use of the very using Mapillary service and dataset which is generating a permanently useable set of data for the entire world.

If you find this tool useful you might consider installing mapillary on your phone and collecting some data when you walk around - which I do quite regularly.

About me

I am @readwithai. I make tools for reading, research and agency sometimes using Obsidian.

You can follow me on X, or bluesky.

You might like to read about computer-aided habit formation.

@readwithai logo

Project details


Download files

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

Source Distribution

mapillary-nearby-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file mapillary-nearby-1.0.0.tar.gz.

File metadata

  • Download URL: mapillary-nearby-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for mapillary-nearby-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f91a72596fc84c81a7cc9e426ee6e4ba97b79e8b329c7de7e3431d0c1854a2ce
MD5 6f256d3f3f17748b842a63d029e0354f
BLAKE2b-256 d9d99133f4bef1da18854d398ffb750fab8dca9bdb2c222af2a0f54d28876d4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page