Using Workshop To Create Evacuation Routes As Geospatial Objects

Has anyone previously used workshop to draw routes that create instances of geospatial objects. My end goal is to create workshop app that can be used to create medical evacuation routes than can be displayed in a map. I want the routes to displayed in Gaia eventually.

1 Like

I created a guide here:

https://community.palantir.com/t/creating-a-geospatial-time-series/2614/1

To have the user actually draw the geometry themselves, you can use the regular Map widget and turn on and configure the Drawing Controls.

This will output the drawn geometry into a string variable, that you can then pass into an Action so you can save it back to the ontology, along with other relevant metadata.

You’ll want to make sure that the property to which you write the user-drawn geometry is configured as a Geoshape, which I think is required to get these to show up if you view the object in the Gaia map.

This does bring up a bit of a disconnect, which is that the Variable output from the Workshop map is a FeatureCollection, whereas the values stored in a Geoshape property must be an individual feature. It’s easy to parse out the first feature from the collection with a function like this:

function getFirstFeature(featureCollectionString: string): string {
  const featureCollection = JSON.parse(featureCollectionString);
  const geometry = featureCollection.features?.[0]?.geometry;
  if (!geometry) {
    // throw
  }
  
  return JSON.stringify(geometry);
}