def create_scene_large_scale(roi_kml, scene_root, world_dir, dem_folder, world_size=500.0, voxel_size=1.0, height_diff=120.0, height_sub=25.0, extension=500.0, land_folder=""): batch.init_process("bvxmCreateSceneXmlLargeScaleProcess") batch.set_input_string(0, roi_kml) batch.set_input_string(1, scene_root) batch.set_input_string(2, world_dir) batch.set_input_string(3, dem_folder) batch.set_input_string(4, land_folder) batch.set_input_float(5, world_size) batch.set_input_float(6, voxel_size) batch.set_input_float(7, height_diff) batch.set_input_float(8, height_sub) batch.set_input_float(9, extension) status = batch.run_process() if status: (id, type) = batch.commit_output(0) n_scenes = batch.get_output_unsigned(id) batch.remove_data(id) return n_scenes else: return 0
def model_dir(scene): batch.init_process("bvxmSceneModelDirProcess") batch.set_input_from_db(0, scene) batch.run_process() (id, type) = batch.commit_output(0) model_dir = batch.get_output_string(id) batch.remove_data(id) return model_dir
def image_mean(img): bvxm_batch.init_process("vilImageMeanProcess") bvxm_batch.set_input_from_db(0,img) bvxm_batch.run_process() (id,type) = bvxm_batch.commit_output(0) mean_val = bvxm_batch.get_output_float(id) bvxm_batch.remove_data(id) return mean_val
def image_mean(img): bvxm_batch.init_process("vilImageMeanProcess") bvxm_batch.set_input_from_db(0, img) bvxm_batch.run_process() (id, type) = bvxm_batch.commit_output(0) mean_val = bvxm_batch.get_output_float(id) bvxm_batch.remove_data(id) return mean_val
def bvxm_load_image(file_path) : bvxm_batch.init_process("vilLoadImageViewProcess"); bvxm_batch.set_input_string(0, file_path); bvxm_batch.run_process(); (id,type) = bvxm_batch.commit_output(0); (ni_id, ni_type) = bvxm_batch.commit_output(1); (nj_id, nj_type) = bvxm_batch.commit_output(2); ni = bvxm_batch.get_output_unsigned(ni_id); nj = bvxm_batch.get_output_unsigned(nj_id); img = dbvalue(id,type); bvxm_batch.remove_data(ni_id) bvxm_batch.remove_data(nj_id) return img, ni, nj;
def bvxm_load_image(file_path): bvxm_batch.init_process("vilLoadImageViewProcess") bvxm_batch.set_input_string(0, file_path) bvxm_batch.run_process() (id, type) = bvxm_batch.commit_output(0) (ni_id, ni_type) = bvxm_batch.commit_output(1) (nj_id, nj_type) = bvxm_batch.commit_output(2) ni = bvxm_batch.get_output_unsigned(ni_id) nj = bvxm_batch.get_output_unsigned(nj_id) img = dbvalue(id, type) bvxm_batch.remove_data(ni_id) bvxm_batch.remove_data(nj_id) return img, ni, nj
def bvxm_load_image_resource(file_path) : bvxm_batch.init_process("vilLoadImageResourceProcess"); bvxm_batch.set_input_string(0, file_path); bvxm_batch.run_process(); (id,type) = bvxm_batch.commit_output(0); (ni_id, ni_type) = bvxm_batch.commit_output(1); (nj_id, nj_type) = bvxm_batch.commit_output(2); ni = bvxm_batch.get_output_unsigned(ni_id); nj = bvxm_batch.get_output_unsigned(nj_id); img = dbvalue(id,type); bvxm_batch.remove_data(ni_id) bvxm_batch.remove_data(nj_id) return img, ni, nj;
def bvxm_load_image_resource(file_path): bvxm_batch.init_process("vilLoadImageResourceProcess") bvxm_batch.set_input_string(0, file_path) bvxm_batch.run_process() (id, type) = bvxm_batch.commit_output(0) (ni_id, ni_type) = bvxm_batch.commit_output(1) (nj_id, nj_type) = bvxm_batch.commit_output(2) ni = bvxm_batch.get_output_unsigned(ni_id) nj = bvxm_batch.get_output_unsigned(nj_id) img = dbvalue(id, type) bvxm_batch.remove_data(ni_id) bvxm_batch.remove_data(nj_id) return img, ni, nj
def bvxm_load_image_resource(file_path): bvxm_batch.init_process("vilLoadImageResourceProcess") bvxm_batch.set_input_string(0, file_path) status = bvxm_batch.run_process() if not status: return None, 0, 0 (id, type) = bvxm_batch.commit_output(0) (ni_id, ni_type) = bvxm_batch.commit_output(1) (nj_id, nj_type) = bvxm_batch.commit_output(2) ni = bvxm_batch.get_output_unsigned(ni_id) nj = bvxm_batch.get_output_unsigned(nj_id) img = dbvalue(id, type) bvxm_batch.remove_data(ni_id) bvxm_batch.remove_data(nj_id) return img, ni, nj
def bvxm_load_image(file_path): bvxm_batch.init_process("vilLoadImageViewProcess") bvxm_batch.set_input_string(0, file_path) status = bvxm_batch.run_process() if not status: return None, 0, 0 (id, type) = bvxm_batch.commit_output(0) (ni_id, ni_type) = bvxm_batch.commit_output(1) (nj_id, nj_type) = bvxm_batch.commit_output(2) ni = bvxm_batch.get_output_unsigned(ni_id) nj = bvxm_batch.get_output_unsigned(nj_id) img = dbvalue(id, type) bvxm_batch.remove_data(ni_id) bvxm_batch.remove_data(nj_id) return img, ni, nj
def create_scene_large_scale(roi_kml, scene_root, world_dir, dem_folder, world_size=500.0, voxel_size=1.0, height_diff=120.0, height_sub=25.0, extension = 500.0, land_folder=""): batch.init_process("bvxmCreateSceneXmlLargeScaleProcess") batch.set_input_string(0, roi_kml) batch.set_input_string(1, scene_root) batch.set_input_string(2, world_dir) batch.set_input_string(3, dem_folder) batch.set_input_string(4, land_folder) batch.set_input_float(5, world_size) batch.set_input_float(6, voxel_size) batch.set_input_float(7, height_diff) batch.set_input_float(8, height_sub) batch.set_input_float(9, extension) status = batch.run_process() if status: (id, type) = batch.commit_output(0) n_scenes = batch.get_output_unsigned(id) batch.remove_data(id) return n_scenes else: return 0
def scene_origin(scene): batch.init_process("bvxmSceneOriginProcess") batch.set_input_from_db(0, scene) batch.run_process() (id, type) = batch.commit_output(0) lower_left_lon = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(1) lower_left_lat = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(2) lower_left_z = batch.get_output_double(id) batch.remove_data(id) return lower_left_lon, lower_left_lat, lower_left_z
def remove_data(id): bvxm_batch.remove_data(id)
def scene_local_box(scene): batch.init_process("bvxmSceneLocalBoxProcess") batch.set_input_from_db(0, scene) batch.run_process() (id, type) = batch.commit_output(0) lower_left_x = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(1) lower_left_y = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(2) upper_right_x = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(3) upper_right_y = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(4) voxel_size = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(5) lower_left_z = batch.get_output_double(id) # min z batch.remove_data(id) (id, type) = batch.commit_output(6) upper_right_z = batch.get_output_double(id) # max z batch.remove_data(id) return lower_left_x, lower_left_y, upper_right_x, upper_right_y, voxel_size, lower_left_z, upper_right_z
def scene_box(scene): batch.init_process("bvxmSceneBoxProcess") batch.set_input_from_db(0, scene) batch.run_process() (id, type) = batch.commit_output(0) lower_left_lon = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(1) lower_left_lat = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(2) lower_left_elev = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(3) upper_right_lon = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(4) upper_right_lat = batch.get_output_double(id) batch.remove_data(id) (id, type) = batch.commit_output(5) upper_right_elev = batch.get_output_double(id) batch.remove_data(id) return lower_left_lon, lower_left_lat, lower_left_elev, upper_right_lon, upper_right_lat, upper_right_elev