Librería geo_tiles y library para tiles y utilidades GIS / Geo tiles and GIS utilities library
Project description
geomtiles
Utilidades para generación y caché de tiles MVT (multi-capa, CoW, filesystem/Redis).
English: Utilities for generating and caching MVT tiles (multi-layer, copy-on-write, filesystem/Redis backends).
Instalación / Installation
pip install geomtiles
Uso rápido / Quickstart
Español:
from geo_tiles import create_session_factory, TileService, LayerConfig
# Crear session factory (asyncpg)
sf = create_session_factory("postgresql+asyncpg://user:pass@host/db")
# Instanciar TileService
svc = TileService(sf)
# Registrar una capa
svc.register_layer(LayerConfig(
name="buildings",
schema="public",
table="buildings_view",
geom_column="geom",
minzoom=10,
maxzoom=20,
))
# Obtener un tile MVT (ejemplo, en contexto async)
# tile_bytes = await svc.get_mvt_tile(TileRequest(z=14, x=8345, y=6000, layers=["public.buildings.geom"]))
English:
from geo_tiles import create_session_factory, TileService, LayerConfig
# Create session factory (asyncpg)
sf = create_session_factory("postgresql+asyncpg://user:pass@host/db")
# Instantiate TileService
svc = TileService(sf)
# Register a layer
svc.register_layer(LayerConfig(
name="buildings",
schema="public",
table="buildings_view",
geom_column="geom",
minzoom=10,
maxzoom=20,
))
# Get an MVT tile (example, in async context)
# tile_bytes = await svc.get_mvt_tile(TileRequest(z=14, x=8345, y=6000, layers=['public.buildings.geom']))
Casos de uso / Use cases
- Servir tiles XYZ MVT a partir de vistas PostGIS: use
TileService.get_mvt_tile()con capas registradas. - Tiles multilayer (composición de varias capas) y caché en disco: configure
FilesystemTileCachey páselo comotile_cacheaTileService. - Consultas WFS-like (GeoJSON): use
FeatureServiceyFeatureRequestpara filtrar porbboxopolygon_wkt.
English:
- Serve XYZ MVT tiles from PostGIS views: use
TileService.get_mvt_tile()with registered layers. - Multilayer tiles (compose several layers) and disk cache: configure
FilesystemTileCacheand pass it astile_cachetoTileService. - WFS-like GeoJSON queries: use
FeatureServiceandFeatureRequestto filter bybboxorpolygon_wkt.
Ejemplos / Examples
Hay ejemplos ejecutables en la carpeta examples/ con instrucciones y scripts:
- Ver examples/README.md para ejemplos completos bilingües (TileService, FeatureService, Cache).
Ejemplo: usar caché en disco sin expiración / Example: disk cache with no expiration
from geo_tiles.utils.tile_cache import FilesystemTileCache
# ttl=0 → no expira en disco
cache = FilesystemTileCache(cache_dir="/var/cache/geomtiles", ttl=0)
svc = TileService(sf, tile_cache=cache)
Más documentación / More documentation
Consulta los docstrings en los módulos geo_tiles.* para detalles de API, tipos y ejemplos adicionales.
English:
See the geo_tiles.* module docstrings for API details, types and more examples.
Licencia / License
Este proyecto se publica bajo la licencia MIT — ver el archivo LICENSE.
English:
This project is released under the MIT license — see the LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geomtiles-0.1.3.tar.gz.
File metadata
- Download URL: geomtiles-0.1.3.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f65ce034fd5ea2184bd6a924493a6ef40a779b32d804e50f90c16e1a3392b8f
|
|
| MD5 |
2a72f1fa68df18b4dabdf78923a7c5f6
|
|
| BLAKE2b-256 |
ea0b5c93180643a839b4261ae361870ec4b0c75029fff63a54bfac9e68f546c5
|
File details
Details for the file geomtiles-0.1.3-py3-none-any.whl.
File metadata
- Download URL: geomtiles-0.1.3-py3-none-any.whl
- Upload date:
- Size: 44.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1878cd2ad232510b2a7d9c6374cf075654f7a886ff57ec5632a8fc3868a68805
|
|
| MD5 |
ec93b1be490a3389ddd597769d674b32
|
|
| BLAKE2b-256 |
90b31e481fbd34f0437e811a95f420330bd3e3d9ed9b781c81b85caf48b1b1d1
|