Revision 41522

View differences:

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/SHPFileWrite.java
242 242
		drain();
243 243
	}
244 244
	public int writeIGeometry(Geometry g) throws WriteException {
245
            if( g==null ) {
246
                m_shape = SHP.create(0);
247
            } else {
245 248
		int shapeType = getShapeType(g.getType(), g.getGeometryType().getSubType());
246 249
		m_shape = SHP.create(shapeType);
247 250
//		m_shape.setFlatness(flatness);
248 251
		// System.out.println("writeIGeometry: type="+ g.getType());
249
		return writeGeometry(g);
252
            }
253
            return writeGeometry(g);
250 254
	}
251 255

  
252 256
	/**
......
310 314

  
311 315
		if (geometrySubType == Geometry.SUBTYPES.GEOM3D){
312 316
			switch (geometryType) {
317
                        case Geometry.TYPES.NULL:
318
                                return SHP.NULL;
319
                            
313 320
			case Geometry.TYPES.POINT:
314 321
				return SHP.POINT3D;
315 322

  
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/SHPFeatureWriter.java
144 144
    public void append(Feature feature) throws DataException {
145 145

  
146 146
        Geometry theGeom = feature.getDefaultGeometry();
147
        if (theGeom == null) {
148
            theGeom = this.defaultGeometry;
149
        }
150
        if (!canWriteGeometry(theGeom.getType())) {
151
            throw new WriteException(this.name, // FIXME Excepcion correcta
152
                new RuntimeException("UnsupportedGeometryType: "
153
                    + theGeom.getGeometryType().getName()));
154
        }
155
        // numRows++;
156
        super.append(feature);
157

  
158
        // fileSize = shpWrite.writeIGeometry(theGeom);
159
        fileSize = shpWrite.writeIGeometry(theGeom);
160
        Envelope envelope = theGeom.getEnvelope();
161
        if (envelope != null) {
162
            if (this.envelope != null) {
163
                this.envelope.add(envelope);
164
            } else {
165
                this.envelope = envelope;
147
        if (theGeom != null) {
148
            if (!canWriteGeometry(theGeom.getType())) {
149
                throw new WriteException(this.name, // FIXME Excepcion correcta
150
                    new RuntimeException("UnsupportedGeometryType: "
151
                        + theGeom.getGeometryType().getName()));
166 152
            }
153
            super.append(feature);
154
            fileSize = shpWrite.writeIGeometry(theGeom);
155
            Envelope envelope = theGeom.getEnvelope();
156
            if (envelope != null) {
157
                if (this.envelope != null) {
158
                    this.envelope.add(envelope);
159
                } else {
160
                    this.envelope = envelope;
161
                }
162
            }
163
        } else {
164
            super.append(feature);
165
            fileSize = shpWrite.writeIGeometry(theGeom);
167 166
        }
168 167
    }
169 168

  

Also available in: Unified diff