Get offline Google maps
OpenAI GPT-5 involves composing:
tile.py
These scripts contain content that we don't understand.
Create and activate a Python 3.12 virtual environment. Set the current directory to the program's root directory. Run the following command.
pip install -r requirements.txt
Activate a Python 3.12 virtual environment.
Set the current directory to the program's root directory.
Run python main.py followed by command line arguments. This program use POSIX arguments syntax.
Arguments:
| Name | Type | Required? | Description |
|---|---|---|---|
--api_key |
str |
✓ | Google Cloud API key. 1. Go to https://console.cloud.google.com/projectselector2/google/maps-apis/credentials 2. Create or choose a project. You'll be redirected. 3. Create or find API key in "API Keys" section. Its restrictions should include "Maps Static API". |
--secret |
str |
✓ | Google Cloud URL signing secret. 1. Go to https://console.cloud.google.com/projectselector2/google/maps-apis/credentials 2. Create or choose a project. You'll be redirected. 3. Find URL signing secret in "URL Signing Secret" section. |
--scale |
int |
How many centimeters in real world does 1 centimeter on the map represent. It is the inquired scale, which cannot be guaranteed and may be different from actual scale. Either --scale or --zoom should be provided. Priority: --scale > --zoom |
|
--zoom |
int |
Defined by Google Maps. Either --scale or --zoom should be provided. Priority: --scale > --zoom |
|
--ppi |
int |
Default value: 400. Pixels per inch in the output map (PDF file). | |
-N |
float |
✓ | Latitude of the most north edge of the output map. Positive value means north hemisphere; negative value means south hemisphere. |
-S |
float |
✓ | Latitude of the most south edge of the output map. |
-W |
float |
✓ | Longitude of the most west edge of the output map. Positive value means east hemisphere; negative value means west hemisphere. |
-E |
float |
✓ | Longitude of the most east edge of the output map. |
-O |
str |
✓ | Output relative path of the map. |
--map_type |
str |
Default value: "roadmap". Google map types. Must be chosen from these options. |