X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/24b21e4a29d28a3174965d449d36465ecda9ead7..25c3310be4c0b497d93e92a4d8141a50c12c4cd2:/lib/osm.rb diff --git a/lib/osm.rb b/lib/osm.rb index 82fc835b4..ae8b81f5b 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -68,6 +68,21 @@ module OSM end end + # raised when a two tags have a duplicate key string in an element. + # this is now forbidden by the API. + class APIDuplicateTagsError < APIError + def initialize(type, id, tag_key) + @type, @id, @tag_key = type, id, tag_key + end + + attr_reader :type, :id, :tag_key + + def render_opts + { :text => "Element #{@type}/#{@id} has duplicate tags with key #{@tag_key}.", + :status => :bad_request } + end + end + # Helper methods for going to/from mercator and lat/lng. class Mercator include Math