- def full
- @way = Way.includes(:nodes => :node_tags).find(params[:id])
-
- if @way.visible
- visible_nodes = {}
-
- @nodes = []
-
- @way.nodes.uniq.each do |node|
- if node.visible
- @nodes << node
- visible_nodes[node.id] = node
- end
- end
-
- # Render the result
- respond_to do |format|
- format.xml
- format.json
- end
- else
- head :gone
- end
- end
-
- def index
- unless params["ways"]
- raise OSM::APIBadUserInput, "The parameter ways is required, and must be of the form ways=id[,id[,id...]]"
- end
-
- ids = params["ways"].split(",").collect(&:to_i)
-
- raise OSM::APIBadUserInput, "No ways were given to search for" if ids.empty?
-
- @ways = Way.find(ids)
-
- # Render the result
- respond_to do |format|
- format.xml
- format.json
- end
- end
-