null-geom.patch
org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/impl/AbstractVectorialLegend.java (copia de trabajo) | ||
---|---|---|
38 | 38 |
import org.cresques.cts.IProjection; |
39 | 39 |
import org.slf4j.Logger; |
40 | 40 |
import org.slf4j.LoggerFactory; |
41 | ||
42 | 41 |
import org.gvsig.compat.CompatLocator; |
43 | 42 |
import org.gvsig.compat.print.PrintAttributes; |
44 | 43 |
import org.gvsig.fmap.dal.exception.DataException; |
... | ... | |
72 | 71 |
import org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport; |
73 | 72 |
import org.gvsig.fmap.mapcontext.rendering.symbols.IMultiLayerSymbol; |
74 | 73 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
74 |
import org.gvsig.i18n.Messages; |
|
75 | 75 |
import org.gvsig.tools.ToolsLocator; |
76 | 76 |
import org.gvsig.tools.dispose.DisposableIterator; |
77 | 77 |
import org.gvsig.tools.dynobject.DynStruct; |
... | ... | |
230 | 230 |
} |
231 | 231 |
|
232 | 232 |
it = featureSet.fastIterator(); |
233 |
boolean nullGeomFound = false; |
|
233 | 234 |
// Iteration over each feature |
234 | 235 |
while (!cancel.isCanceled() && it.hasNext()) { |
235 | 236 |
Feature feat = (Feature) it.next(); |
236 | 237 |
Geometry geom = feat.getDefaultGeometry(); |
238 |
if (geom==null) { |
|
239 |
if (!nullGeomFound) { |
|
240 |
// warn if null geometries are found, but only once for the whole loop |
|
241 |
nullGeomFound = true; |
|
242 |
LOG.error(Messages.getText("Null_geometry_found")); |
|
243 |
} |
|
244 |
continue; |
|
245 |
} |
|
237 | 246 |
// Reprojection if needed |
238 | 247 |
if (coordTrans != null) { |
239 | 248 |
geom = geom.cloneGeometry(); |