Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 18256)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 18271)
@@ -398,7 +398,15 @@
     }
 
-    public EastNorthBound retrieveCommuneBBox() throws IOException {
+    /**
+     * Retrieve the bounding box size in pixels of the whole commune (point 0,0 at top, left corner)
+     * and store it in given wmsLayer
+     * In case of raster image, we also check in the same http request if the image is already georeferenced
+     * and store the result in the wmsLayer as well. 
+     * @param wmsLayer the WMSLayer where the commune data and images are stored
+     * @throws IOException
+     */
+    public void retrieveCommuneBBox(WMSLayer wmsLayer) throws IOException {
         if (interfaceRef == null)
-            return null;
+            return;
         String ln = null;
         String line = null;
@@ -421,8 +429,11 @@
         in.close();
         urlConn.disconnect();
-        return parseBBoxCommune(line);
-    }
-
-    private EastNorthBound parseBBoxCommune(String input) {
+        parseBBoxCommune(wmsLayer, line);
+        if (wmsLayer.isRaster() && !wmsLayer.isAlreadyGeoreferenced()) {
+            parseGeoreferences(wmsLayer, line);
+        }
+    }
+
+    private void parseBBoxCommune(WMSLayer wmsLayer, String input) {
         if (input.indexOf(cBBoxCommunStart) != -1) {
             input = input.substring(input.indexOf(cBBoxCommunStart));
@@ -435,7 +446,38 @@
             int l = input.indexOf(cBBoxCommunEnd, k+1);
             double maxy = Double.parseDouble(input.substring(k+1, l));
-            return new EastNorthBound(new EastNorth(minx,miny), new EastNorth(maxx,maxy));
-        }
-        return null;
+            wmsLayer.setCommuneBBox( new EastNorthBound(new EastNorth(minx,miny), new EastNorth(maxx,maxy)));
+        }
+    }
+    
+    private void parseGeoreferences(WMSLayer wmsLayer, String input) {
+        if (input.lastIndexOf(cBBoxCommunStart) != -1) {
+            input = input.substring(input.lastIndexOf(cBBoxCommunStart));
+            input = input.substring(input.indexOf(cBBoxCommunEnd)+cBBoxCommunEnd.length());
+            int i = input.indexOf(",");
+            int j = input.indexOf(",", i+1);
+            double angle = Double.parseDouble(input.substring(i+1, j));
+            int k = input.indexOf(",", j+1);
+            double scale_origin = Double.parseDouble(input.substring(j+1, k));
+            int l = input.indexOf(",", k+1);
+            double dpi = Double.parseDouble(input.substring(k+1, l));
+            int m = input.indexOf(",", l+1);
+            double fX = Double.parseDouble(input.substring(l+1, m));
+            int n = input.indexOf(",", m+1);
+            double fY = Double.parseDouble(input.substring(m+1, n));
+            int o = input.indexOf(",", n+1);
+            double X0 = Double.parseDouble(input.substring(n+1, o));
+            int p = input.indexOf(",", o+1);
+            double Y0 = Double.parseDouble(input.substring(o+1, p));
+            if (X0 != 0.0 && Y0 != 0) {
+                wmsLayer.setAlreadyGeoreferenced(true);
+                wmsLayer.fX = fX;
+                wmsLayer.fY = fY;
+                wmsLayer.angle = angle;
+                wmsLayer.X0 = X0;
+                wmsLayer.Y0 = Y0;
+            }
+            System.out.println("parse georef:"+angle+","+scale_origin+","+dpi+","+fX+","+
+                    fY+","+X0+","+Y0);
+        }
     }
 
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 18256)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 18271)
@@ -76,5 +76,8 @@
  *                 - fixed bug of raster image loaded from cache not working on Java1.6
  *                 - improve mouse click bounce detection during georeferencing process
