After the update of the node-red-contrib-turf repo I thought about re-writing the whole repo or creating a new repo where every turf function gets its own node. I have create a mockup repo here: node-red-contrib-turf-functions
The idea would be to write a script that parses all packages (maybe the index.ts typscript files) of all packages that make sense to have its own node and create the node dynamically based on the typescript definitions.
As some functions like @turf/difference have multiple inputs I thought about referencing incoming messages by the node name so we don't need to have an extra function and/or join node inbetween. Is there a better way to this? Multi inputs are not possible as I read in the forum.
Things I am currently thinking about implementing:
- Custom Validation for every input based on the ts definition (Feature<Polygon | LineString>, Geojson, Coords etc.)
- An additional third tab for the JSON Editor (Edit JSON, Visual Editor, Leaflet Editor) with a LeafletMap where the input feature can be drawn directly (only make leaflet draw handler available which the node accepts as input - e.g. the @turf/difference node would only allow to create a polygon feature or multipolygon features, the @turf/along node would only allow to create a linestring feature)
@dceejay - maybe you have some input on how this could be achieved and give some guidance based on the mockup repo.