pygmdl


Namepygmdl JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
SummaryDownload satellite images from Google Maps.
upload_time2025-01-20 09:40:28
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT License
keywords googlemaps satellite images download
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center" markdown>
<img src="https://github.com/user-attachments/assets/4ecd8574-6fbd-4541-bb3b-17767df410dd">
</a>

<p align="center">
  <a href="#Quick-Start">Quick Start</a> •
  <a href="#Overview">Overview</a> • 
  <a href="How-to-Use">How to Use</a> •
  <a href="Bugs-and-Feature-Requests">Bugs and Feature Requests</a>
</p>

[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/iwatkot/pygmdl)](https://github.com/iwatkot/pygmdl/releases)
[![PyPI - Version](https://img.shields.io/pypi/v/pygmdl)](https://pypi.org/project/pygmdl)
[![GitHub issues](https://img.shields.io/github/issues/iwatkot/pygmdl)](https://github.com/iwatkot/pygmdl/issues)
[![Maintainability](https://api.codeclimate.com/v1/badges/373eb79586deebf5c264/maintainability)](https://codeclimate.com/github/iwatkot/pygmdl/maintainability)<br>
[![PyPI - Downloads](https://img.shields.io/pypi/dm/pygmdl)](https://pypi.org/project/pygmdl)
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
[![Build Status](https://github.com/iwatkot/pygmdl/actions/workflows/checks.yml/badge.svg)](https://github.com/iwatkot/pygmdl/actions)
[![Test Coverage](https://api.codeclimate.com/v1/badges/373eb79586deebf5c264/test_coverage)](https://codeclimate.com/github/iwatkot/pygmdl/test_coverage)
[![GitHub Repo stars](https://img.shields.io/github/stars/iwatkot/pygmdl)](https://github.com/iwatkot/pygmdl/stargazers)<br>

</div>

## Quick Start
1. Install the package via pip:

```bash
pip install pygmdl
```

2. Import the package and use it:

```python
import pygmdl

lat = 35.681236
lon = 139.767125
size = 2000
output_path = "satellite_image.png"

pygmdl.save_image(lat, lon, size, output_path)
```

It will took a while to download the image, but as soon as it's done, you will see the image in the specified path.

## Overview

This package is designed to download satellite images from Google Maps in a simple way. This repository is a fork of [satmap_downloader](https://github.com/Paint-a-Farm/satmap_downloader), which provides CLI to download satellite images. So if you need a CLI tool, please use the original repository.

## How to Use

Here, you'll find the detailed explanation of the `save_image` function.

### Function signature

```python
def save_image(
    lat: float,
    lon: float,
    size: int,
    output_path: str,
    rotation: int = 0,
    zoom: int = 18,
    from_center: bool = False,
    logger: Logger | None = None,
) -> str:
```

Note, that by default the function expects that provided coordinates (lat, lon) are coordinates of the top-left corner of the image. If you want to provide the coordinates of the center of the image, you can set `from_center` to `True`.

### Function arguments

|      Parameters      |              Type              |                    Description                     |
| :------------------: | :----------------------------: | :------------------------------------------------: |
|         lat          |            float             | Latitude of the point to download the image from. |
|         lon          |            float             | Longitude of the point to download the image from.|
|         size         |            int               | Size of the ROI in meters.                     |
|     output_path      |            str               | Path to save the image.                           |
|      rotation        |            int               | Rotation of the image in degrees (CW).            |
|         zoom         |            int               | Zoom level for images (higher values = higher resolution). |
|     from_center      |            bool              | If True, the provided coordinates will be treated as the center of the image. |
|       logger         | Logger \| None | Logger to use for logging. If None, the default logger will be used. |

### Return value
The function returns the path to the saved image (the same as `output_path`).

### Usage example

```python
import pygmdl

lat = 35.681236
lon = 139.767125
size = 2000
output_path = "satellite_image.png"
rotation = 25
zoom = 16
from_center = True

pygmdl.save_image(lat, lon, size, output_path, rotation, zoom, from_center)
```

As a result, you will get the satellite image of a region 2000x2000 meters around the point with coordinates (35.681236, 139.767125) with the center of the image at these coordinates. The image will be rotated by 25 degrees clockwise and will be downloaded with zoom level 16.

## Bugs and Feature Requests

If you find a bug or have a feature request, please open an issue on the [issues](https://github.com/iwatkot/pygmdl/issues) page.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pygmdl",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "googlemaps, satellite, images, download",
    "author": null,
    "author_email": "iwatkot <iwatkot@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/fa/8c/9ac3b091e506b82cef0eeca86808299f8bc32b63c7b3563fdb7a439e24a9/pygmdl-0.1.2.tar.gz",
    "platform": null,
    "description": "<div align=\"center\" markdown>\n<img src=\"https://github.com/user-attachments/assets/4ecd8574-6fbd-4541-bb3b-17767df410dd\">\n</a>\n\n<p align=\"center\">\n  <a href=\"#Quick-Start\">Quick Start</a> \u2022\n  <a href=\"#Overview\">Overview</a> \u2022 \n  <a href=\"How-to-Use\">How to Use</a> \u2022\n  <a href=\"Bugs-and-Feature-Requests\">Bugs and Feature Requests</a>\n</p>\n\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/iwatkot/pygmdl)](https://github.com/iwatkot/pygmdl/releases)\n[![PyPI - Version](https://img.shields.io/pypi/v/pygmdl)](https://pypi.org/project/pygmdl)\n[![GitHub issues](https://img.shields.io/github/issues/iwatkot/pygmdl)](https://github.com/iwatkot/pygmdl/issues)\n[![Maintainability](https://api.codeclimate.com/v1/badges/373eb79586deebf5c264/maintainability)](https://codeclimate.com/github/iwatkot/pygmdl/maintainability)<br>\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/pygmdl)](https://pypi.org/project/pygmdl)\n[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)\n[![Build Status](https://github.com/iwatkot/pygmdl/actions/workflows/checks.yml/badge.svg)](https://github.com/iwatkot/pygmdl/actions)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/373eb79586deebf5c264/test_coverage)](https://codeclimate.com/github/iwatkot/pygmdl/test_coverage)\n[![GitHub Repo stars](https://img.shields.io/github/stars/iwatkot/pygmdl)](https://github.com/iwatkot/pygmdl/stargazers)<br>\n\n</div>\n\n## Quick Start\n1. Install the package via pip:\n\n```bash\npip install pygmdl\n```\n\n2. Import the package and use it:\n\n```python\nimport pygmdl\n\nlat = 35.681236\nlon = 139.767125\nsize = 2000\noutput_path = \"satellite_image.png\"\n\npygmdl.save_image(lat, lon, size, output_path)\n```\n\nIt will took a while to download the image, but as soon as it's done, you will see the image in the specified path.\n\n## Overview\n\nThis package is designed to download satellite images from Google Maps in a simple way. This repository is a fork of [satmap_downloader](https://github.com/Paint-a-Farm/satmap_downloader), which provides CLI to download satellite images. So if you need a CLI tool, please use the original repository.\n\n## How to Use\n\nHere, you'll find the detailed explanation of the `save_image` function.\n\n### Function signature\n\n```python\ndef save_image(\n    lat: float,\n    lon: float,\n    size: int,\n    output_path: str,\n    rotation: int = 0,\n    zoom: int = 18,\n    from_center: bool = False,\n    logger: Logger | None = None,\n) -> str:\n```\n\nNote, that by default the function expects that provided coordinates (lat, lon) are coordinates of the top-left corner of the image. If you want to provide the coordinates of the center of the image, you can set `from_center` to `True`.\n\n### Function arguments\n\n|      Parameters      |              Type              |                    Description                     |\n| :------------------: | :----------------------------: | :------------------------------------------------: |\n|         lat          |            float             | Latitude of the point to download the image from. |\n|         lon          |            float             | Longitude of the point to download the image from.|\n|         size         |            int               | Size of the ROI in meters.                     |\n|     output_path      |            str               | Path to save the image.                           |\n|      rotation        |            int               | Rotation of the image in degrees (CW).            |\n|         zoom         |            int               | Zoom level for images (higher values = higher resolution). |\n|     from_center      |            bool              | If True, the provided coordinates will be treated as the center of the image. |\n|       logger         | Logger \\| None | Logger to use for logging. If None, the default logger will be used. |\n\n### Return value\nThe function returns the path to the saved image (the same as `output_path`).\n\n### Usage example\n\n```python\nimport pygmdl\n\nlat = 35.681236\nlon = 139.767125\nsize = 2000\noutput_path = \"satellite_image.png\"\nrotation = 25\nzoom = 16\nfrom_center = True\n\npygmdl.save_image(lat, lon, size, output_path, rotation, zoom, from_center)\n```\n\nAs a result, you will get the satellite image of a region 2000x2000 meters around the point with coordinates (35.681236, 139.767125) with the center of the image at these coordinates. The image will be rotated by 25 degrees clockwise and will be downloaded with zoom level 16.\n\n## Bugs and Feature Requests\n\nIf you find a bug or have a feature request, please open an issue on the [issues](https://github.com/iwatkot/pygmdl/issues) page.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Download satellite images from Google Maps.",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/iwatkot/pygmdl",
        "Repository": "https://github.com/iwatkot/pygmdl"
    },
    "split_keywords": [
        "googlemaps",
        " satellite",
        " images",
        " download"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c96e62fdc914f6729000d53f16e3b02d012b5fe2e10aabb598ce5500c4e04fe",
                "md5": "66dca1ed5959a899ef7d1754dd2d6652",
                "sha256": "b69691345141f2a8a4aa8e2f1a98be7ea087fa8935d4d2f544804824bb9e04b8"
            },
            "downloads": -1,
            "filename": "pygmdl-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "66dca1ed5959a899ef7d1754dd2d6652",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8470,
            "upload_time": "2025-01-20T09:40:26",
            "upload_time_iso_8601": "2025-01-20T09:40:26.763098Z",
            "url": "https://files.pythonhosted.org/packages/3c/96/e62fdc914f6729000d53f16e3b02d012b5fe2e10aabb598ce5500c4e04fe/pygmdl-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa8c9ac3b091e506b82cef0eeca86808299f8bc32b63c7b3563fdb7a439e24a9",
                "md5": "4710339953798a2bc0a7fcc2a2379cbc",
                "sha256": "af22185eb6d734c1a240d95817b223d48e40ede7092fd166f8cbf333ac13c9bc"
            },
            "downloads": -1,
            "filename": "pygmdl-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "4710339953798a2bc0a7fcc2a2379cbc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8080,
            "upload_time": "2025-01-20T09:40:28",
            "upload_time_iso_8601": "2025-01-20T09:40:28.530647Z",
            "url": "https://files.pythonhosted.org/packages/fa/8c/9ac3b091e506b82cef0eeca86808299f8bc32b63c7b3563fdb7a439e24a9/pygmdl-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-20 09:40:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "iwatkot",
    "github_project": "pygmdl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pygmdl"
}
        
Elapsed time: 1.16598s