{"id":36,"date":"2014-10-03T11:47:41","date_gmt":"2014-10-03T02:47:41","guid":{"rendered":"http:\/\/parma.csis.u-tokyo.ac.jp\/?page_id=36"},"modified":"2024-03-27T13:09:43","modified_gmt":"2024-03-27T04:09:43","slug":"sample","status":"publish","type":"page","link":"https:\/\/pflow.csis.u-tokyo.ac.jp\/service-registration\/sample","title":{"rendered":"\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9"},"content":{"rendered":"
<\/p>\n
<\/p>
<\/p>\n
WebAPI\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u591a\u5c11\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u77e5\u8b58\u304c\u5fc5\u8981\u3067\u3059\u3002\u4ee5\u4e0b\u306b\u3001Python\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u3054\u7528\u610f\u3044\u305f\u3057\u307e\u3057\u305f\u3002\u3054\u6d3b\u7528\u9802\u3051\u308c\u3070\u5e78\u3044\u3067\u3059\u3002
\u203b\u3053\u306e\u30b3\u30fc\u30c9\u306f\u3001\u3042\u304f\u307e\u3067\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066API\u52d5\u4f5c\u78ba\u8a8d\u306a\u3069\u306b\u3054\u4f7f\u7528\u304f\u3060\u3055\u3044\u3002\u3053\u3061\u3089\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306b\u95a2\u3059\u308b\u304a\u554f\u3044\u5408\u308f\u305b\u306f\u3054\u5bb9\u8d66\u3044\u305f\u3060\u304d\u307e\u3059\u3088\u3046\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n
\u6642\u7a7a\u9593WebAPI\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u306e\u3067\u3001\u5b9f\u884c\u524d\u306b\u30aa\u30f3\u30e9\u30a4\u30f3\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002
\u4e0b\u8a18\u30b5\u30f3\u30d7\u30eb\u306euserid\u3068passwd\u306f\u767b\u9332\u3055\u308c\u305f\u3082\u306e\u3067\u7f6e\u304d\u63db\u3048\u3066\u4e0b\u3055\u3044\u3002<\/p>\n
<\/p>\n\n\n
\u30b9\u30c6\u30c3\u30d71\uff1aJoRAS\u3078\u306e\u767b\u9332\u3000<\/strong>\u6700\u521d\u306b\u3001CSIS\u5171\u540c\u7814\u7a76\u5229\u7528\u30b7\u30b9\u30c6\u30e0JoRAS<\/a>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3092\u5b8c\u4e86\u3055\u305b\u3066\u304f\u3060\u3055\u3044\u3002\u767b\u9332\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001JoRAS\u304b\u3089ID\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u767a\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n \u30b9\u30c6\u30c3\u30d72\uff1a\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u53d6\u5f97\u3000<\/strong>JoRAS\u3067\u767a\u884c\u3055\u308c\u305fID\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001CreateSession API\u3092\u901a\u3058\u3066\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u3053\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u306f\u3001\u4ee5\u964d\u306eAPI\u5229\u7528\u306b\u5fc5\u8981\u306a\u8a8d\u8a3c\u60c5\u5831\u3068\u3057\u3066\u6a5f\u80fd\u3057\u307e\u3059\u3002<\/p>\n\n\n \u00a0<\/p>\n\n\n \u30b9\u30c6\u30c3\u30d73\uff1aAPI\u306e\u5229\u7528\u958b\u59cb\u3000<\/strong>\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3057\u305f\u3089\u3001\u305d\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u7528\u3044\u3066\u3001\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u3084\u305d\u306e\u4ed6\u306eAPI\u6a5f\u80fd\u3092\u5229\u7528\u958b\u59cb\u3067\u304d\u307e\u3059\u3002\u5404API\u306e\u8a73\u7d30\u306a\u4ed5\u69d8\u3068\u5229\u7528\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001WebAPI\u4ed5\u69d8\u66f8<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n <\/p>\n url = ‘https:\/\/pflow-api.csis.u-tokyo.ac.jp\/webapi\/CreateSession’<\/p>\n data = { response = requests.post(url, data=data, verify=False)<\/p>\n if response.status_code == 200: \u30d1\u30e9\u30e1\u30fc\u30bf\u5185\u8a33\u3002\u6771\u4eac\u5927\u5b66\u67cf\u30ad\u30e3\u30f3\u30d1\u30b9(139.93689537, 35.90084483 : \u5343\u8449\u770c\u67cf\u5e02)\u304b\u3089\u6700\u8fd1\u96a3\u306e\u9053\u8def\u30ce\u30fc\u30c9<\/p>\n url = ‘http:\/\/157.82.223.35\/webapi\/GetNearestRoadPoint’<\/p>\n data = { response = requests.post(url, cookies=headers, data=data)<\/p>\n if response.status_code == 200: \u6771\u4eac\u5927\u5b66\u67cf\u30ad\u30e3\u30f3\u30d1\u30b9\uff08139.93689537, 35.90084483 \uff1a\u5343\u8449\u770c\u67cf\u5e02\uff09\u304b\u3089\u3001\u6771\u5927\u99d2\u5834\u30ad\u30e3\u30f3\u30d1\u30b9\uff08139.67729225768124, 35.66361199679843\uff1a\u6771\u4eac\u90fd\u6587\u4eac\u533a\uff09\u3078\u306e\u9053\u8def\u30fb\u9244\u9053\u30fb\u30d0\u30b9\u3092\u4f7f\u3063\u305f\u7d4c\u8def<\/p>\n url = ‘http:\/\/157.82.223.35\/webapi\/GetMixedRoute’<\/p>\n data = { response = requests.post(url, cookies=headers, data=data)<\/p>\n if response.status_code == 200: <\/p>\n","protected":false},"excerpt":{"rendered":" 2024\u5e743\u670827\u65e5\u3088\u308a\u3001\u6642\u7a7a\u9593\u5185\u633fWebAPI\u30b5\u30fc\u30d3\u30b9\u3092\u518d\u958b\u3044\u305f\u3057\u307e\u3057\u305f\u3002\u30c7\u30fc\u30bf\u63d0\u4f9b\u30b5\u30fc\u30d3\u30b9\u306b\u95a2\u3057\u3066\u306f\u3001\u518d\u958b\u6642\u671f\u306f\u672a\u5b9a\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002 WebAPI\u306e\u5229\u7528\u30b5\u30f3\u30d7\u30eb WebAPI\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u591a\u5c11\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u77e5 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":32,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/pflow.csis.u-tokyo.ac.jp\/wp-json\/wp\/v2\/pages\/36"}],"collection":[{"href":"https:\/\/pflow.csis.u-tokyo.ac.jp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pflow.csis.u-tokyo.ac.jp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pflow.csis.u-tokyo.ac.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pflow.csis.u-tokyo.ac.jp\/wp-json\/wp\/v2\/comments?post=36"}],"version-history":[{"count":24,"href":"https:\/\/pflow.csis.u-tokyo.ac.jp\/wp-json\/wp\/v2\/pages\/36\/revisions"}],"predecessor-version":[{"id":1551,"href":"https:\/\/pflow.csis.u-tokyo.ac.jp\/wp-json\/wp\/v2\/pages\/36\/revisions\/1551"}],"up":[{"embeddable":true,"href":"https:\/\/pflow.csis.u-tokyo.ac.jp\/wp-json\/wp\/v2\/pages\/32"}],"wp:attachment":[{"href":"https:\/\/pflow.csis.u-tokyo.ac.jp\/wp-json\/wp\/v2\/media?parent=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\n
API\u30b5\u30f3\u30d7\u30eb<\/h5>\n
CreateSession\u30b5\u30f3\u30d7\u30eb<\/h6>\n
\n
\u3000\u3000’UserID’: userid,
\u3000\u3000’Password’: passwd
}<\/p>\n
\u3000\u3000print(‘Session created successfully’)
\u3000\u3000status, sessionid = response.text.split(‘,’)
\u3000\u3000headers = {‘WebApiSessionID’: sessionid.strip(‘\\r\\n’)}
\u3000\u3000print(“Status:{}, SessionID: {}”.format(status, sessionid))
else:
\u3000\u3000print(‘Failed to post data:’, response.status_code)<\/p>\n<\/blockquote>\nGetNearestRoadPoint \u30b5\u30f3\u30d7\u30eb<\/h6>\n
\n
\u3000\u3000’UnitTypeCode’: ‘2’,
\u3000\u3000’PosLongitude’: ‘139.93689537’,
\u3000\u3000’PosLatitude’: ‘35.90084483’,
\u3000\u3000’RoadKindCode’: ”,
\u3000\u3000’RoadNo’: ”,
}<\/p>\n
status, roadtype, roadid, meshcode, lon, lat = [value for s in response.text.split(‘,’) for value in s.split(‘\\r\\n’) if value]
if status.strip(‘\\r\\n’) == ‘1’:
print(“NearestRoadPoint Detected”)
print(“Status:{}, RoadType: {}, RoadID: {}, MeshCode: {}, Longitude: {}, Latitude: {}”.format(status, roadtype, roadid, meshcode, lon, lat))
else:
print(‘Failed to post data:’, response.status_code)<\/p>\n<\/blockquote>\nGetMixedRoute \u30b5\u30f3\u30d7\u30eb<\/h6>\n
\n
\u3000\u3000’UnitTypeCode’: ‘2’,
\u3000\u3000’StartLongitude’: ‘139.67729225768124’,
\u3000\u3000’StartLatitude’: ‘35.66361199679843’,
\u3000\u3000’GoalLongitude’: ‘139.93601366419756’,
\u3000\u3000’GoalLatitude’: ‘35.90455222566497’,
\u3000\u3000’TransportCode’: ‘3’
}<\/p>\n
\u3000print(‘Mixed Route Search successfully’)
\u3000print(response.text)
else:
\u3000print(‘Failed to post data:’, response.status_code)<\/p>\n<\/blockquote>\n\n\n