简体   繁体   English

Googe驱动器api-不支持地图导出(python)

[英]Googe drive api - no support for map export (python)

Using the python api client I can export google docs using export or export_media and non-google doc material with get_media . 使用python api客户端,我可以使用exportexport_media以及带有get_media非Google doc资料来导出google docs。

Maps saved in the user account are unexportable. 保存在用户帐户中的地图不可导出。 export returns the error export返回错误

HttpError: <HttpError 403 ... returned "Export only supports Google Docs.">

I admit it makes no sense to use get_media but I try anyway given the above error. 我承认使用get_media没有任何意义,但是鉴于上述错误,我还是尝试了。 It returns: 它返回:

HttpError: <HttpError 403 ... returned "Only files with binary content can be downloaded. Use Export with Google Docs files.">

It seems get_media and export disagree about what this object is. 似乎get_mediaexport对于该对象是什么get_media不同意见。

I suggest that export should work with mimeType='application/vnd.google-earth.kmz' 我建议export应与mimeType='application/vnd.google-earth.kmz'

You can use Drive.About.get to determine the export formats available for each Google MIME type: 您可以使用Drive.About.get确定每种Google MIME类型可用的导出格式:

GET https://www.googleapis.com/drive/v3/about?fields=exportFormats&key={YOUR_API_KEY}

{
 "exportFormats": {
  "application/vnd.google-apps.form": [
   "application/zip"
  ],
  "application/vnd.google-apps.document": [
   "application/rtf",
   "application/vnd.oasis.opendocument.text",
   "text/html",
   "application/pdf",
   "application/zip",
   "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
   "text/plain"
  ],
  "application/vnd.google-apps.drawing": [
   "image/svg+xml",
   "image/png",
   "application/pdf",
   "image/jpeg"
  ],
  "application/vnd.google-apps.spreadsheet": [
   "text/csv",
   "application/x-vnd.oasis.opendocument.spreadsheet",
   "application/zip",
   "application/pdf",
   "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  ],
  "application/vnd.google-apps.script": [
   "application/vnd.google-apps.script+json"
  ],
  "application/vnd.google-apps.presentation": [
   "application/vnd.openxmlformats-officedocument.presentationml.presentation",
   "application/pdf",
   "text/plain"
  ]
 }
}

As you can see, there are currently no export formats defined for application/vnd.google-apps.map . 如您所见,目前没有为application/vnd.google-apps.map定义导出格式。 Given that Google My Maps does support exporting to KMZ/KML, I think ideally the Google Drive API would as well. 鉴于Google我的地图确实支持导出到KMZ / KML,因此我认为Google Drive API也是理想的选择。 You can file a feature request on the issue tracker . 您可以在问题跟踪器上提出功能请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GEE Python API:将图像导出到 Google Drive 失败 - GEE Python API: Export image to Google Drive fails 谷歌驱动python api:导出永远不会完成。 - Google drive python api: export never completes. 我想将谷歌驱动器的文档导出为 pdf | 谷歌驱动器 Api Python - I want to export a document of google drive as pdf | Google Drive Api Python Python xlsxwriter,导出到网络驱动器 - Python xlsxwriter, export to a network drive 谷歌驱动器api python - google drive api python 谷歌驱动器 api 和 python - Google drive api with python Python:使用`export_media`(Google Drive API)下载PDF时传递`gridlines=false` - Python: Pass `gridlines=false` when downloading a PDF using `export_media` (Google Drive API) Google Drive API python以csv格式分别导出电子表格的每个工作表 - Google Drive API python to export each worksheet of spreadsheet separately in csv format 使用 Python API 将 Google Earth Engine RGB Sentinel-2 图像导出到 Google Drive - Export Google Earth Engine RGB Sentinel-2 Imagery to Google Drive using Python API 如何使用驱动器 API 和 Python 中的服务帐户将电子表格中的所有工作表导出为 CSV 文件? - How to export all sheets in a Spreadsheet as CSV files using the Drive API with a Service Account in Python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM