সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ইউরোপিয়ান ইকোনমিক এরিয়া (EEA) ডেভেলপার
রুট অপ্টিমাইজেশান API দুটি পদ্ধতি প্রকাশ করে:
OptimizeTours হল একটি সিঙ্ক্রোনাস পদ্ধতি যা একটি OptimizeToursRequest এর প্রতিক্রিয়া হিসাবে একটি অপ্টিমাইজ করা রুট প্রদান করে। ক্লায়েন্টদের অবশ্যই রুট অপ্টিমাইজেশান API এর সাথে একটি খোলা সংযোগ বজায় রাখতে হবে যতক্ষণ না অনুরোধটি প্রক্রিয়া করা হয় এবং একটি OptimizeToursResponse বা ত্রুটি ফিরে না আসে।
BatchOptimizeTours হল একটি অ্যাসিঙ্ক্রোনাস পদ্ধতি যা এক বা একাধিক OptimizeToursRequest এবং সংশ্লিষ্ট OptimizeToursResponse বার্তাগুলির জন্য URI গ্রহণ করে, একটি লং রানিং অপারেশন (LRO) ( REST , gRPC ) এর রিসোর্স নাম ফেরত দেয় যা ব্যাচের সমাপ্তি পরীক্ষা করতে ব্যবহৃত হয়। OptimizeToursRequest গুলি ব্যাকগ্রাউন্ডে প্রক্রিয়া করা হয়, তাই ক্লায়েন্টরা রুট অপ্টিমাইজেশান API-এর সাথে একটি খোলা সংযোগ বজায় রাখে শুধুমাত্র BatchOptimizeToursRequest জমা দেওয়ার জন্য বা LRO স্থিতি পরীক্ষা করতে GetOperation কল করার জন্য। BatchOptimizeToursGoogle ক্লাউড স্টোরেজ থেকে অনুরোধ পড়ে এবং প্রতিক্রিয়া লেখে।
কেস ব্যবহার করুন
OptimizeTours ছোট এবং সাধারণ অনুরোধগুলি সমাধান করার জন্য বা কয়েক মিনিট বা তার কম সময়ের সমাধানের অনুরোধগুলির জন্য সুবিধাজনক৷ রুট অপ্টিমাইজেশান এপিআই-এর সাথে দীর্ঘস্থায়ী সংযোগ বজায় রাখা একটি সমাধান ফেরত দেওয়ার আগে বাধার ঝুঁকি বাড়ায়।
BatchOptimizeTours বৃহত্তর অনুরোধ এবং অনুরোধগুলি দীর্ঘ সমাধানের সময় সহ পরিচালনা করতে পারে কারণ এটির জন্য রুট অপ্টিমাইজেশান API-এর সাথে দীর্ঘস্থায়ী সংযোগের প্রয়োজন হয় না।
দীর্ঘ চলমান অপারেশন
একটি ব্যাচের সমাপ্তির স্থিতি পরীক্ষা করার জন্য GetOperation পদ্ধতি ব্যবহার করে রুট অপ্টিমাইজেশান API থেকে LROগুলি পড়া হয়৷ LROs-এর মধ্যে একটি done সম্পত্তি রয়েছে যা নির্দেশ করে যে পুরো ব্যাচের প্রক্রিয়াকরণ সম্পূর্ণ হয়েছে কিনা এবং একটি error ক্ষেত্র যা প্রক্রিয়াকরণের সময় ত্রুটিগুলি রিপোর্ট করে। যদি done সত্য হয় এবং কোন error উপস্থিত না থাকে, ব্যাচটি সফলভাবে সম্পন্ন হয়। একটি error উপস্থিতি নির্দেশ করে যে ব্যাচের কিছু বা সমস্ত প্রক্রিয়াকরণ ব্যর্থ হয়েছে৷
একটি BatchOptimizeTours অনুরোধের সাধারণ জীবনচক্র নিম্নরূপ:
রুট অপ্টিমাইজেশান এপিআইতে একটি BatchOptimizeToursRequest জমা দিন, যা একটি LRO-এর রিসোর্স নাম প্রদান করে।
প্রত্যাবর্তিত এলআরও রিসোর্স নামের সাথে পোল GetOperation যতক্ষণ না LRO প্রতিক্রিয়াতে done বা error বৈশিষ্ট্যগুলি উপস্থিত হয়।
যদি done সত্য হয় এবং কোনো ত্রুটি উপস্থিত না থাকে, তাহলে BatchOptimizeTours অনুরোধে উল্লেখ করা Google ক্লাউড স্টোরেজ URI থেকে OptimizeToursResponses পড়ুন। error উপস্থিত থাকলে, ত্রুটিটি পরিদর্শন করুন, Google ক্লাউড স্টোরেজে সেই অনুযায়ী OptimizeToursRequest গুলি আপডেট করুন এবং পর্যবেক্ষণ করা ত্রুটির উপর নির্ভর করে যথাযথভাবে পুনরায় চেষ্টা করুন৷
আপনি কমান্ড লাইন থেকে বা ক্লায়েন্ট লাইব্রেরি ব্যবহার করে বিভিন্ন উপায়ে OptimizeTours এবং BatchOptimizeTours অনুরোধ পাঠাতে পারেন।
[null,null,["2025-09-04 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe Route Optimization API offers two methods: \u003ccode\u003eOptimizeTours\u003c/code\u003e for synchronous processing of smaller, simpler requests and \u003ccode\u003eBatchOptimizeTours\u003c/code\u003e for asynchronous handling of larger, more complex requests.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eOptimizeTours\u003c/code\u003e requires an open connection until a response is received, while \u003ccode\u003eBatchOptimizeTours\u003c/code\u003e utilizes Google Cloud Storage for requests and responses, enabling background processing.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBatchOptimizeTours\u003c/code\u003e relies on Long Running Operations (LROs) to track batch progress, which can be monitored via the \u003ccode\u003eGetOperation\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eWhen using \u003ccode\u003eBatchOptimizeTours\u003c/code\u003e, users should submit the request, poll for completion using the LRO, and retrieve results or address errors as indicated by the LRO status.\u003c/p\u003e\n"]]],[],null,["# Synchronous and asynchronous endpoints\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nThe Route Optimization API exposes two methods:\n\n- `OptimizeTours` is a *synchronous* method that returns an optimized route in response to an `OptimizeToursRequest`. Clients must maintain an open connection to the Route Optimization API until the request is processed and an `OptimizeToursResponse` or error is returned.\n- `BatchOptimizeTours` is an *asynchronous* method that accepts URIs for one or more `OptimizeToursRequest` and corresponding `OptimizeToursResponse` messages, returning the resource name of a *Long Running Operation* (LRO) ([REST](/maps/documentation/route-optimization/reference/rest/v1/projects.locations.operations#Operation), [gRPC](/maps/documentation/route-optimization/reference/rpc/google.longrunning#google.longrunning.Operations))) that is used to check for batch completion. `OptimizeToursRequest`s are processed in the background, so clients maintain an open connections to the Route Optimization API only long enough to submit the `BatchOptimizeToursRequest` or to call `GetOperation` to check LRO status. `BatchOptimizeTours` reads requests from and writes responses to [Google Cloud Storage](https://cloud.google.com/storage).\n\nUse cases\n---------\n\n`OptimizeTours` is convenient for solving small and simple requests, or for\nrequests with solving times of a few minutes or less. Maintaining long-lived\nconnections to the Route Optimization API increases risk of interruption before\na solution can be returned.\n\n`BatchOptimizeTours` can handle larger requests and requests with longer solving\ntime because it does not require a long-lived connection to the Route\nOptimization API.\n\nLong running operations\n-----------------------\n\nLROs are read from the Route Optimization API using the `GetOperation` method to\ncheck the completion status of a batch. LROs include a `done` property that\nindicates whether processing of the entire batch is complete and an `error`\nfield that reports errors encountered during processing. If `done` is true and\nno `error` is present, the batch completed successfully. The presence of an\n`error` indicates that some or all of the batch failed processing.\n| **Note:** REST `GetOperation` responses omit the `done` property if its value is false and the `error` property if no errors occurred.\n\nThe typical lifecycle of a `BatchOptimizeTours` request is as follows:\n\n1. Submit a `BatchOptimizeToursRequest` to the Route Optimization API, which returns the resource name of an LRO.\n2. Poll `GetOperation` with the returned LRO resource name until the `done` or `error` properties appear in the LRO response.\n3. If `done` is true and no error is present, read `OptimizeToursResponses` from the Google Cloud Storage URIs specified in the `BatchOptimizeTours` request. If `error` is present, inspect the error, update the `OptimizeToursRequest`s accordingly in Google Cloud Storage, and retry as appropriate depending on the observed error.\n\nYou can send `OptimizeTours` and `BatchOptimizeTours` requests in a variety of\nways, either from the command line or using a client library.\n\n[Next: Make an API Request](/maps/documentation/route-optimization/make-request)"]]