public static List < LasCell > getLasCells ( ASpatialDb db , Envelope envelope , Geometry exactGeometry , boolean doPosition , boolean doIntensity , boolean doReturns , boolean doTime , boolean doColor , int limitTo ) throws Exception { List < LasCell > lasCells = new ArrayList <> ( ) ; String sql = "SELECT " + COLUMN_GEOM + "," + COLUMN_ID + "," + COLUMN_SOURCE_ID + "," + COLUMN_POINTS_COUNT ; if ( doPosition ) sql += "," + COLUMN_AVG_ELEV + "," + // COLUMN_MIN_ELEV + "," + // COLUMN_MAX_ELEV + "," + // COLUMN_POSITION_BLOB ; // if ( doIntensity ) sql += "," + COLUMN_AVG_INTENSITY + "," + // COLUMN_MIN_INTENSITY + "," + // COLUMN_MAX_INTENSITY + "," + // COLUMN_INTENS_CLASS_BLOB ; // if ( doReturns ) sql += "," + COLUMN_RETURNS_BLOB ; if ( doTime ) sql += "," + COLUMN_MIN_GPSTIME + "," + // COLUMN_MAX_GPSTIME + "," + // COLUMN_GPSTIME_BLOB ; if ( doColor ) sql += "," + COLUMN_COLORS_BLOB ; sql += " FROM " + TABLENAME ; if ( exactGeometry != null ) { sql += " WHERE " + db . getSpatialindexGeometryWherePiece ( TABLENAME , null , exactGeometry ) ; } else if ( envelope != null ) { double x1 = envelope . getMinX ( ) ; double y1 = envelope . getMinY ( ) ; double x2 = envelope . getMaxX ( ) ; double y2 = envelope . getMaxY ( ) ; sql += " WHERE " + db . getSpatialindexBBoxWherePiece ( TABLENAME , null , x1 , y1 , x2 , y2 ) ; } if ( limitTo > 0 ) { sql += " LIMIT " + limitTo ; } String _sql = sql ; IGeometryParser gp = db . getType ( ) . getGeometryParser ( ) ; return db . execOnConnection ( conn -> { try ( IHMStatement stmt = conn . createStatement ( ) ; IHMResultSet rs = stmt . executeQuery ( _sql ) ) { while ( rs . next ( ) ) { LasCell lasCell = resultSetToCell ( db , gp , doPosition , doIntensity , doReturns , doTime , doColor , rs ) ; lasCells . add ( lasCell ) ; } return lasCells ; } } ) ; }
Query the las cell table .