X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/24b21e4a29d28a3174965d449d36465ecda9ead7..3e9ceb0c3816a1e13c82914d16abf2997b482751:/lib/osm.rb diff --git a/lib/osm.rb b/lib/osm.rb index 82fc835b4..e9d3c9464 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 @@ -234,7 +249,7 @@ module OSM doc.encoding = 'UTF-8' root = XML::Node.new 'osm' root['version'] = API_VERSION - root['generator'] = 'OpenStreetMap server' + root['generator'] = GENERATOR doc.root = root return doc end