Revision 41808 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.shp/src/main/java/org/gvsig/fmap/dal/store/shp/utils/SHPFile2.java

View differences:

SHPFile2.java
90 90

  
91 91
    private boolean useNullGeometry = false;
92 92

  
93
    private boolean allowInconsistenciesInGeometryTypeWarningShow = false;
94
    
93 95
    public SHPFile2(SHPStoreParameters params) {
94 96
        this.params = params;
95 97
        try {
......
333 335
        return SUBTYPES.UNKNOWN;
334 336
    }
335 337

  
336
    private Geometry getNullGeometry() throws CreateGeometryException {
338
    public Geometry getNullGeometry() throws CreateGeometryException {
337 339
        if (this.useNullGeometry) {
338 340
            return gtypeNull.create();
339 341
        }
......
369 371
         * huge (absurd) array, so it's safer to return a null geometry
370 372
         */
371 373
        if (shapeType != type) {
372
            return getNullGeometry();
374
            if( !allowInconsistenciesInGeometryTypeWarningShow ) {
375
                logger.warn("Geometry type of Shape ("+type+") does not match the geometry found ("+shapeType+") in the shape '"+this.params.getSHPFileName()+".");
376
                allowInconsistenciesInGeometryTypeWarningShow = true;
377
            }
378
            if( ! this.params.getAllowInconsistenciesInGeometryType() ) {
379
                return getNullGeometry();
380
            }
373 381
        }
374 382

  
375 383
        Geometry geometry;

Also available in: Unified diff