Module: OvertureMaps::GERS
- Defined in:
- lib/overture_maps/gers.rb
Overview
GERS — Overture's Global Entity Reference System. IDs are dashed UUIDs (since June 2025); earlier releases used 32-char undashed hex.
Constant Summary collapse
- UUID_FORMAT =
/\A\h{8}-\h{4}-\h{4}-\h{4}-\h{12}\z/- LEGACY_FORMAT =
/\A\h{32}\z/
Class Method Summary collapse
-
.lookup(id) ⇒ Object
Looks an id up in the official registry (the unversioned source of truth for all published GERS ids).
- .valid_id?(id) ⇒ Boolean
Class Method Details
.lookup(id) ⇒ Object
Looks an id up in the official registry (the unversioned source of truth for all published GERS ids). Returns a hash with keys like "version", "first_seen", "last_seen", "last_changed", "path", "bbox", or nil when unknown. Scans registry parquet on S3 — takes seconds.
19 20 21 22 23 24 25 26 27 |
# File 'lib/overture_maps/gers.rb', line 19 def lookup(id) raise ArgumentError, "not a GERS id: #{id.inspect}" unless valid_id?(id) source = "#{OvertureMaps.configuration.s3_uri.chomp("/")}/registry/*.parquet" rows = QueryEngine.instance.query( "SELECT * FROM read_parquet('#{source}') WHERE id = ? LIMIT 1", [id] ) rows.first end |
.valid_id?(id) ⇒ Boolean
11 12 13 |
# File 'lib/overture_maps/gers.rb', line 11 def valid_id?(id) id.is_a?(String) && (id.match?(UUID_FORMAT) || id.match?(LEGACY_FORMAT)) end |