Google Maps Platform에서 Solar API로 이전

Google Earth Engine Solar API에서 Google Maps Platform으로 이전하는 경우 Solar API:

  1. 클라우드 프로젝트에서 Google Maps Platform Solar API를 사용 설정합니다.
  2. 새 키를 만들어 GMP Solar API로 제한합니다.
  3. 다음을 사용하여 코드를 업데이트합니다. 단계별 안내 참조하세요.

나란히 비교

Solar API (신규) 태양이 있는 주택 Earth Engine Solar API (지원 중단됨) EE 아이콘
출시 상태 출시됨 파일럿 (지원 중단됨)
액세스
메커니즘 Solar API를 사용 설정하고 Google Maps Platform 섹션을 통해 API를 관리하여 Cloud 콘솔을 통한 Google Cloud 계정 생성 Earth Engine Solar API를 사용 설정하여 Cloud 콘솔을 통한 Google Cloud 계정
누가 공개 액세스 제어
수준 자체 프로비저닝됨 Cloud 프로젝트 수동 액세스
인증 API 키 및 OAuth API 키
가격 책정
전략 사용한 만큼만 지불 100% 할인
계층 쿼리 1, 000개당(볼륨에 따라 가격이 인하됨)
엔드포인트 다양한 엔드포인트당 가격
Cloud
모니터링 'Google Maps Platform'의 Cloud Monitoring Cloud Monitoring의 'API 및 서비스'
할당량 QPM (분당 쿼리) 및 QPH (시간당 쿼리) 연간
로깅 Cloud Logging (선택사항) Cloud Logging (선택사항)
결제 Cloud Billing 계정 -
지원 SLO/SLA로 Google Maps Platform 전체 지원 제한됨, 이메일
API
호스트 이름 https://solar.googleapis.com/v1/ (REST) https://earthenginesolar.googleapis.com/v1/ (REST)
메서드
  • buildingInsights:findClosest
  • dataLayers:get
  • buildings:findClosest
  • solar.get
응답 파일럿 대비 변경사항 없음
solarInfo 반경 100m 이하 반경 100m 이하
적용 범위
지역 전역 전역
데이터 품질 HIGH/MEDIUM HIGH/MEDIUM
건물 유형 주소에 매핑되었으며 Solar API 이미지 범위 내에 있는 건물 주소에 매핑되었으며 Solar API 이미지 범위 내에 있는 건물
서비스 약관
TOS Google Maps Platform 약관 Google Earth Engine 약관

단계별 안내

Google Cloud 프로젝트 설정

안내: Google Cloud 설정 프로젝트의 인스턴스입니다.

특정 역할만 Cloud 프로젝트를 만듭니다 프로젝트를 만들 수 없는 경우 조직 관리자여야 합니다.

기존 Cloud 프로젝트를 사용할 수도 있습니다. 자세한 내용은 시작하기 Google Maps Platform 사용

결제 계정 설정

안내: 결제 관리 방법 계정을 선택합니다.

기존 결제 계정으로 기존 Cloud 프로젝트를 사용할 수 있습니다.

API 키 가져오기 또는 OAuth 토큰 사용

Google Cloud 프로젝트를 설정한 후 API를 만들고 보호해야 합니다. API 사용의 설명대로 Solar API를 사용하기 위한 키입니다. 키를 참조하세요. 또는 OAuth 토큰을 만들 수 있습니다. OAuth를 사용하기에 설명된 대로 설정합니다.

