civicmapper / flush-it

See how far and where wastewater travels to the Allegheny County Sanitary Authority (ALCOSAN) treatement facility.
http://flush-it.civicmapper.com
MIT License
1 stars 4 forks source link

Order of municipalities from trace #10

Open gassc opened 5 years ago

gassc commented 5 years ago

The sort order of them munis in the results pop-up reflects the basic limitation of the underlying geometric network trace function used in ArcGIS Server: it returns traced records in "database order", not in trace order. There are a couple possible solutions to this:

Option 1: On the client-side, dissolve the trace results using TurfJS in a single line (as best as possible). Traverse vertices of that line top-to-bottom to get intersecting municipalities. (We have some of this code implemented currently).

Option 2: Do the same as Option 1, but on the server side withing the geoprocessing tool. Less work for the client.

Option 3: When publishing the version of the sewer network used for tracing, add a "stream order"-like attribute that can used either in the server-side geoprocessing tool to re-order trace results, or in the client-side trace post-processing steps to get the pipe's position in the network.

gassc commented 5 years ago

(this is not a bug or an above-and-beyond enhancement; just unfinished piece that we'll get to at some point)