访问Google云存储上的私人数据

时间:2018-10-16 08:42:51

标签: json google-cloud-platform google-cloud-storage gdal mapserver

我正在使用Google Cloud设置地图服务器。我们的目标是提供被分割成图块并存储到z / x / y格式的子目录中的私有图像,其中z是缩放级别,x是水平轴,y是垂直轴。我希望能够通过LabelBox(https://support.labelbox.com/docs/tiled-imagery)访问这些图块,但是要这样做,我必须上载一个包含图块层URL的json文件,该文件是私有的并且无法访问。如何通过LabelBox访问这些文件?我将示例json文件附加在LabelBox的网站上:

    [{
      "tileLayerUrl": "https://public-tiles.dronedeploy.com/1499994155_DANIELOPENPIPELINE_ortho_qfs/{z}/{x}/{y}.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9wdWJsaWMtdGlsZXMuZHJvbmVkZXBsb3kuY29tLzE0OTk5OTQxNTVfREFOSUVMT1BFTlBJUEVMSU5FX29ydGhvX3Fmcy8qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoyMTQ1OTE0MTE4fX19XX0_&Signature=O~50rrGXdEC6Hi8jPJ3dbT~UtBd7Cw6iQPTxdJ8LU2IaoxeP22R3JpKPkLN3T3~Lcw3CyX7uft2Baj0MH93qUoCYyN~~jNX3OMkYV2jbrHDezf6zQRHAabXX-L2bL-JEGfFL6z3DWccOFeCH56CuhgC29k5CJx7I34P-LQJdnAUsA-KaqKH1IyYsHStRIfmMzdXNAWU58FTfqVljq9SbKXxfgdr2SZ~7VgLaZ8IhA0WnlKUo-JgqTd~jYa5mGCpR8351IMK0aMuY4Mld4SOXssQ-rOtlZtypvo8FDp474TlGIEGz5PHxGOPsqLPF19hEYTgoPqsUj8QEuiTfg-cmsg__&Key-Pair-Id=APKAJXGC45PGQXCMCXSA",
      "bounds": [
          [
              37.86857121694444,
              -122.32616227416666
          ],
          [
              37.87676075527778,
              -122.31316180916666
          ]
      ],
      "minZoom": 10,
      "maxZoom": 23,
      "epsg": "EPSG4326"
      },{
     "tileLayerUrl": "https://public-tiles.dronedeploy.com/1499994155_DANIELOPENPIPELINE_ortho_qfs/{z}/{x}/{y}.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9wdWJsaWMtdGlsZXMuZHJvbmVkZXBsb3kuY29tLzE0OTk5OTQxNTVfREFOSUVMT1BFTlBJUEVMSU5FX29ydGhvX3Fmcy8qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoyMTQ1OTE0MTE4fX19XX0_&Signature=O~50rrGXdEC6Hi8jPJ3dbT~UtBd7Cw6iQPTxdJ8LU2IaoxeP22R3JpKPkLN3T3~Lcw3CyX7uft2Baj0MH93qUoCYyN~~jNX3OMkYV2jbrHDezf6zQRHAabXX-L2bL-JEGfFL6z3DWccOFeCH56CuhgC29k5CJx7I34P-LQJdnAUsA-KaqKH1IyYsHStRIfmMzdXNAWU58FTfqVljq9SbKXxfgdr2SZ~7VgLaZ8IhA0WnlKUo-JgqTd~jYa5mGCpR8351IMK0aMuY4Mld4SOXssQ-rOtlZtypvo8FDp474TlGIEGz5PHxGOPsqLPF19hEYTgoPqsUj8QEuiTfg-cmsg__&Key-Pair-Id=APKAJXGC45PGQXCMCXSA",
     "bounds": [
          [
              37.86857121694444,
              -122.32616227416666
          ],
          [
              37.87676075527778,
              -122.31316180916666
          ]
     ],
     "minZoom": 10,
     "maxZoom": 23,
     "epsg": "EPSG4326"
   }]

1 个答案:

答案 0 :(得分:0)

您需要创建Signed URLs。这将生成一个带有指向对象或存储桶的键的URL,这样您就可以在GCP外部访问数据而无需将其公开。

您可以在LabelBox site上找到相关的文章。