- unless min_lat <= max_lat
- report_error("The minimum latitude must be less than the maximum latitude, but it wasn't")
- return
- end
- unless min_lon >= -180 && min_lat >= -90 && max_lon <= 180 && max_lat <= 90
- report_error("The latitudes must be between -90 and 90, and longitudes between -180 and 180")
+
+ # FIXME um why is this area using a different order for the lat/lon from above???
+ @nodes = Node.find_by_area(min_lat, min_lon, max_lat, max_lon, :conditions => {:visible => true}, :include => :node_tags, :limit => APP_CONFIG['max_number_of_nodes']+1)
+ # get all the nodes, by tag not yet working, waiting for change from NickB
+ # need to be @nodes (instance var) so tests in /spec can be performed
+ #@nodes = Node.search(bbox, params[:tag])
+
+ node_ids = @nodes.collect(&:id)
+ if node_ids.length > APP_CONFIG['max_number_of_nodes']
+ report_error("You requested too many nodes (limit is #{APP_CONFIG['max_number_of_nodes']}). Either request a smaller area, or use planet.osm")