docs: prepare English public documentation and preserve license scope

This commit is contained in:
Darío Sevilla committed 2026-10-12 05:06:35 +00:00
1 parent 008e4e3d80
commit f727149369
10 files changed
+192 -180

No files matched your search

+19 -21
View File
@@ -1,41 +1,39 @@
# Explicit destination search (English summary)
# Explicit destination search
Typing in NavFrame searches installed local place catalogs. Online address search requires a separate user action; NavFrame sends the submitted search text to the configured geocoder and does not send GPS as part of that query. The default public Nominatim service is subject to the [OSMF usage policy](https://operations.osmfoundation.org/policies/nominatim/): one request per second aggregated across the application, no client-side autocomplete or systematic bulk queries, and an identifying User-Agent/Referer with attribution. A per-device delay does not satisfy a multi-user aggregate limit. Do not submit sensitive search text to a public service.
Detailed implementation and historical test notes follow in Spanish.
## Implementation contract
# Detailed geocoding notes (Spanish)
Research dated 2026-09-29. NavFrame retains the `Geocoder.search(query)` abstraction, and the user selects a `SearchResult` before route calculation. Typing does not initiate network requests: only Search or an equivalent explicit action does. Searching does not start guidance, replace an active route, or assume the first result is correct.
Investigación del 2026-09-29. NavFrame conserva la abstracción `Geocoder.search(query)` y el usuario selecciona un `SearchResult` antes de calcular ruta. Escribir no inicia red: solo el botón Buscar o acción explícita equivalente. Una búsqueda no inicia navegación, no sustituye una ruta activa y no presupone que el primer resultado sea correcto.
## Public server policy
## Política del servidor público
**Read the [official OSMF Nominatim policy](https://operations.osmfoundation.org/policies/nominatim/) before enabling the public service.** It permits explicit queries with moderate numbers of users; it requires an identifying User-Agent/Referer, attribution, and an absolute maximum of **one request per second aggregated across the entire application**, not per user or phone. Autocomplete, systematic queries, and personal/confidential data are prohibited. The application must be able to change backend without an APK update; a proxy/cache is recommended. Its LLM section requires a deliberate, informed developer decision and prohibits providing it as a generic geocoder for app-generation platforms.
**Leer la [política oficial Nominatim de OSMF](https://operations.osmfoundation.org/policies/nominatim/) antes de activar el servicio público.** Permite consultas explícitas con usuarios moderados; exige User-Agent/Referer identificativo, atribución y máximo absoluto **1 petición/s agregado de toda la aplicación**, no por usuario o teléfono. Prohíbe autocomplete, consultas sistemáticas y datos personales/confidenciales. La app debe poder cambiar backend sin actualizar APK; proxy/cache son recomendados. Su apartado LLM exige una decisión deliberada e informada del desarrollador y prohíbe ofrecerlo como geocoder genérico de plataformas de generación de apps.
The developer brief deliberately selects Nominatim as a possible provider, with explicit search and no abuse. The initial implementation is limited to the personal NavFrame prototype; it is not permission to distribute multiple installations with independent request budgets. Before expanding the user base, use a proxy that limits aggregate traffic or a self-hosted/commercial provider with suitable terms. The screen must show the policy and selected provider. Availability and results are not guaranteed; provider blocking must be respected.
El brief del desarrollador elige conscientemente Nominatim como proveedor posible, con búsqueda explícita y sin abuso. La implementación inicial se limita al prototipo personal NavFrame; no representa permiso para distribuir múltiples instalaciones con presupuestos independientes. Antes de ampliar usuarios, usar un proxy que limite el tráfico agregado o un proveedor propio/comercial con condiciones apropiadas. La pantalla debe mostrar la política y el proveedor seleccionado. No garantiza disponibilidad ni resultados; un bloqueo del proveedor debe respetarse.
## Endpoint and Android HTTP
## Endpoint y HTTP Android
Documented public endpoint: `https://nominatim.openstreetmap.org/search`. Another HTTPS URL **compatible with Nominatim jsonv2** can be selected in settings without recompilation. Removing the public provider must remain possible. The [official Search parameters](https://nominatim.org/release-docs/latest/api/Search/) allow free-form q, jsonv2, limit, and accept-language; the obsolete search.php endpoint is not used.
Endpoint público documentado: `https://nominatim.openstreetmap.org/search`. Otra URL HTTPS **compatible con Nominatim jsonv2** puede seleccionarse en ajustes sin recompilar. Debe ser posible retirar el público como proveedor. Los [parámetros oficiales Search](https://nominatim.org/release-docs/latest/api/Search/) permiten q libre, jsonv2, limit y accept-language; no se usa el endpoint obsoleto search.php.
`nominatimSearchParameters(query)` returns `q` with normalized whitespace, `format=jsonv2`, `limit=5`, `accept-language=es`, and `addressdetails=0`. Android encodes each parameter through the HTTP encoder; do not concatenate unescaped queries. Queries have 2–200 characters, a local UI restriction rather than a service limit. Do not send GPS, viewbox, user identity, or email. User-Agent must identify NavFrame/version rather than the generic HTTP client; the geocoder requires neither X-Client-Id nor UUID.
`nominatimSearchParameters(query)` devuelve `q` con espacios normalizados, `format=jsonv2`, `limit=5`, `accept-language=es`, `addressdetails=0`. Android codifica cada parámetro mediante encoder HTTP; no concatenar consultas sin escapar. La consulta tiene 2–200 caracteres; esto es una limitación UI propia, no del servicio. No enviar GPS, viewbox, identidad del usuario ni email. User-Agent debe identificar NavFrame/version y no el cliente HTTP genérico; el geocoder no requiere X-Client-Id ni UUID.
Allow one request in flight, at least one second between HTTP starts, a timeout, and cancellation when leaving or replacing a search. Do not retry errors or HTTP429 automatically: show a pause and respect Retry-After before a manual action. A search generation must prevent late callbacks from replacing newer results.
Una sola solicitud en vuelo, separación mínima de 1s entre inicios HTTP, timeout y cancelación al salir/sustituir búsqueda. No reintentar automáticamente errores ni HTTP429: mostrar pausa y respetar Retry-After antes de una acción manual. Una generación de búsqueda debe impedir que un callback tardío reemplace resultados más nuevos.
Use a bounded in-memory cache (target: 100 entries/24 hours), keyed by endpoint, normalized query, and language, including empty results. Different queries must not mix; changing endpoint must partition or clear the cache. Destination/address history is not persisted by default. This cache and rate limiter reduce traffic for one installation; they do not solve the global limit when distributed to multiple phones.
Cache de memoria acotada (objetivo 100 entradas/24h) por endpoint, consulta normalizada e idioma; incluir resultados vacíos. Consultas distintas no se mezclan y cambiar endpoint debe separar o limpiar cache. No persiste historial de destinos ni direcciones por defecto. En una instalación este cache y rate limiter reducen tráfico; no resuelven el límite global si se distribuye a múltiples teléfonos.
## Parsing and selection
## Parser y selección
`parseNominatimResults(json)` uses strict Gson and returns `SearchResult(name, position, attribution)`; previous constructors remain available with default attribution. `display_name` describes the destination; lat/lon are finite numeric strings within geographic ranges. The result's `licence` is preserved as text; a standard OSM credit is shown when missing. See the [official output format](https://nominatim.org/release-docs/latest/api/Output/).
`parseNominatimResults(json)` utiliza Gson estricto y devuelve `SearchResult(name, position, attribution)`; conserva constructors anteriores con attribution default. `display_name` describe el destino, lat/lon son strings numéricos finitos con rango geográfico. `licence` del resultado se conserva como texto; si falta se muestra crédito OSM estándar. [Formato de resultados oficial](https://nominatim.org/release-docs/latest/api/Output/).
Responses are limited to 512 Ki characters, at most 40 remote objects, up to five UI results, and labels of 2,048 characters. Android must also limit bytes before loading a String. Exact name/coordinate duplicates and label control characters are removed without interpreting HTML. Invalid JSON/error/status/body produces local messages without the query or coordinates. An empty list means no matches, not failure.
Respuesta limitada a 512Ki caracteres, máximo remoto 40 objetos, hasta cinco resultados para UI y labels de 2048 caracteres. Android debe limitar bytes también antes de cargar String. Se eliminan duplicados exactos nombre/coordenadas y controles del label, sin reinterpretar HTML. JSON/error/status/body incorrectos generan mensajes propios sin consulta ni coordenadas. Una lista vacía significa sin coincidencias, no fallo.
Do not retain place_id as a permanent identity or infer motorcycle access from a city/POI centroid. Show the full name and selected coordinates before calculation; Valhalla may snap the destination to another road position. Search does not guarantee access, parking availability, or site restrictions.
No se guarda place_id como identidad permanente ni se inferirá una entrada apta para moto a partir de un centroide de ciudad/POI. Mostrar el nombre completo y coordenadas de la selección antes de calcular; Valhalla puede ajustar el destino a otra posición de carretera. Búsqueda no garantiza acceso, existencia de aparcamiento ni restricciones del lugar.
## Privacy, attribution, and tests
## Privacidad, créditos y pruebas
The provider receives search text, IP, and HTTP metadata; do not enter private/confidential addresses into the public service. Show `© OpenStreetMap contributors` and a [copyright/ODbL](https://www.openstreetmap.org/copyright) link in results, preserving map credits and remote attribution where appropriate. No Nominatim code is embedded: the adapter/parser are original and consume HTTP. Gson/notices are already distributed in the APK.
El proveedor recibe el texto buscado, IP y metadata HTTP; no escribir direcciones privadas/confidenciales en el servicio público. Mostrar `© OpenStreetMap contributors` y enlace a [copyright/ODbL](https://www.openstreetmap.org/copyright) en resultados, manteniendo crédito de mapas y attribution remoto cuando proceda. No se incorpora código Nominatim: adapter/parser son originales y se consume HTTP. Gson/avisos ya están distribuidos en el APK.
`NominatimGeocodingTest` covers an original jsonv2 fixture, Unicode/antimeridian coordinates, attribution, empty results, duplicates/limits, invalid/non-strict JSON and backend errors, finite string coordinates/ranges, labels, Unicode/escaping parameters, and validation before HTTP. Tests do not run automated public queries. Adapter checks cover caching, rate limits, and cancellation; public availability and actual search quality require independent verification.
`NominatimGeocodingTest` cubre fixture original jsonv2, coordenadas Unicode/antimeridiano, attribution, vacíos, duplicados/límites, JSON inválido/no estricto y errores backend, coordenadas string finitas/rangos, labels, parámetros Unicode/escape y validación antes de HTTP. No se ejecutan consultas públicas automáticas en tests. Las comprobaciones del adapter prueban cache, rate limit y cancelación; disponibilidad pública y calidad real de búsquedas requieren verificaciones independientes.
La fase 6 incluye además un ajuste de recuperación GPS: dos fixes nuevos estables tras pérdida/gap antes de adquirir progreso, sin interpretar el tiempo sin señal como movimiento demostrado. Se valida junto al incremento 0.6, sin alterar el APK 0.5 ya entregado.
Phase 6 also includes a GPS recovery adjustment: two new stable fixes after loss/a gap before acquiring progress, without interpreting time without signal as demonstrated movement. It is validated with increment 0.6, without changing the previously delivered 0.5 APK.