Upload Point Cloud
This example uploads a point cloud dataset.
# Import the Voxel Farm Client Library
from voxelfarm import voxelfarmclient
# The URL for the Voxel Farm API
vf_api_url = os.getenv('YOUR_VOXELFARM_API_URL')
# Create instance of the Voxel Farm REST API
vf = voxelfarmclient.rest(vf_api_url)
# Get the coordinate system of the project
result = vf.get_project_crs(project)
if not result.success:
print(result.error_info)
exit()
crs = result.crs
# Create raw point cloud entity
result = vf.create_entity_raw(
project=project,
type=vf.entity_type.RawPointCloud,
name="My Point Cloud",
fields={},
crs=crs)
if not result.success:
print(result.error_info)
exit()
pc_id = result.id
print('Raw Point Cloud Entity created ' + pc_id)
# Upload files
files = {'file': open('./mockdata/pointcloud.laz', 'rb')}
result = vf.attach_files(
project=project,
id=pc_id,
files=files)
if not result.success:
print(result.error_info)
exit()
print('Point cloud files uploaded.')