Revision 27238 branches/v10/extensions/DielmoOpenLidar/src/com/dielmo/gvsig/lidar/drivers/LiDARDriver.java
LiDARDriver.java | ||
---|---|---|
220 | 220 |
File file = new File(m_Fich.getAbsolutePath()); |
221 | 221 |
try { |
222 | 222 |
hdr = InicializeLidar.InizializeLidarHeader(file); |
223 |
|
|
223 |
|
|
224 | 224 |
if(hdr == null) |
225 | 225 |
throw new IOException(); |
226 | 226 |
|
... | ... | |
229 | 229 |
if(lp == null) |
230 | 230 |
throw new IOException(); |
231 | 231 |
|
232 |
// la informacion de fullExtent la contiene la cabecera |
|
233 |
fullExtent = new Rectangle2D.Double(hdr.getMinX(), hdr.getMinY(), |
|
234 |
(hdr.getMaxX()-hdr.getMinX()), |
|
235 |
(hdr.getMaxY()-hdr.getMinY())); |
|
236 |
|
|
237 |
// obtiene la estructura de tabla |
|
238 |
fields = getFields(); |
|
239 |
|
|
232 | 240 |
} catch (UnexpectedLidarHeaderException e) { |
233 | 241 |
// TODO Auto-generated catch block |
234 | 242 |
e.printStackTrace(); |
235 | 243 |
} |
236 | 244 |
|
237 |
// la informacion de fullExtent la contiene la cabecera |
|
238 |
fullExtent = new Rectangle2D.Double(hdr.getMinX(), hdr.getMinY(), |
|
239 |
(hdr.getMaxX()-hdr.getMinX()), |
|
240 |
(hdr.getMaxY()-hdr.getMinY())); |
|
241 | 245 |
|
242 |
// obtiene la estructura de tabla |
|
243 |
fields = getFields(); |
|
244 | 246 |
|
245 | 247 |
} |
246 | 248 |
|
... | ... | |
428 | 430 |
return ValueFactory.createValue(((Integer)(o)).intValue()); |
429 | 431 |
} else if(o instanceof Byte){ |
430 | 432 |
return ValueFactory.createValue(((Byte)(o)).byteValue()); |
431 |
} else if(o instanceof Character){ |
|
432 |
return ValueFactory.createValue((byte)((Character)(o)).charValue()); |
|
433 | 433 |
} |
434 | 434 |
|
435 | 435 |
return new NullValue(); |
... | ... | |
552 | 552 |
public void postProcess() throws EditionException { |
553 | 553 |
lidarWriter.postProcess(); |
554 | 554 |
|
555 |
try { |
|
555 |
// if(lidarWriter.getNumPointsDeleted()>0){ |
|
556 |
try { |
|
557 |
|
|
558 |
// close(); |
|
559 |
FileChannel fcinLidar = new FileInputStream(fTemp).getChannel(); |
|
560 |
FileChannel fcoutLidar = new FileOutputStream(m_Fich).getChannel(); |
|
561 |
DriverUtilities.copy(fcinLidar, fcoutLidar); |
|
562 |
|
|
563 |
// Borramos los temporales |
|
564 |
fTemp.delete(); |
|
565 |
//reload(); |
|
556 | 566 |
|
557 |
// close(); |
|
558 |
FileChannel fcinLidar = new FileInputStream(fTemp).getChannel(); |
|
559 |
FileChannel fcoutLidar = new FileOutputStream(m_Fich).getChannel(); |
|
560 |
DriverUtilities.copy(fcinLidar, fcoutLidar); |
|
561 |
|
|
562 |
// Borramos los temporales |
|
563 |
fTemp.delete(); |
|
564 |
//reload(); |
|
565 |
|
|
566 |
} catch (FileNotFoundException e) { |
|
567 |
throw new EditionException(e); |
|
568 |
} catch (IOException e) { |
|
569 |
throw new EditionException(e); |
|
570 |
} |
|
567 |
} catch (FileNotFoundException e) { |
|
568 |
throw new EditionException(e); |
|
569 |
} catch (IOException e) { |
|
570 |
throw new EditionException(e); |
|
571 |
} |
|
572 |
// } |
|
571 | 573 |
} |
572 | 574 |
|
573 | 575 |
// BoundedShapes Methods |
574 | 576 |
public Rectangle2D getShapeBounds(int index) throws IOException { |
575 |
|
|
577 |
|
|
576 | 578 |
Point2D p = new Point2D.Double(); |
577 | 579 |
Rectangle2D BoundingBox = new Rectangle2D.Double(); |
578 |
|
|
580 |
|
|
579 | 581 |
p = lp.readPoint2D(bb, hdr, index); |
580 | 582 |
BoundingBox = new Rectangle2D.Double(p.getX() - 0.1, |
581 | 583 |
p.getY() - 0.1, 0.2, 0.2); |
Also available in: Unified diff