1.0.20 • Published 3 years ago

ahamove-detect-location-sdk v1.0.20

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Location Detect Library

Location Detect Library (wrong or right) 1. Check Address & Lat, Lng Func : check_address

Input : order_stop_history

  • Lat, Lng of order_stop_history (complete => fallback => lat,lng) (Priority from left to right)
  • Address of order_stop_history

    Output : { lat: lat (order_stop_history) lng: lng (order_stop_history) address: address (order_stop_history) nearest: osrm_driving_nearby matchAddress: float (percent matching) match: boolean }

  1. Detect Order Coordinate - Driver Report Func : correct_address

    Input : order_stop_history

  • Lat, Lng of order_stop_history (complete => fallback => lat,lng) (Priority from left to right)
  • Address of order_stop_history
  • Driver Report point (report_lng, report_lat)

    Output : { lat: lat (order_stop_history) lng: lng (order_stop_history) address: address (order_stop_history) nearest: osrm_driving_nearby matchAddress: float (percent matching) match: boolean

    deletePoint: [] insert / update at wrong_location insertPoints: [] insert vnpost }

How to use

package.json dependencies: { "ahamove-detect-location-sdk": "git+https://git.ahamove.com/ops-tech/location-detect-library.git" }

run.js const detectLocation = require('ahamove-detect-location-sdk')

detectLocation.Init({ osrm_url: 'https://route.ahamove.com/osrm', vnpost_url: 'https://maps.vnpost.vn/api', vnpost_key: '4ac5cd369862d1753ff3c6ca6e07b7cff091e03486d32344', match_percent: 71, near_by_meters: 51 })

let checkAddress = await detectLocation.check_address({JSON_1}) let checkDriverReport = await detectLocation.correct_address({JSON_2})

Example : JSON_1, JSON_2 "{\"cod\": 748000, \"lat\": 10.784263, \"lng\": 106.616902, \"name\": \"cty tín dũ\", \"mobile\": \"0376876176\", \"status\": \"COMPLETED\", \"address\": \"65 Đường số 5, Bình Hưng Hoà A, Bình Tân, Hồ Chí Minh\", \"remarks\": \"65/18/27, Đường số 5, khu phố 6, P.Bình Hưng Hòa, Q. Bình Tân. \", \"adr_source\": \"pelias\", \"complete_lat\": 10.8067505, \"complete_lng\": 106.6028603, \"complete_time\": 1591006705.5579967, \"short_address\": \"65 Đường số 5\"}"