Open caver456 opened 3 years ago
Should probably just make a root function addAssignment where line-vs-polygon is an argument; hopefully the argument can be ignored when making a call to edit the assignment / if existingId is specified; will have to see if the sartopo API allows this.
tkdiff shows that the only differences are:
line assignment: geometry->type = LineString geometry->coordinates = points (a list of coord pairs)
area assignment: geometry->type = Polygon geometry->coordinates = [points] (a list of coord pairs, wrapped as a one-element list)
see comment in #116 - the full json must be specified when editing. That doesn't really affect the need to write the wrappers for addAssignment.
right now, the downstream tool needs to remember the assignment style, so it can call either addAreaAssignment or addLineAssignment as needed. When editing an assignment it would be great to just leave the style as-is.