Comments (1)
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)
- Maybe score_bear have some error HOT 4
- Small openlr's dnp(sugesstion) HOT 3
- about SEARCH_RADIUS HOT 7
- about 'LRDecodeError' HOT 1
- About p_off and n_off HOT 2
- The match have more sql HOT 4
- Encoding HOT 3
- via point HOT 2
- Format error in debug log in candidate functions
- Data format validation in candidate_functions HOT 1
- Unused input arg in compute_bearing
- About the speed
- Clarify purpose and status of this repository HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openlr-dereferencer-python.