transformSpatial function

Process spatial elements