Solar API 사용

  • 새 엔드포인트(https://solar.googleapis.com)에 GET 요청을 실행합니다.
  • 일부 API 메서드 이름이 변경되었습니다. <ph type="x-smartling-placeholder">
      </ph>
    • buildings:findClosestbuildingInsights:findClosest
    • solarinfo:getdataLayers:get

빠른 체험판: 이전 단계에서 저장한 API 키를 사용하고 YOUR_API_KEY를 브라우저:

https://solar.googleapis.com/v1/dataLayers:get?location.latitude=37.2746464&location.longitude=-121.7530949&radius_meters=10&key=YOUR_API_KEY

기존 미리보기 출시에 대한 응답

2023년 5월 9일 최초 미리보기 출시의 경우 응답의 URL은 양식:

https://earthengine.googleapis.com/v1alpha/projects/sunroof-api/thumbnails/THUMBNAIL_ID:getPixels

다음 스니펫은 응답 예시입니다.

{
  "imageryDate": {
    "year": 2015,
    "month": 8,
    "day": 8
  },
  "imageryProcessedDate": {
    "year": 2021,
    "month": 2,
    "day": 15
  },
  "dsmUrl": "https://earthengine.googleapis.com/v1alpha/projects/geo-solar-api/thumbnails/fbde33e9cd16d5fd10d19a19dc580bc1-8614f599c5c264553f821cd034d5cf32:getPixels",
  "rgbUrl": "https://earthengine.googleapis.com/v1alpha/projects/geo-solar-api/thumbnails/91ed3551f2d0abee20af35e07bd0c927-c96c59e80cf1fc1dc86cf59fc8ec86ba:getPixels",
  "maskUrl": "https://earthengine.googleapis.com/v1alpha/projects/geo-solar-api/thumbnails/e4051553dba6870c03d855ae82c30b7e-7cc8ae6ce7c73f219e3c1924e5c17fc6:getPixels",
  "annualFluxUrl": "https://earthengine.googleapis.com/v1alpha/projects/geo-solar-api/thumbnails/9b0f87f49d778a65c9e27ff936e6dbba-b90be2fe80d25abd4c9e8c4dc809f763:getPixels",
  "monthlyFluxUrl": "https://earthengine.googleapis.com/v1alpha/projects/geo-solar-api/thumbnails/90e7cca77402f14809e349937f0a0be8-94fafeb4ef42d72f1b3c0652a1cb5518:getPixels",
  "hourlyShadeUrls": [
    "https://earthengine.googleapis.com/v1alpha/projects/geo-solar-api/thumbnails/dcd276e4782aef4ff1b230b781736d37-e193b231ce57a03449afc3e21cf6783b:getPixels",
    ...
  ]
  }

응답에서 URL에 요청하려면 전체 URL을 합니다.

이 요청 및 응답의 전체 사양은 참조 문서를 참조하세요.

두 응답 형식을 모두 지원하는 앱 작성

이제 원래 미리보기와 현재 버전을 모두 처리하는 앱을 작성할 수 있습니다. 응답 형식을 선택할 수 있습니다.

실제 URL 자체를 제외하고 두 응답의 주요 차이점은 API 키를 반드시 응답 형식을 사용합니다. API 키를 생략하면 요청이 실패합니다.

예를 들어 앱에 다음 코드를 추가하여 URL을 검사하고 각 버전을 올바르게 처리합니다.

자바스크립트

/**
* Function to examine a response URL and to append the API key to the
* URL if it is in the new format.
*/
function prepareGetGeoTiffUrl(geoTiffUrl, apiKey) {
  if (geoTiffUrl.match("solar.googleapis.com")) {
    let url = new URL(geoTiffUrl);
    url.searchParams.set('apiKey', apiKey);
    return url.toString();
  }
  return geoTiffUrl;
}

Python

# Functions to examine a response URL and to append the API key to the
# URL if it is in the new format.

def add_api_key_to_url(base_url: str, api_key: str) -> str:
  '''Formats URL that currently lacks an API key to use the one provided.'''
  return base_url + "&key=" +api_key;

def prepare_geo_tiff_url(base_url: str, api_key: str) -> str:
  '''Prepares URL from GetDataLayers depending on API being called.
    If the geoTIFF url from GetDataLayers is for the solar API GetGeoTiff
      endpoint, append the API key. Otherwise return the URL as is.
  '''
  if re.search("solar.googleapis.com", geo_tiff_url):
    return add_api_key_to_url(geo_tiff_url, api_key)
  return geo_tiff_url

자바

/ **Adds API key to a URL. /*
private String addApiKeyToUrl(String geoTiffUrl, String apiKey) {
  return geoTiffUrl + "&key=" + apiKey;
}

/
** *Function to examine a response URL and to append the API key to the
 *URL if it is in the new format.
/*
private String prepareGetGeoTiffUrl(String geoTiffUrl, String apiKey) {
  Pattern pattern = Pattern.compile("solar.googleapis.com");
  Matcher matcher = pattern.matcher(geoTiffUrl);
  if (matcher.find()) {
    return addApiKeyToUrl(geoTiffUrl, apiKey);
  } else {
    return geoTiffUrl;
  }
}

모니터링

프로젝트 수준 결제 계정 수준

Cloud Monitoring Cloud Billing

알아두면 좋은 팁

  • 할당량: 확장할 수 있는 사용량 (사라지는 연간이 아님) <ph type="x-smartling-placeholder">
      </ph>
    • 현재 할당량 QPM으로 변경됩니다.
    • 권장사항: 클라이언트 측 할당량 설정 및 알림 전송
  • 가격 책정: <ph type="x-smartling-placeholder">
      </ph>
    • 사용한 만큼만 지불
    • 위치가 서비스 범위 내에 있지 않은 경우 404 NOT_FOUND 응답은 청구되지 않지만 할당량에 반영됩니다.
  • 일반 사용 약관: Google Maps Platform 서비스 약관