Starting distance of a route in "create points"

Zingo Andersen's Avatar

Zingo Andersen

13 Dec, 2017 01:53 AM

Would it be possible to instead of starting from "0" or "1" when using "create points" to be able to set route "offset"
e.g. in this "Right click on the line, and choose modify -> create points

I have a caltopo project that concists of 3 separate routes (lines), in my case due to the water crossings and I would like to add mile/kilometer markings but when I do all three starts at 0 (or 1) but I would like them to start where the previous ended at. As this probably is some sort of special case It might be a feature that if added should be behind some "advance" button to not clutter the "create points" dialog, or a starting/offset property that I can add on a line/polygon.

This seem like a simple enough task that I could try to create a contribution for if possible and if you want.

  1. Support Staff 1 Posted by matt on 14 Dec, 2017 04:38 PM

    matt's Avatar

    I guess it wouldn't be too hard to add, but if you are intending these to actually be mile markers, they are going to be off unless your lines are drawn so that the water crossings exist at exact integer distances. The previous line would end at 2.73 or whatever, but just after the water crossing you'd be starting at 3.

    The presently-supported way of doing this would be to combine all 3 lines (right click -> modify -> join with), create the mile/km markers, and then separate the lines again (right click -> modify -> split here). You could also preserve the original lines by copying them as new ones (right click -> modify -> convert), joining the copies, and then just discarding the combined line when done.

  2. 2 Posted by Zingo Andersen on 15 Dec, 2017 01:10 AM

    Zingo Andersen's Avatar

    Hi
    Yes you are correct, some sort of "offset" to the first marker would be needed to make this usable.

    Im thinking of something like this:

    org.sarsoft.RPTForm.prototype.create = function(container) {
        var that = this;
        var div = $('<div style="margin-top: 0.5em"> Create a point every </div>').appendTo(container);
        this.dist = $('<input type="text" size="5"/>').appendTo(div);
        this.units = $('<select><option value="m">meters</option><option value="ft">feet</option><option value="mi">miles</option></select>').appendTo(div);
        div.append(' and prefix them with ');
        this.prefix = $('<input type="text" size="5"/>').appendTo(div);
        div.append(', starting at ');
        //this.start_idx = $('<select><option value="0">0</option><option value="1">1</option></select>').appendTo(div); OLD code replaced
        this.start_idx = $('<input type="text" size="5"/>').appendTo(div);
        div.append(', offseted by ');
        this.start_offset = $('<input type="text" size="5"/>').appendTo(div);
    }
    (And matching changes using/reading/writing this values. This is drycoded as I don't know how to run it, Im not a web developer and saving the webpage to disk and loading it didn't work :) )

    But looking at org.sarsoft.WayObjectController.prototype.routepoint = function(obj, options, override) {
    ...
    var resampled = GeoUtil.resample(path, options.waypoints, options.distance);
    ...

    I'm not so sure that adding the offset would be so easy anymore. The extra fields will also clutter the UI and maybe the usecase is also to small.

    As you say there is ways around it for me. In my case the join trick don't work as the "water crossings" are a few kilomets wide https://caltopo.com/m/9Q7K but there is other tricks I can use like adding one point before and place it the needed distance away before creating the markings and then delete it and the markings on that part. So no worries I just kind of wanted to precent the usecase and add it as a suggestion on a very low prio :)

    Thanks for your input/help and time
    / Zingo

  3. kobe.pole closed this discussion on 18 Jun, 2018 10:32 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac