Revision 34899 branches/v2_0_0_prep/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreProvider.java
DWGStoreProvider.java | ||
---|---|---|
258 | 258 |
store.setFeatureTypes(dwgData.fTypes, dwgData.defaultFType); |
259 | 259 |
legendBuilder = dwgData.legendBuilder; |
260 | 260 |
setDynValue("Envelope", dwgData.getEnvelopeCopy()); |
261 |
setDynValue("CRS", projection.getAbrev());
|
|
261 |
setDynValue("CRS", projection); |
|
262 | 262 |
counterNewsOIDs = data.size(); |
263 | 263 |
return null; |
264 | 264 |
} |
... | ... | |
307 | 307 |
private LegendBuilder leyendBuilder; |
308 | 308 |
private AbstractMemoryStoreProvider store; |
309 | 309 |
private Envelope envelope; |
310 |
private DwgFile dwgFeatureFile; |
|
310 | 311 |
|
311 | 312 |
public Reader initialice(AbstractMemoryStoreProvider store, File file, |
312 | 313 |
IProjection projection, |
... | ... | |
326 | 327 |
return this.envelope; |
327 | 328 |
} |
328 | 329 |
|
329 |
public void begin(FeatureStoreProviderServices store) { |
|
330 |
public void begin(FeatureStoreProviderServices store) throws UnsupportedDWGVersionException, ReadException { |
|
331 |
dwgFeatureFile = new DwgFile(file.getAbsolutePath()); |
|
330 | 332 |
|
333 |
try { |
|
334 |
dwgFeatureFile.read(); |
|
335 |
} catch (DwgVersionNotSupportedException e1) { |
|
336 |
throw new UnsupportedDWGVersionException(file.getName(), e1); |
|
337 |
} catch (IOException e) { |
|
338 |
throw new ReadException(NAME, e); |
|
339 |
} |
|
340 |
|
|
331 | 341 |
EditableFeatureType featureType = store.createFeatureType(); |
332 | 342 |
|
333 | 343 |
featureType.setHasOID(true); |
... | ... | |
340 | 350 |
NAME_FIELD_GEOMETRY, DataTypes.GEOMETRY); |
341 | 351 |
attr.setSRS(this.projection); |
342 | 352 |
attr.setGeometryType(Geometry.TYPES.GEOMETRY); |
353 |
boolean is3dFile = dwgFeatureFile.isDwg3DFile(); |
|
354 |
if (is3dFile){ |
|
355 |
attr.setGeometrySubType(Geometry.SUBTYPES.GEOM3D); |
|
356 |
}else{ |
|
357 |
attr.setGeometrySubType(Geometry.SUBTYPES.GEOM2D); |
|
358 |
} |
|
343 | 359 |
ID_FIELD_GEOMETRY = attr.getIndex(); |
344 | 360 |
|
345 | 361 |
featureType.setDefaultGeometryAttributeName(NAME_FIELD_GEOMETRY); |
... | ... | |
424 | 440 |
|
425 | 441 |
this.envelope = null; |
426 | 442 |
|
427 |
DwgFile dwgFeatureFile = new DwgFile(file.getAbsolutePath()); |
|
428 |
|
|
429 |
try { |
|
430 |
dwgFeatureFile.read(); |
|
431 |
} catch (DwgVersionNotSupportedException e1) { |
|
432 |
throw new UnsupportedDWGVersionException(file.getName(), e1); |
|
433 |
} catch (IOException e) { |
|
434 |
throw new ReadException(NAME, e); |
|
435 |
} |
|
436 |
|
|
437 |
|
|
443 |
|
|
438 | 444 |
dwgFeatureFile.calculateGisModelDwgPolylines(); |
439 | 445 |
dwgFeatureFile.blockManagement2(); |
440 | 446 |
List entities = dwgFeatureFile.getDwgObjects(); |
... | ... | |
443 | 449 |
try{ |
444 | 450 |
int envelopeSubType = Geometry.SUBTYPES.GEOM2D; |
445 | 451 |
boolean is3dFile = dwgFeatureFile.isDwg3DFile(); |
446 |
// if (is3dFile) { |
|
447 |
// envelopeSubType = Geometry.SUBTYPES.GEOM3D; |
|
448 |
// } |
|
449 | 452 |
|
450 | 453 |
this.envelope = geomManager.createEnvelope(envelopeSubType); |
451 | 454 |
|
Also available in: Unified diff