Class Geocoder

জিওকোডার

ঠিকানা এবং ভৌগোলিক স্থানাঙ্কের মধ্যে রূপান্তর করার সুযোগ দেয়।
নিচের উদাহরণটিতে দেখানো হয়েছে, কীভাবে আপনি এই ক্লাসটি ব্যবহার করে কলোরাডোর 'মেইন স্ট্রিট' অবস্থানের জন্য সেরা নয়টি ফলাফল খুঁজে বের করতে, সেগুলোকে একটি মানচিত্রে যুক্ত করতে এবং তারপর একটি নতুন গুগল ডকে তা এমবেড করতে পারেন।

// Find the best matches for "Main St" in Colorado.
const response = Maps.newGeocoder()
                     // The latitudes and longitudes of southwest and northeast
                     // corners of Colorado, respectively.
                     .setBounds(36.998166, -109.045486, 41.001666, -102.052002)
                     .geocode('Main St');

// Create a Google Doc and map.
const doc = DocumentApp.create('My Map');
const map = Maps.newStaticMap();

// Add each result to the map and doc.
for (let i = 0; i < response.results.length && i < 9; i++) {
  const result = response.results[i];
  map.setMarkerStyle(null, null, i + 1);
  map.addMarker(result.geometry.location.lat, result.geometry.location.lng);
  doc.appendListItem(result.formatted_address);
}

// Add the finished map to the doc.
doc.appendImage(Utilities.newBlob(map.getMapImage(), 'image/png'));

আরও দেখুন

পদ্ধতি

পদ্ধতি রিটার্ন টাইপ সংক্ষিপ্ত বিবরণ
geocode(address) Object প্রদত্ত ঠিকানার আনুমানিক ভৌগোলিক অবস্থান নির্ণয় করে।
reverse Geocode(latitude, longitude) Object প্রদত্ত কোনো ভৌগোলিক বিন্দুর আনুমানিক ঠিকানাগুলো খুঁজে বের করে।
set Bounds(swLatitude, swLongitude, neLatitude, neLongitude) Geocoder এমন একটি এলাকার সীমানা নির্ধারণ করে, যেটিকে ফলাফলে অতিরিক্ত অগ্রাধিকার দেওয়া হবে।
set Language(language) Geocoder ফলাফলে ব্যবহৃত ভাষা নির্ধারণ করে।
set Region(region) Geocoder অবস্থানের নাম ব্যাখ্যা করার জন্য একটি অঞ্চল নির্ধারণ করে।

বিস্তারিত ডকুমেন্টেশন

geocode(address)

প্রদত্ত ঠিকানার আনুমানিক ভৌগোলিক অবস্থান নির্ণয় করে।

// Gets the geographic coordinates for Times Square.
const response = Maps.newGeocoder().geocode('Times Square, New York, NY');
for (let i = 0; i < response.results.length; i++) {
  const result = response.results[i];
  Logger.log(
      '%s: %s, %s',
      result.formatted_address,
      result.geometry.location.lat,
      result.geometry.location.lng,
  );
}

প্যারামিটার

নাম প্রকার বর্ণনা
address String একটি ঠিকানা।

ফেরত

Object — একটি JSON অবজেক্ট, যাতে এখানে বর্ণিত জিওকোডিং ডেটা থাকে।


reverseGeocode(latitude, longitude)

প্রদত্ত কোনো ভৌগোলিক বিন্দুর আনুমানিক ঠিকানাগুলো খুঁজে বের করে।

// Gets the address of a point in Times Square.
const response = Maps.newGeocoder().reverseGeocode(40.758577, -73.984464);
for (let i = 0; i < response.results.length; i++) {
  const result = response.results[i];
  Logger.log(
      '%s: %s, %s',
      result.formatted_address,
      result.geometry.location.lat,
      result.geometry.location.lng,
  );
}

প্যারামিটার

নাম প্রকার বর্ণনা
latitude Number বিন্দুটির অক্ষাংশ।
longitude Number বিন্দুটির দ্রাঘিমাংশ।

ফেরত

Object — একটি JSON অবজেক্ট, যাতে এখানে বর্ণিত রিভার্স জিওকোডিং ডেটা থাকে।

আরও দেখুন


setBounds(swLatitude, swLongitude, neLatitude, neLongitude)

এমন একটি এলাকার সীমানা নির্ধারণ করে, যেটিকে ফলাফলে অতিরিক্ত অগ্রাধিকার দেওয়া হবে।

// Creates a Geocoder that prefers points in the area of Manhattan.
const geocoder = Maps.newGeocoder().setBounds(
    40.699642,
    -74.021072,
    40.877569,
    -73.908548,
);

প্যারামিটার

নাম প্রকার বর্ণনা
sw Latitude Number সীমানার দক্ষিণ-পশ্চিম কোণার অক্ষাংশ।
sw Longitude Number সীমানার দক্ষিণ-পশ্চিম কোণার দ্রাঘিমাংশ।
ne Latitude Number সীমানার উত্তর-পূর্ব কোণার অক্ষাংশ।
ne Longitude Number সীমানার উত্তর-পূর্ব কোণার দ্রাঘিমাংশ।

ফেরত

Geocoder — কলগুলোর শৃঙ্খলীকরণ সহজ করার জন্য জিওকোডার অবজেক্ট।

আরও দেখুন


setLanguage(language)

ফলাফলে ব্যবহৃত ভাষা নির্ধারণ করে।

// Creates a Geocoder with the language set to French.
const geocoder = Maps.newGeocoder().setLanguage('fr');

প্যারামিটার

নাম প্রকার বর্ণনা
language String একটি BCP-47 ভাষা শনাক্তকারী।

ফেরত

Geocoder — কলগুলোর শৃঙ্খলীকরণ সহজ করার জন্য জিওকোডার অবজেক্ট।

আরও দেখুন


setRegion(region)

অবস্থানের নাম ব্যাখ্যা করার জন্য একটি অঞ্চল নির্ধারণ করে। সমর্থিত অঞ্চল কোডগুলো গুগল ম্যাপস দ্বারা সমর্থিত ccTLD-গুলোর সাথে সঙ্গতিপূর্ণ। উদাহরণস্বরূপ, "uk" অঞ্চল কোডটি "maps.google.co.uk"-এর সাথে সঙ্গতিপূর্ণ।

// Creates a Geocoder with the region set to France.
const geocoder = Maps.newGeocoder().setRegion('fr');

প্যারামিটার

নাম প্রকার বর্ণনা
region String ব্যবহার করার জন্য অঞ্চল কোড।

ফেরত

Geocoder — কলগুলোর শৃঙ্খলীকরণ সহজ করার জন্য জিওকোডার অবজেক্ট।

আরও দেখুন