- way_ids = Array.new
- ways = Array.new
- segments = Array.new
- nodes = Array.new
-
- # Matching for tags table
- cond_tbl = Array.new
- sql = '1=1'
- if type
- sql += ' AND k=?'
- cond_tbl += [type]
- end
- if value
- sql += ' AND v=?'
- cond_tbl += [value]
- end
- cond_tbl = [sql] + cond_tbl
-
- # Matching for tags column
- if type and value
- cond_tags = ['tags LIKE ? OR tags LIKE ? OR tags LIKE ? OR tags LIKE ?',
- ''+type+'='+value+'',
- ''+type+'='+value+';%',
- '%;'+type+'='+value+';%',
- '%;'+type+'='+value+'' ]
- elsif type
- cond_tags = ['tags LIKE ? OR tags LIKE ?',
- ''+type+'=%',
- '%;'+type+'=%' ]
- elsif value
- cond_tags = ['tags LIKE ? OR tags LIKE ?',
- '%='+value+';%',
- '%='+value+'' ]
- else
- cond_tags = ['1=1']
- end
-
-
- # First up, look for the ids of the ways we want
- if do_ways
- ways_tmp = WayTag.find(:all, :conditions => cond_tbl)
- way_ids = ways_tmp.collect {|way| way.id }
+ if do_nodes
+ response.headers['Error'] = "Searching of nodes is currently unavailable"
+ render :text => "", :status => :service_unavailable
+ return false