Index: trunk/psModules/src/objects/pmTrend2D.c
===================================================================
--- trunk/psModules/src/objects/pmTrend2D.c	(revision 25754)
+++ trunk/psModules/src/objects/pmTrend2D.c	(revision 30031)
@@ -179,5 +179,5 @@
 }
 
-bool pmTrend2DFit(pmTrend2D *trend, psVector *mask, psVectorMaskType maskVal, const psVector *x,
+bool pmTrend2DFit(bool *goodFit, pmTrend2D *trend, psVector *mask, psVectorMaskType maskVal, const psVector *x,
                   const psVector *y, const psVector *f, const psVector *df)
 {
@@ -188,5 +188,13 @@
     PS_ASSERT_VECTOR_NON_NULL(f, false);
 
-    bool status;
+    bool status = false;
+    *goodFit = false;
+    // for the psImageMap fit, it is possible to have valid data but no valid solution for
+    // example, an isolated cell may not be reached from other cells, making the solution
+    // degenerate.  psImageMapFit should probably handle this case, but until it does, we allow
+    // it to fail on the result, but not yield an error (goodFit = false).
+    // psVectorClipFitPolynomial2D can not fail in this way (really?), so goodFit is always
+    // true
+
     switch (trend->mode) {
       case PM_TREND_POLY_ORD:
@@ -196,4 +204,5 @@
         // of points in the image, and potentially based on the fractional range of the
         // data?
+	*goodFit = true;
         break;
 
@@ -201,5 +210,5 @@
         // XXX supply fraction from trend elements
         // XXX need to add the API which adjusts the scale
-        status = psImageMapClipFit(trend->map, trend->stats, mask, maskVal, x, y, f, df);
+        status = psImageMapClipFit(goodFit, trend->map, trend->stats, mask, maskVal, x, y, f, df);
         break;
 
