Skip to content

v0.1.0 - First pre-release build for windows :)

Pre-release
Pre-release
Compare
Choose a tag to compare
@thehappycheese thehappycheese released this 06 Feb 15:15
· 57 commits to main since this release

Installation

pip install https://github.com/thehappycheese/megalinref/releases/download/v0.1.0/megalinref-0.1.0-cp39-none-win_amd64.whl

Known Issues

  • cwy is returned in enum form, not as text
  • network_typ is returned in enum form, not as text
  • distance is returned in degrees; it needs to be converted to metres

For up-to-date information on the development roadmap please see Development Progress

Example

import megalinref as mlr

data = mlr.download_fresh_data_as_json()

slk_lookup = mlr.SLKLookup(data)

result = slk_lookup.lookup(
    lat=-31.89006203575722,
    lon=115.80183730752809,
    cwy=mlr.Cwy["L"] | mlr.Cwy["R"],
    network_type=mlr.NetworkType["State Road"] | mlr.NetworkType["Local Road"] 
)

assert result == {
    'feature': {
        'ROAD': 'H016',
        'CWY': 4,
        'START_SLK': 9.84,
        'END_SLK': 10.68,
        'START_TRUE_DIST': 9.84,
        'END_TRUE_DIST': 10.68,
        'NETWORK_TYPE': 1
    },
    'slk': 9.99999981522603,
    'true': 9.99999981522603,
    'distance': 1.064734332392196e-14
}