Index: XMLIO_V2/dev/dev_rv/src4/xmlio/vtk/lscereader.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src4/xmlio/vtk/lscereader.cpp	(revision 236)
+++ XMLIO_V2/dev/dev_rv/src4/xmlio/vtk/lscereader.cpp	(revision 239)
@@ -27,4 +27,7 @@
 #include "inetcdf4_impl.hpp"
 #include "inetcdf4_adv_impl.hpp"
+
+// BibliothÃšque C++
+#include <algorithm>
 
 // Type Fortran
@@ -609,16 +612,18 @@
                                             const vtkStdString & ycoordinate,
                                             const vtkStdString & zcoordinate,
-                                            bool bounds, bool proj, std::size_t nbvertex,
+                                            bool bounds, bool proj, bool clean, std::size_t nbvertex,
                                             vtkCellArray * cells, vtkPoints * points,
                                             vtkIntArray * dimensions)
       {
-         float value[3];
+         float  value[3], range[2];
          double h = 1.0;
-         double cartesianCoord[3];
+         double cartesianCoord[3], vbounds[6];
          vtkIdType pts[nbvertex] ;
          bool is2D = true;
          ARRAY_CREATE(xvalue, float, 1, [1]);
          ARRAY_CREATE(yvalue, float, 1, [1]);
-         vtkSmartPointer<vtkFloatArray> zspacing = vtkSmartPointer<vtkFloatArray>::New();
+         vtkSmartPointer<vtkPointLocator> locator = vtkSmartPointer<vtkPointLocator>::New();
+         vtkSmartPointer<vtkFloatArray> zspacing  = vtkSmartPointer<vtkFloatArray>::New();
+         
          if (zcoordinate.size() > 0)
          {
@@ -628,4 +633,6 @@
          else
             zspacing->InsertNextValue(0);
+         
+         zspacing->GetValueRange (range);
 
          std::size_t size = (*Reader->getDimensions(&xcoordinate).begin()).second;
@@ -634,4 +641,14 @@
             vtkStdString boundid = Reader->getBoundsId(xcoordinate);
             Reader->readData(*xvalue, boundid);
+            if (!proj)
+            {
+               vbounds[0] = *std::min_element(xvalue->begin(), xvalue->end());
+               vbounds[1] = *std::max_element(xvalue->begin(), xvalue->end());
+            }
+            else
+            {
+               vbounds[0] = -h;
+               vbounds[1] = h;
+            }
          }
          if (Reader->hasBounds(ycoordinate))
@@ -639,6 +656,27 @@
             vtkStdString boundid = Reader->getBoundsId(ycoordinate);
             Reader->readData(*yvalue, boundid);
-         }
-
+            if (!proj)
+            {
+               vbounds[2] = *std::min_element(yvalue->begin(), yvalue->end());
+               vbounds[3] = *std::max_element(yvalue->begin(), yvalue->end());
+            }
+            else
+            {
+               vbounds[2] = -h;
+               vbounds[3] = h;
+            }
+         }
+         if (!proj)
+         {
+            vbounds[4] = range[0];
+            vbounds[5] = range[1];
+         }
+         else
+         {
+            vbounds[4] = -h;
+            vbounds[5] = h;
+         }
+         locator->InitPointInsertion(points, vbounds, size * zspacing->GetNumberOfTuples() * nbvertex); 
+         
          for (std::size_t u = 0; u < size; u++)
          {
@@ -660,9 +698,14 @@
                      cartesianCoord[1] = h * sin(value[0]) * cos(value[1]);
                      cartesianCoord[2] = h * sin(value[1]);
-                     points->InsertPoint (pts[w], cartesianCoord);
+                     if (clean) locator->InsertUniquePoint (cartesianCoord, pts[w]);
+                     else points->InsertPoint (pts[w], cartesianCoord);
                   }
                   else
                   {
-                     points->InsertPoint (pts[w], value);
+                     cartesianCoord[0] = value[0];
+                     cartesianCoord[1] = value[1];
+                     cartesianCoord[2] = value[2];
+                     if (clean) locator->InsertUniquePoint (cartesianCoord, pts[w]);
+                     else points->InsertPoint (pts[w], cartesianCoord);
                   }
                }
@@ -780,9 +823,7 @@
             //std::cout << Reader->getVertCoordName(*VarNames.begin()) << std::endl;
             
-            std::cout << Reader->getNbVertex(*VarNames.begin()) << std::endl;
-            
             GetCellsAndPoints(Reader->getLonCoordName(*VarNames.begin()),
                               Reader->getLatCoordName(*VarNames.begin()),
-                              Reader->getVertCoordName(*VarNames.begin()), true, true,
+                              Reader->getVertCoordName(*VarNames.begin()), true, false, true,
                               Reader->getNbVertex(*VarNames.begin()), cells, pts, dims);
             
