Search the offline map and Wikipedia, nearest results first
CI / check (push) Successful in 26s
CI / deploy (push) Successful in 33s

Every named OSM object in each country's Geofabrik extract goes into a
SQLite FTS5 index (data/places/<CODE>.sqlite, lib/maptool/places.rb),
built as the last offline-build step or on its own with
rake places:index. Kiwix full-text search is another source; clicking a
hit opens the article. Results from every source are sorted by distance
from the map center (settlements weighted closer) and show it; each
source is queried separately so a slow one doesn't hold up the list.
This commit is contained in:
randy committed 2026-11-12 12:13:13 +01:00
1 parent ba9c40ac3d
commit 3f973a26d7
14 files changed
+549 -90

No files matched your search

+14
View File
@@ -40,6 +40,20 @@ namespace :hiking do
end
end
namespace :places do
desc "Build the offline place-search index (data/places/<CODE>.sqlite) from every already-downloaded " \
"Geofabrik extract in data/geofabrik_cache, without a full offline build. Countries whose index is " \
"already newer than their extract are skipped. Usage: rake places:index [MAPTOOL_DATA_DIR=data]"
task :index do
require_relative "lib/maptool/pmtiles_builder"
data_dir = ENV.fetch("MAPTOOL_DATA_DIR", File.join(__dir__, "data"))
puts "Indexing places from #{data_dir}/geofabrik_cache..."
countries = Maptool::PmtilesBuilder.index_cached_places(data_dir)
puts "Place index available for: #{countries.empty? ? "(none)" : countries.join(", ")}"
end
end
namespace :gpx do
desc "Backfill properties.id on Note-category features saved before edit/delete (and its id targeting) existed"
task :backfill_note_ids do