Skip to content

Latest commit

 

History

History
106 lines (74 loc) · 3.4 KB

File metadata and controls

106 lines (74 loc) · 3.4 KB

ShowMePlace

This tool shows satellite images for certain coordinates (latitude and longitude) by Overpass API request / raw response

Instructions

  1. Install Python 3.
  2. Install dependencies pip install -r requirements.txt
  3. Create a mapbox account here: www.mapbox.com.
  4. Once logged in, scroll down to Default Public Token. Copy it! You will need it in the shomewplace.py file
  5. Run the showmeplace.py file

You can use other satellite image providers (example in the file shomewplace.py). But in some places there may not be detailed images.

Theory

Usage

The main value of the tool is the ability to do batch checks for big regions, but you can do simple request also.

Simple execution without params

You must copy the prepared request in Overpass => Export => Request panel (without {{variables}}).

$ ./showmeplace.py --overpass-request
Paste Overpass API request text, then enter END to run
[out:json][timeout:800];
nwr["addr:housenumber"="1832"](44.80230124552821,-93.52729797363281,45.22025894300122,-92.7252960205078);
out center;
END

Making request to Overpass API...
...

Warning

add the center argument to the out statement. This will speed up data processing and place the object in the center of the image.

Simple execution without params from file

Also you can use a file:

$ ./showmeplace.py --overpass-request-file request.txt

Making request to Overpass API....
Found: 0 nodes, 20 ways, 0 relations
Processing nodes...
0it [00:00, ?it/s]
Processing ways...
Saving 44.9733591, -92.7328901 to 242000245.jpg, check place in https://www.google.com/maps/@44.9733591,-92.7328901,17.5z
...

Execution of raw json request

You can use raw Overpass API from Overpass => Export => Data => raw

$ ./showmeplace.py --overpass-results-file test.json
Loading coords from Overpass results file...
Satellite image 88081666.jpg already exists!
Saving 44.9733591, -92.7328901 to 242000245.jpg, check place in https://www.google.com/maps/@44.9733591,-92.7328901,17.5z
...

Batch processing mode (Use it for big territory scanning!)

The idea of a batch processing mode: split big territory for search into small parts (step*step, see source code) and run overpass search for each part.

  1. Put request to some txt file.
$ cat batch.txt
[out:json][timeout:800];
(
  nwr["power"="tower"]["design"="barrel"]["material"="steel"]["structure"="tubular"]({{bbox}});
)->.tower;

(
  nwr(around.tower:100)["highway"="stop"];
)->.sign;

out center geom;
  1. Generate N files for the bounding box from the request file batch.txt. You can copy bounding box coordinates from the Overpass interface by doing Overpass => Export => Request.
$ ./showmeplace.py --generate-overpass-files 24.806681353851964,-126.5185546875,53.4357192066942,-65.3466796875 --overpass-request-file batch.txt

Check that you have a lot of files with filenames of format batch.txt_0

  1. Run batch processing (advanced: fix shell script on your own if the script is failing and you have to change mileage = step).
$ ./batch.sh

Results

You'll get JPG files in the directory of the script with satellite images of target coordinates in the closest approximation 👍