Index: ClippingPanelListener.java
===================================================================
--- ClippingPanelListener.java	(revision 5471)
+++ ClippingPanelListener.java	(revision 5472)
@@ -45,6 +45,13 @@
 import org.gvsig.fmap.dal.coverage.datastruct.Extent;
 import org.gvsig.fmap.dal.coverage.exception.ROIException;
 import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
 import org.gvsig.fmap.geom.primitive.Envelope;
 import org.gvsig.fmap.mapcontrol.MapControl;
 import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
@@ -76,6 +83,10 @@
 import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingOptionsPanel;
 import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingResolutionPanel;
 import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingSelectionPanel;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>ClippingPanelListener</code> es una clase donde se recogerán y
@@ -84,6 +95,9 @@
  * @author BorSanZa - Borja Sánchez Zamorano 
  */
 public class ClippingPanelListener implements ActionListener, RectangleListener, ButtonsPanelListener, CoordinatesListener, DataInputContainerListener, IProcessActions {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(ClippingPanelListener.class);
+    
 	private Dimension             dim                     = new Dimension();
 	private AffineTransform       at                      = null;
 	private ClippingPanel         clippingPanel           = null;
@@ -558,10 +572,6 @@
 			return;
 		}
 
-		double[] wcValues = data.getWcCoordinatesToClip();
-		double[] pxValues = data.getPxCoordinatesToClip();
-		boolean pxRound = arePixelsRound(pxValues);
-
 		// Seleccionamos las bandas que se usaran en el recorte a partir de la tabla
 		int countBands = 0;
 		int rowCount = ((CheckBoxModel) getSelectionPanel().getTableContainer().getModel()).getRowCount();
@@ -608,9 +618,94 @@
 		/**
 		 * Preparacion para la generacion del proceso del recorte
 		 */
-		if (getFLayer() == null)
-			return;
+		if (getFLayer() == null){
+		    return;
+		}
+		
+		double[] pxValues = data.getPxCoordinatesToClip();
+        boolean pxRound = arePixelsRound(pxValues);
+        double[] wcValues = data.getWcCoordinatesToClip();
+        
+        if (getFLayer().getCoordTrans() != null) {
 
+            GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+            Envelope envelope = null;
+            Envelope storeEnvelope = null;
+            Envelope projectedEnvelope = null;
+            Extent extent = getFLayer().getDataStore().getExtent();
+
+            try {
+                // Create envelope with coordinates of clip area
+                envelope =
+                    geometryManager.createEnvelope(wcValues[0], wcValues[3], wcValues[2],
+                        wcValues[1], SUBTYPES.GEOM2D);
+
+            } catch (CreateEnvelopeException e) {
+                String errorMessage =
+                    String.format("Can not create envelope with [%1d,%1d,%1d,%1d,%1s] parameters",
+                        wcValues[0], wcValues[3], wcValues[2], wcValues[1], SUBTYPES.GEOM2D);
+                LOG.error(errorMessage, e);
+
+                ThreadSafeDialogsManager tsdm = ToolsSwingLocator.getThreadSafeDialogsManager();
+                tsdm.messageDialog("error_cutting", "_error",
+                    JOptionPane.ERROR_MESSAGE);
+                return;
+            }
+            
+            // Get envelope of raster store
+            try {
+                storeEnvelope =
+                    geometryManager.createEnvelope(extent.getMin().getX(), extent.getMin().getY(),
+                        extent.getMax().getX(), extent.getMax().getY(), SUBTYPES.GEOM2D);
+            } catch (CreateEnvelopeException e) {
+                String errorMessage =
+                    String.format("Can not create envelope with [%1d,%1d,%1d,%1d,%1s] parameters",
+                        extent.getMin().getX(), extent.getMin().getY(), extent.getMax().getX(),
+                        extent.getMax().getY(), SUBTYPES.GEOM2D);
+                LOG.error(errorMessage, e);
+
+                ThreadSafeDialogsManager tsdm = ToolsSwingLocator.getThreadSafeDialogsManager();
+                tsdm.messageDialog("error_cutting", "_error",
+                    JOptionPane.ERROR_MESSAGE);
+                return;
+            }
+            
+            // Reproject to store projection using layer coordinate transform 
+            projectedEnvelope = envelope.convert(getFLayer().getCoordTrans().getInverted());
+            try {
+                // Get instersection to fix projected envelope
+                Geometry intersection =
+                    projectedEnvelope.getGeometry().intersection(storeEnvelope.getGeometry());
+                projectedEnvelope = geometryManager.createEnvelope(SUBTYPES.GEOM2D);
+                projectedEnvelope.add(intersection);
+            } catch (GeometryOperationNotSupportedException | GeometryOperationException e) {
+                String errorMessage =
+                    String.format(
+                        "Can not intersects [%1s] projected envelope with [%1s] store envelope",
+                        projectedEnvelope, storeEnvelope);
+                LOG.error(errorMessage, e);
+
+                ThreadSafeDialogsManager tsdm = ToolsSwingLocator.getThreadSafeDialogsManager();
+                tsdm.messageDialog("error_cutting", "_error",
+                    JOptionPane.ERROR_MESSAGE);
+                return;
+            } catch (CreateEnvelopeException e) {
+                String errorMessage =
+                    String.format("Can not create envelope with [%1s] parameters", SUBTYPES.GEOM2D);
+                LOG.error(errorMessage, e);
+
+                ThreadSafeDialogsManager tsdm = ToolsSwingLocator.getThreadSafeDialogsManager();
+                tsdm.messageDialog("error_cutting", "_error",
+                    JOptionPane.ERROR_MESSAGE);
+                return;
+            }
+
+            wcValues[0] = projectedEnvelope.getLowerCorner().getX();
+            wcValues[3] = projectedEnvelope.getLowerCorner().getY();
+            wcValues[2] = projectedEnvelope.getUpperCorner().getX();
+            wcValues[1] = projectedEnvelope.getUpperCorner().getY();
+        }
+
 		AffineTransform transf = null;
 		if(pxRound && 
 		   ((pxValues[2] - pxValues[0]) == data.getPxWidth()) && 
