Skip to main content

Geospatial image handling and management

Project description

landlensdb: Geospatial Image Handling and Management

Binder PyPI Docker Pulls Contributors Downloads Tests DOI

Streamlined geospatial image handling and database management

Overview

landlensdb helps you manage geolocated images and integrate them with other spatial data sources. The library supports:

  • Image downloading and storage
  • EXIF/geotag extraction
  • Road-network alignment
  • PostgreSQL integration

This workflow is designed for geo-data scientists, map enthusiasts, and anyone needing to process large sets of georeferenced images.

Features

  • GeoImageFrame Management: Download, map, and convert geolocated images into a GeoDataFrame-like structure.
  • Mapillary API Integration: Fetch and analyze images with geospatial metadata.
  • EXIF Data Processing: Extract geolocation, timestamps, and orientation from image metadata.
  • Database Operations: Store image records in PostgreSQL; retrieve them by location or time.
  • Road Network Alignment: Snap image captures to road networks for precise route mapping.

Installation

Install the latest release from PyPI:

pip install landlensdb

Dependencies

[!IMPORTANT] You MUST have both GDAL and PostgreSQL with PostGIS installed to use landlensdb.

  • See GDAL Docs for instructions on installing GDAL.
  • See PostGIS for installing PostGIS on top of PostgreSQL.

Minimum Requirements:

  • GDAL ≥ 3.5 (ensure command-line tools work, e.g., gdalinfo --version)
  • PostgreSQL ≥ 14
  • PostGIS ≥ 3.5 (the extension must be installed in your PostgreSQL database)
  • Python ≥ 3.10

Quick Start

Below is a minimal example creating a GeoImageFrame:

from landlensdb.geoclasses import GeoImageFrame
from shapely.geometry import Point

# Create a simple GeoImageFrame from scratch
geo_frame = GeoImageFrame(
	{
		"image_url": ["https://example.com/image1.jpg"],
		"name": ["SampleImage"],
		"geometry": [Point(-120.5, 35.2)]
	}
)

print(geo_frame.head())

For additional usage examples, see our documentation.

Documentation

Full documentation (including tutorials and advanced usage) is available in this repository's docs/ folder. You can build the docs locally by installing the optional [docs] extras:

pip install -e '.[docs]'
mkdocs serve

Then open http://127.0.0.1:8000/ in your browser.

Developer Guides

Local Development 1. Clone this repository. 2. Install in editable mode with dev extras: pip install --upgrade pip pip install -e .[dev] 3. Make changes as needed and contribute via Pull Requests.

Testing

We use pytest for testing. Tests requires the following test database. Create if does not exist:

createdb landlens_test && psql landlens_test -c "create extension postgis" 

Then, we can run the tests:

pytest tests

You can also run specific test files or functions, for example:

pytest tests/test_geoimageframe.py

Code Formatting & Pre-commit

landlensdb uses Black for formatting. Once you’ve installed [dev] extras:

pre-commit install
pre-commit run --all-files

This enforces linting and formatting on each commit.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines on how to open issues, submit pull requests, and follow our code of conduct.

License

This project is licensed under the MIT License. See LICENSE.md for details.

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

landlensdb-0.1.4.3.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

landlensdb-0.1.4.3-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file landlensdb-0.1.4.3.tar.gz.

File metadata

  • Download URL: landlensdb-0.1.4.3.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for landlensdb-0.1.4.3.tar.gz
Algorithm Hash digest
SHA256 a7b47935edbbf1cec06f62d58e27d60f26f1f2e6a3b9f744dcd7828264dfb8fd
MD5 60dcbd9d0d047eb61305a9c469a8ad15
BLAKE2b-256 4e4142213e6062412b1ddbf2a8ca989c189e5b3a297ff1274bc498308df522a2

See more details on using hashes here.

File details

Details for the file landlensdb-0.1.4.3-py3-none-any.whl.

File metadata

  • Download URL: landlensdb-0.1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for landlensdb-0.1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 865838b31167203df6951b578921203f97610383985a79e093c92b7e877087e5
MD5 f96e8dba9f1f6f7510570556ebbc48f0
BLAKE2b-256 112e88812c562df83ceff0ac1106ed3fdb15354a6da56e5b689c5efa0785e5f4

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