Index: /anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py
===================================================================
--- /anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py	(revision 4253)
+++ /anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py	(revision 4254)
@@ -21,4 +21,5 @@
 from anuga.geospatial_data.geospatial_data import Geospatial_data
 from anuga.fit_interpolate.fit import fit_to_mesh
+from anuga.config import points_file_block_line_size as default_block_line_size
 
 class Quantity:
@@ -356,7 +357,12 @@
                                         use_cache = use_cache)
         elif filename is not None:
+            if hasattr(self.domain, 'points_file_block_line_size'):
+                max_read_lines = self.domain.points_file_block_line_size
+            else:
+                max_read_lines = default_block_line_size
             self.set_values_from_file(filename, attribute_name, alpha,
                                       location, indices,
                                       verbose = verbose,
+                                      max_read_lines=max_read_lines,
                                       use_cache = use_cache)
         else:
@@ -738,5 +744,5 @@
         coordinates = self.domain.get_nodes(absolute=True)
         triangles = self.domain.triangles      #FIXME
-       
+            
         vertex_attributes = fit_to_mesh(coordinates, triangles,filename,
                                         alpha=alpha,
Index: /anuga_core/source/anuga/config.py
===================================================================
--- /anuga_core/source/anuga/config.py	(revision 4253)
+++ /anuga_core/source/anuga/config.py	(revision 4254)
@@ -129,2 +129,5 @@
 
 minimum_storable_height = 1.0e-5 #Water depth below which it is *stored* as 0
+
+points_file_block_line_size = 500 # Number of lines read in from a points file
+                                  # when blocking
Index: /anuga_core/source/anuga/geospatial_data/geospatial_data.py
===================================================================
--- /anuga_core/source/anuga/geospatial_data/geospatial_data.py	(revision 4253)
+++ /anuga_core/source/anuga/geospatial_data/geospatial_data.py	(revision 4254)
@@ -20,6 +20,6 @@
 from anuga.coordinate_transforms.redfearn import convert_from_latlon_to_utm
 from anuga.utilities.anuga_exceptions import ANUGAError
-
-MAX_READ_LINES = 500        
+from anuga.config import points_file_block_line_size as MAX_READ_LINES    
+
 class Geospatial_data:
 
Index: /anuga_core/source/anuga/shallow_water/data_manager.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/data_manager.py	(revision 4253)
+++ /anuga_core/source/anuga/shallow_water/data_manager.py	(revision 4254)
@@ -4427,6 +4427,6 @@
     geo = URS_points_needed(boundary_polygon, ll_lat, ll_long, grid_spacing, 
                       lat_amount, long_amount, zone=zone)
-    if not file[-4:] == ".urs":
-        file += ".urs"
+    if not file_name[-4:] == ".urs":
+        file_name += ".urs"
     geo.export_points_file(file_name)
     
@@ -4444,4 +4444,5 @@
 
     """
+    
     from sets import ImmutableSet
     
Index: /anuga_core/source/anuga/shallow_water/shallow_water_domain.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/shallow_water_domain.py	(revision 4253)
+++ /anuga_core/source/anuga/shallow_water/shallow_water_domain.py	(revision 4254)
@@ -227,4 +227,14 @@
 
 
+    def set_points_file_block_line_size(self,points_file_block_line_size):
+        """
+        Set the minimum depth that will be recognised when writing
+        to an sww file. This is useful for removing thin water layers
+        that seems to be caused by friction creep.
+
+        The minimum allowed sww depth is in meters.
+        """
+        self.points_file_block_line_size = points_file_block_line_size
+        
     def set_quantities_to_be_stored(self, q):
         """Specify which quantities will be stored in the sww file.
Index: /anuga_core/source/anuga/shallow_water/test_data_manager.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/test_data_manager.py	(revision 4253)
+++ /anuga_core/source/anuga/shallow_water/test_data_manager.py	(revision 4254)
@@ -5092,4 +5092,17 @@
                 assert False
         
+    
+    def dave_test_URS_points_needed(self):
+        ll_lat = -21.51667
+        ll_long = 114.51667
+        grid_spacing = 2./60.
+        lat_amount = 15
+        long_amount = 15
+
+       
+        boundary_polygon = [[250000,7660000],[280000,7660000],
+                             [280000,7630000],[250000,7630000]]
+        URS_points_needed_to_file('a_test_example',boundary_polygon, ll_lat, ll_long, grid_spacing, \
+                      lat_amount, long_amount)
         
     def X_test_URS_points_neededII(self):
@@ -5101,4 +5114,5 @@
 
         # change this so lats and longs are inputed, then converted
+        
         #boundary_polygon = [[7660000,250000],[7660000,280000],
         #                     [7630000,280000],[7630000,250000]]
@@ -5110,8 +5124,8 @@
 #-------------------------------------------------------------
 if __name__ == "__main__":
-    suite = unittest.makeSuite(Test_Data_Manager,'test_URS_points_needed')
-    #suite = unittest.makeSuite(Test_Data_Manager,'test_get_min_max_indexes_lat_ascending')
+    #suite = unittest.makeSuite(Test_Data_Manager,'test_URS_points_needed')
+    #suite = unittest.makeSuite(Test_Data_Manager,'dave_test_URS_points_needed')
     #suite = unittest.makeSuite(Test_Data_Manager,'test_ferret2sww_lat_long')
-    #suite = unittest.makeSuite(Test_Data_Manager,'test')
+    suite = unittest.makeSuite(Test_Data_Manager,'test')
     runner = unittest.TextTestRunner()
     runner.run(suite)
