Git Product home page Git Product logo

Comments (1)

guyanf avatar guyanf commented on June 29, 2024

Code in the tools.py.

if path is None:
    resulting_path, p_off, n_off = [], 0, 0
else:
    resulting_path = path[:]
    print('resulting_path:', resulting_path)
    print('first link length:', resulting_path[0].length)
    print('poffs length:', p_off)
    while resulting_path[0].length < p_off:
        p_off -= resulting_path[0].length
        debug(f"removing {resulting_path[0]} because p_off is {p_off}")
        resulting_path.pop(0)
    while resulting_path[-1].length < n_off:
        n_off -= resulting_path[-1].length
        debug(f"removing {resulting_path[-1]} because n_off is {n_off}")
        resulting_path.pop()
    debug(
        f"path[n-1] ({resulting_path[-1]}) seems to be longer than n_off {n_off}"
    )
return resulting_path, p_off, n_off

This is result:
openlr_code: C0oLuRXRVSKUCf3P/0EiZugA
openlr: LineLocation(points=[LocationReferencePoint(lon=104.12688374519348, lat=30.681134462356567, frc=<FRC.FRC4: 4>, fow=<FOW.MULTIPLE_CARRIAGEWAY: 2>, bear=231, lfrcnp=<FRC.FRC4: 4>, dnp=557), LocationReferencePoint(lon=104.12127374519348, lat=30.67922446235657, frc=<FRC.FRC4: 4>, fow=<FOW.MULTIPLE_CARRIAGEWAY: 2>, bear=73, lfrcnp=<FRC.FRC7: 7>, dnp=0)], poffs=0.908203125, noffs=0.001953125)
poffs: 0.908203125
noffs: 0.001953125
resulting_path: [Line with id=42760895 of length 527.836750457563, Line with id=42760896 of length 48.9481183079635, Line with id=42783097 of length 8.50953763106263]
first link length: 527.836750457563
poffs length: 505.869140625
match links: (42760895, 42760896, 42783097)

total dnp is 557, poffs is 0.908203125, so poffs-length is 505 meters
, but first link is 527 meters(other links total about 60 meters) more than poffs-length 505, so first link doesn't remove, but it is not reasonable.

from openlr-dereferencer-python.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.