'How to add new field / manipulate geo data for object created in geotables in Julia

I'm new to Julia - I'm planning to run some simulations that take ages to run in R.

So, I want to add a field to an object I imported with GeoTables. I'm having a lot of trouble finding any information on how to do this.

My original approach was:

# Read shapefile
htDHS_t1_shp = GeoTables.load(htDHS_t1_path) |> GeoData

#%% Displace Coordinates
# Generate a random angle for each feature by generating an angle between 0 and 360, and converting from degrees to radians.

# empty field in dataset_shp
dataset_shp.angle_rand .= []
# calculate new random value for each feature
dataset_shp.angle_rad .= (rand() * 360) * (pi / 180)

I'm not sure if any of this is at all close to being correct. In R, with the sf package, it would just be a simple:

dataset_shp$angle_rad <- (runif(1)*360) * (pi / 180)

But can't seem to figure out how to match this functionality with GeoTables in Julia.

Thanks in advance for any attention!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source