Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe need to add tolerance at poffs and noffs. #20

Open
guyanf opened this issue May 6, 2020 · 1 comment
Open

Maybe need to add tolerance at poffs and noffs. #20

guyanf opened this issue May 6, 2020 · 1 comment

Comments

@guyanf
Copy link

guyanf commented May 6, 2020

Hi.
Sorry, Please read next record.
Thanks!

@guyanf
Copy link
Author

guyanf commented May 6, 2020

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.

@guyanf guyanf changed the title May Maybe need to add tolerance at poffs and noffs. May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant