Skip to main content

Geocodificador asíncrono para Cataluña usando el servicio ICGC

Project description

GeoFinder Logo GeoFinder-ICGC

Geocoder for Catalonia using the ICGC service (Institut Cartogràfic i Geològic de Catalunya). 🔄 Dual API: Native async + sync wrappers for simple scripts.

Python 3.10+ License: GPL-2.0


GeoFinder-ICGC is an advanced geocoder for Catalonia designed to be robust, fast, and easy to use.

🚀 Installation

# Basic installation
pip install geofinder-icgc

# With coordinate transformation support (recommended)
pip install geofinder-icgc[pyproj]

# With MCP server support (AI integration)
pip install geofinder-icgc[mcp]

📖 Quick Start

Synchronous Usage (Simple scripts)

from geofinder import GeoFinder

gf = GeoFinder()
results = gf.find_sync("Barcelona")

for r in results:
    print(f"{r.nom} ({r.nomTipus}) - {r.x}, {r.y}")

Asynchronous Usage (High performance)

import asyncio
from geofinder import GeoFinder

async def main():
    async with GeoFinder() as gf:
        results = await gf.find("Diagonal 100, Barcelona")
        print(f"Found: {len(results)}")

asyncio.run(main())

🔍 Features Guide

1. General Search (find / find_sync)

Automatically detects the search type based on input:

  • Toponyms: "Montserrat", "Girona"
  • Addresses: "Carrer Aragó 50, Barcelona", "Gran Via 123"
  • Coordinates: "430000 4580000 EPSG:25831", "2.17 41.38 EPSG:4326"
  • Roads: "C-32 km 10"
  • Rectangles: "X1 Y1 X2 Y2"

2. Reverse Geocoding (find_reverse / find_reverse_sync)

Find places or addresses from coordinates.

# Supports EPSG:25831 (default) and EPSG:4326 (GPS)
results = await gf.find_reverse(430000, 4580000)

3. Autocomplete (autocomplete / autocomplete_sync)

Ideal for implementing real-time search suggestions.

suggestions = await gf.autocomplete("Barcel")

4. Proximity Search (search_nearby)

Find places within a given radius around a reference point.

# Search everything within 2km of Sagrada Família
nearby = await gf.search_nearby("Sagrada Família, Barcelona", radius_km=2.0)

5. Batch Processing (find_batch / find_reverse_batch)

Execute multiple queries in parallel with optimized concurrency.

queries = ["Barcelona", "Girona", "Lleida", "Tarragona"]
batch_results = await gf.find_batch(queries, max_concurrency=10)

6. Response with Metadata (find_response)

Returns a GeoResponse object that includes results and performance metadata such as execution time.

⚙️ Configuration

The GeoFinder constructor allows customizing the library behavior:

Parameter Type Description
timeout int Maximum wait time (default: 5s).
cache_size int LRU cache capacity (default: 128).
cache_ttl int Cache time-to-live in seconds (default: 3600).
max_retries int Number of retries on failure (default: 3).
verify_ssl bool Verify SSL certificates (default: True).

📚 Documentation


📚 Resources


⚖️ License

Distributed under the GPL-2.0-or-later license. Based on the original ICGC work adapted for standalone use.


© 2025 ICGC / Adapted by Goalnefesh

Small changes are powerful 🤘

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

geofinder_icgc-2.4.2.tar.gz (43.3 kB view details)

Uploaded Source

Built Distribution

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

geofinder_icgc-2.4.2-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file geofinder_icgc-2.4.2.tar.gz.

File metadata

  • Download URL: geofinder_icgc-2.4.2.tar.gz
  • Upload date:
  • Size: 43.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for geofinder_icgc-2.4.2.tar.gz
Algorithm Hash digest
SHA256 113770fa575953d50b15f6bfcd566cc0024e2e5885ea4621ebcc3cc39bbad173
MD5 215fa4ed03f88368104da2fa2c56fbaa
BLAKE2b-256 978896f2f3ed6254ab6661571369297a73c4634fdf6fe842b55f21176e2c19e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for geofinder_icgc-2.4.2.tar.gz:

Publisher: publish.yml on jccamel/geofinder-icgc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file geofinder_icgc-2.4.2-py3-none-any.whl.

File metadata

  • Download URL: geofinder_icgc-2.4.2-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for geofinder_icgc-2.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a258b8d6fce04ebee22ec3e22b934a2d846562d07b24894dd897ee98c9718ab
MD5 3ce91a68a0dde6a9d024e9948ca1a50b
BLAKE2b-256 d9bc51af6a618205737087f6984017d2b528c38494c06ff4ad14b1cb4e3b843c

See more details on using hashes here.

Provenance

The following attestation bundles were made for geofinder_icgc-2.4.2-py3-none-any.whl:

Publisher: publish.yml on jccamel/geofinder-icgc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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