- * 1.4 17-Oct-2009 - add support for new Lambert CC 9 Zones projection 
+ * 1.4 23-Oct-2009 - add support for new Lambert CC 9 Zones projection
+ *                 - add optional crosspieces display on raster image layers
+ *                 - add automatic raster images georeferencing when WMS provides data
+ *                 - re-implement manual adjustment mode in raster image layer  
  */
 public class CadastrePlugin extends Plugin {
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 18256)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 18271)
@@ -57,5 +57,5 @@
                         if (wmsLayer.isRaster()) {
                             // set raster image commune bounding box based on current view (before adjustment)
-                            wmsLayer.setCommuneBBox( grabber.getWmsInterface().retrieveCommuneBBox());
+                            grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer);
                             wmsLayer.setRasterBounds(bounds);
                             // grab new images from wms server into active layer
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java	(revision 18256)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java	(revision 18271)
@@ -44,5 +44,5 @@
                     } else {
                         // set vectorized commune bounding box by opening the standard web window
-                        wmsLayer.setCommuneBBox( grabber.getWmsInterface().retrieveCommuneBBox());
+                        grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer);
                         // if it is the first layer, use the communeBBox as grab bbox
                         if (Main.proj instanceof LambertCC9Zones && Main.map.mapView.getAllLayers().size() == 1 ) {
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java	(revision 18256)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java	(revision 18271)
@@ -94,10 +94,22 @@
         boolean loadedFromCache = downloadWMSPlanImage.waitFinished();
         if (wmsLayer.images.size() == 1 && !loadedFromCache) {
-            mouseClickedTime = System.currentTimeMillis();
-            Main.map.mapView.addMouseListener(this);
-            if (Main.pref.getBoolean("cadastrewms.noImageCropping", false) == false)
-                startCropping();
-            else
-                startGeoreferencing();
+            int reply = JOptionPane.CANCEL_OPTION;
+            if (wmsLayer.isAlreadyGeoreferenced()) {
+                reply = JOptionPane.showConfirmDialog(null,
+                        tr("This image contains georeference data.\n"+
+                                "Do you want to use them ?"),
+                        null,
+                        JOptionPane.YES_NO_OPTION);
+            }
+            if (reply == JOptionPane.OK_OPTION) {
+                transformGeoreferencedImg();
+            } else {
+                mouseClickedTime = System.currentTimeMillis();
+                Main.map.mapView.addMouseListener(this);
+                if (Main.pref.getBoolean("cadastrewms.noImageCropping", false) == false)
+                    startCropping();
+                else
+                    startGeoreferencing();
+            }
         } else // action cancelled or image loaded from cache (and already georeferenced)
             Main.map.repaint();
@@ -310,4 +322,15 @@
     }
 
+    private void transformGeoreferencedImg() {
+        georefpoint1 = new EastNorth(wmsLayer.X0, wmsLayer.Y0);
+        georefpoint2 = new EastNorth(wmsLayer.X0+wmsLayer.fX*wmsLayer.communeBBox.max.getX(),
+                wmsLayer.Y0+wmsLayer.fY*wmsLayer.communeBBox.max.getX());
+        ea1 = new EastNorth(wmsLayer.images.get(0).min.east(), wmsLayer.images.get(0).max.north());
+        EastNorth ea2 = wmsLayer.images.get(0).max;
+        affineTransform(ea1, ea2, georefpoint1, georefpoint2);
+        wmsLayer.saveNewCache();
+        Main.map.mapView.repaint();
+    }
+
     public void mouseEntered(MouseEvent arg0) {
     }
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 18256)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 18271)
@@ -64,4 +64,8 @@
 
     private boolean isRaster = false;
+    
+    private boolean isAlreadyGeoreferenced = false;
+    
+    public double X0, Y0, angle, fX, fY;
 
     private EastNorth rasterMin;
@@ -320,4 +324,12 @@
         if (saveAsPng != null)
             saveAsPng.setEnabled(isRaster);
+    }
+
+    public boolean isAlreadyGeoreferenced() {
+        return isAlreadyGeoreferenced;
+    }
+
+    public void setAlreadyGeoreferenced(boolean isAlreadyGeoreferenced) {
+        this.isAlreadyGeoreferenced = isAlreadyGeoreferenced;
     }
 
