arlula卫星图像api初学者指南

Introduction

介绍

In this tutorial we’ll be showing you how to get started with Arlula and order your first Landsat 8 satellite imagery datasets for free using our API.

在本教程中,我们将向您展示如何开始使用Arlula并使用我们的API免费订购您的第一个Landsat 8卫星图像数据集。

The Arlula API allows users to query databases of satellite imagery from vendors around the world. This powerful tool allows users to search and compare the quality of global image datasets and order them at scale. The Arlula API is a new way in which people from around the world can access timely satellite imagery and create their own data streams from space!

Arlula API允许用户查询来自世界各地供应商的卫星图像数据库。 这个功能强大的工具使用户可以搜索和比较全局图像数据集的质量,并按比例排序。 Arlula API是一种新的方式,使世界各地的人们都可以及时访问卫星图像并从太空创建自己的数据流!

Step 1: Signup

步骤1:注册

If you’re new to Arlula, you’ll need to create an account, this is a fairly simple process that should only take a few minutes.

如果您不熟悉Arlula,则需要创建一个帐户,这是一个非常简单的过程,只需几分钟。

Visit https://api.arlula.com/signup and create an account.

访问https://api.arlula.com/signup并创建一个帐户。

Image for post

Once you signup you’ll receive an email from us, if you cannot find it make sure to check your spam folder!

注册后,您将收到我们的电子邮件,如果找不到,请确保检查您的垃圾邮件文件夹!

Step 2: Generate your API credentials

步骤2:产生您的API凭证

Once you’ve created your account and logged into the Arlula platform you’ll need to create generate new API credentials so you can interact with our infrastructure. If you’re logging in for the first time, you’ll be prompted to generate your first API credentials, where a new window will pop up.

创建帐户并登录到Arlula平台后,您需要创建生成新的API凭据,以便与我们的基础架构进行交互。 如果您是首次登录,系统将提示您生成您的第一个API凭据,并在其中弹出一个新窗口。

Image for post

The three main fields that you’ll need to fill out in order to generate new API credentials are API Name, API Support Email and API Security Key. Your 30 character long API security key is different to your Arlula account password and will be used to securely send encrypted API requests over the web.

为了生成新的API凭证,您需要填写的三个主要字段是API名称,API支持电子邮件API安全密钥。 您的30个字符长的API安全密钥不同于您的Arlula帐户密码,将用于通过网络安全发送加密的API请求。

DO NOT FORGET YOUR API SECRET! A good idea is to save it offline somewhere safely as you’ll need this later.

不要忘记您的API秘密! 一个好主意是将其安全地离线保存,以备日后使用。

Once you’ve created your credentials a new page will open to the Arlula API documentation page. If you need to check your API key, or update your secret you can always do this by heading to the details section of your API credentials.

创建凭据后,将打开一个新页面,进入Arlula API文档页面 。 如果您需要检查您的API密钥或更新您的秘密,则可以始终通过前往API凭据的详细信息部分来执行此操作。

Step 3: Postman Install

步骤3:邮递员安装

Now that we’ve created our Arlula accounts and API credentials we can start making requests to the API. A great 3rd party tool that we use at Arlula for testing and evaluating APIs is called Postman. We’ll be using Postman today in order to make our first requests.

现在,我们已经创建了Arlula帐户和API凭据,我们可以开始向API发出请求了。 我们在Arlula使用的一个很棒的第三方工具来测试和评估API,称为Postman。 今天我们将使用Postman来发出我们的第一个请求。

Start by visiting https://www.postman.com/downloads/ and downloading the software to your computer. Once the software is installed and opened, you’ll see something similar to this.

首先访问https://www.postman.com/downloads/,然后将该软件下载到您的计算机上。 安装并打开软件后,您将看到类似的内容。

Image for post

Step 4: Search Imagery Archives

第4步:搜索影像档案

Now we’re ready to start making API requests. The Arlula API has a variety of GET and POST requests that can be made to perform different tasks.

现在,我们准备开始发出API请求。 Arlula API具有各种GETPOST请求,可以执行不同的任务。

  • Search, for obtaining a list of satellite imagery available for the request’s search criteria

    搜索 ,以获取可用于请求搜索条件的卫星图像列表

  • Orders, for requesting purchase of imagery and its associated data that will be delivered to the provided contact. This is broken down into:

    用于请求购买图像及其相关数据的订单,这些订单将交付给提供的联系人。 这可分为:
  • New order, which creates a new order, and pays for purchasing imagery

    新订单 ,创建新订单并支付购买图像的费用

  • List orders, which will list all past and current orders on your account

    列出订单 ,它将列出您帐户中所有过去和当前的订单

  • Get order, which will list the details and any associated resources of an order on your account

    获取订单 ,它将列出您帐户中订单的详细信息和任何相关资源

  • Get resource, which requests download of a resource associated with an order, such as the imagery or its metadata

    获取资源 ,请求下载与订单相关的资源,例如图像或其元数据

Begin by clicking on the “Collections” tab and create a new collection. Feel free to give it whatever name you like.

首先单击“收藏夹”选项卡,然后创建一个新的收藏夹。 随便给它一个你喜欢的名字。

Next, we’re going to use the Search endpoint in order to find the latest imagery over Sydney, Australia. Click the “+ New” button in the top left corner of the Postman screen and select “Request”. Give it the name “Get” and then press the Save button (making sure it’s saved to the Collection we just made).

接下来,我们将使用“搜索”端点来查找澳大利亚悉尼上的最新图像。 单击邮递员屏幕左上角的“ +新建”按钮,然后选择“请求”。 将其命名为“ Get”,然后按“保存”按钮(确保将其保存到我们刚刚创建的收藏夹中)。

Image for post

Click on the “Authorization” button and select “Basic Auth” from the drop down menu. Once you’ve selected these features, you’re now able to enter your API key for the “Username” field, and your API Secret for the “Password” field.

单击“授权”按钮,然后从下拉菜单中选择“基本身份验证”。 选择了这些功能后,现在就可以在“用户名”字段中输入API密钥,并在“密码”字段中输入API密钥。

Image for post

Now that we’ve entered the authorization details we’ll be able to conduct a search request. You can conduct a search with the Arlula API based on 3 different search criteria.

现在,我们输入了授权详细信息,我们将能够执行搜索请求。 您可以基于3种不同的搜索条件使用Arlula API进行搜索。

  • Time: Start and end dates (YYYY-MM-DD)

    时间:开始和结束日期(YYYY-MM-DD)

  • Image Resolution: vhigh(<0.5m), high(0.5m-1m), med(1m-5m), low(5m-20m), vlow(>20m)

    图像分辨率: vhigh(<0.5m),high(0.5m-1m),med(1m-5m),low(5m-20m),vlow(> 20m)

  • Location: Point search or bounding box

    位置:点搜索或边界框

By utilising this search criteria you can find satellite imagery captured on different dates at different resolutions and in different locations all over the world.

通过使用此搜索条件,您可以找到在全球不同日期和不同分辨率下在不同日期捕获的卫星图像。

We’ll be using an endpoint to search for low resolution imagery over Sydney between 3/1/2019 and 13/4/2019. Copy the below endpoint into the address bar at the top of the tab.

我们将使用端点在3/1/2019至13/4/2019之间在悉尼搜索低分辨率图像。 将以下端点复制到选项卡顶部的地址栏中。

https://api.arlula.com/api/search?start=2019-01-03&end=2019-04-13&res=low&lat=-33.8523&long=151.2108

https://api.arlula.com/api/search?start=2019-01-03&end=2019-04-13&res=low&lat=-33.8523&long=151.2108

Image for post

Once you’ve copied in the above HIT SEND!

复制完上面的HIT SEND之后!

Congratulations, you’ve just searched through millions of available satellite images in archives around the world.

恭喜,您刚刚搜索了世界各地档案馆中的数百万个可用卫星图像。

Step 5: Results!

步骤5:结果!

Now that you’ve conducted your first search with the Arlula API, you’ll be greeted with your search results. For any given search you could receive hundreds of results which represent individual imagery scenes captured from different satellites. These results will be returned to you in JSON format.

现在,您已经使用Arlula API进行了首次搜索,然后就会看到搜索结果。 对于任何给定的搜索,您可能会收到数百个结果,它们代表从不同卫星捕获的单个图像场景。 这些结果将以JSON格式返回给您。

Image for post

Each result contains many different parameters (“supplier”, “eula”, “id” etc, etc) that will help you to compare different imagery scenes against each other. For more information on all of the different types of parameters you can view this at www.arlula.com/documentation/ under our search API endpoint details.

每个结果包含许多不同的参数(“供应商”,“ eula”,“ id”等),可帮助您比较不同的影像场景。 有关所有不同类型参数的更多信息,请访问我们的Search API端点详细信息, 网址www.arlula.com/documentation/

If you’d like to save a copy of your results through Postman you can press the “Save Response” button in order to keep a copy.

如果您想通过邮递员保存结果的副本,则可以按“保存响应”按钮以保留副本。

Step 6: Order Satellite Imagery

第6步:订购卫星图像

Now that we’ve conducted a basic search using the Arlula API. We’re ready to place an order for some satellite imagery. We’ll be ordering freely available Landsat imagery, but you can also order commercial high resolution imagery from other satellite imagery operators through our API once you finish activating your account which will allow you to make imagery purchases.

现在,我们已经使用Arlula API进行了基本搜索。 我们已经准备好订购一些卫星图像。 我们将免费订购免费的Landsat影像,但是一旦您完成激活帐户的业务,您就可以通过我们的API从其他卫星影像运营商订购商业高分辨率影像,这将使您能够购买影像。

In order to place an order we’ll have to use the “new order” endpoint and send a Post request using Postman. Create a new “Request” under your Collection like before, using “order” as the name for the new request. Once saved, click the “GET” prefix before the URL field and select “Post” from the dropdown menu.

为了下订单,我们将必须使用“新订单”端点并使用Postman发送一个Post请求。 像以前一样在集合下创建一个新的“请求”,使用“订单”作为新请求的名称。 保存后,单击URL字段前面的“ GET”前缀,然后从下拉菜单中选择“发布”。

Image for post

You’ll also need to change your authorization details to “Basic Auth” as we did in Step 4. Once we’ve changed to the correct authorization we can now place a new order. To do this copy the following link into the address bar.

您还需要像在步骤4中一样将授权详细信息更改为“基本身份验证”。更改为正确的授权后,我们现在可以下新订单。 为此,将以下链接复制到地址栏中。

https://api.arlula.com/api/order/new

https://api.arlula.com/api/order/new

This endpoint will allows us to send specific information to the Arlula API. Once you’ve entered the above URL, press the “Body” button underneath the address bar and click the “raw” radio button. Select JSON from the drop down menu to the right that appears once you’ve selected raw.

该端点将使我们能够向Arlula API发送特定信息。 输入上述URL后,请按地址栏下方的“正文”按钮,然后单击“原始”单选按钮。 选择原始后,从显示的右侧下拉菜单中选择JSON。

Image for post

Now you’re ready to send a new order request.

现在,您可以发送新的订单请求了。

We’re now going to go back to the Get tab that we used to conduct our first API search and find the results section. In the results section we’re going to copy the “eula” and “id” parameters from the first search result (highlighted below).

现在,我们将返回到“获取”标签,该标签用于执行首次API搜索和“结果”部分。 在结果部分中,我们将从第一个搜索结果中复制“ eula”和“ id”参数(突出显示在下面)。

Image for post

You’ll have to go back into your search query and find a suitable eula and product id (any eula and id that correspond to a Landsat image should be fine for this step. Once you’ve found a Landsat image you want to order you’ll need to copy the id and the eula into the follow JSON query body.

您必须返回到搜索查询中,并找到合适的eula和产品ID(与Landsat图像相对应的任何eula和ID都可以在此步骤中使用。找到Landsat图像后,便要订购将需要将id和eula复制到以下JSON查询正文中。

{"id": "","eula": "","seats": 1,"trim": false,"webhooks": [],"emails": []}

Your JSON query body should now look something like this.

您的JSON查询主体现在应该看起来像这样。

{"id":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJMQzA4X0wxVFBfMDg5MDg0XzIwMTkwMTIyXzIwMTkwMTIzXzAxX1JUIiwiaWF0IjoxNTk2NzY2NDc1LCJpc3MiOiJBcmx1bGEgQXJjaGl2ZSIsInR5cGUiOiJhcmNoaXZlIiwic3VwcGxpZXIiOiJsYW5kc2F0IiwiZXVsYSI6Imh0dHBzOi8vY3JlYXRpdmVjb21tb25zLm9yZy9saWNlbnNlcy9ieS8zLjAvbGVnYWxjb2RlIiwicHJpY2UiOnsic2NlbmUiOnsiYmFzZSI6MCwic2VhdHMiOm51bGx9fX0.vfI_-tchFcnsqBRWa_d_aZ6WM1nemtvX_VUfzWx6OUw","eula": "https://creativecommons.org/licenses/by/3.0/legalcode","seats": 1,"trim": false,"webhooks": [],"emails": []}

Once you’ve done this, you should get a result like this (as long as your JSON Query body is formatted correctly!)

完成此操作后,您应该会得到这样的结果(只要您的JSON查询主体的格式正确!)

Image for post

Now that we’ve placed an order, for the specific satellite imagery scene we can choose what files we want to download.

现在,我们已经下订单了,对于特定的卫星图像场景,我们可以选择要下载的文件。

Step 7: Download your order!

步骤7:下载您的订单!

Now that we’ve placed an order you’ll receive a list of all the different files associated with that imagery scene. There are several different files associated with each scene, ranging from meta data files all the way to raw imagery files (tiff files) that are super high resolution and can be hundreds of megabytes in size.

现在,我们已经下订单,您将收到与该图像场景关联的所有不同文件的列表。 每个场景都有几个不同的文件,从元数据文件一直到原始图像文件(tiff文件),这些文件都是超高分辨率的,大小可达数百兆字节。

We’ll download the large thumbnail file from this Landsat scene. In order to do this, we’ll need to use the “Get Resource” API endpoint. We need to create a new Get Request tab like we did previously, and name it “Get Resource”. Make sure you implement “Basic Auth” just as we did in previous steps.

我们将从此Landsat场景下载较大的缩略图文件。 为此,我们需要使用“获取资源” API端点。 我们需要像以前一样创建一个新的“获取请求”选项卡,并将其命名为“获取资源”。 确保像之前的步骤一样实施“基本身份验证”。

In the Order results section, you can see how many different files are associated with a specific satellite imagery scene. Each individual file has its own specific id that you can use to place a download request for, so we’re going to be downloading the large thumbnail. To find the id associated with this file, we’ll scroll down through the results of the previous until we find a file type listed as “thumb”. There may be more than one file of this type, so because we want to find the large thumbnail we can look for the file name that mentions “thumb_large.jpg”. Simply copy the id associated with this file to use in the Get Resource search request.

在“订购结果”部分中,您可以查看多少个不同文件与特定的卫星图像场景相关联。 每个文件都有其自己的特定ID,您可以使用该ID发出下载请求,因此我们将下载较大的缩略图。 要查找与此文件关联的ID,我们将向下滚动前一个结果,直到找到列出为“拇指”的文件类型。 此类文件可能不止一个,因此,由于我们要查找较大的缩略图,因此可以查找提及“ thumb_large.jpg”的文件名。 只需复制与此文件关联的ID,即可在“获取资源”搜索请求中使用。

The id you located will now be used to conduct an order request. Paste the id at the end of the below search link:

您找到的ID现在将用于执行订单请求。 将ID粘贴在以下搜索链接的末尾:

https://api.arlula.com/api/order/resource/get?id=

https://api.arlula.com/api/order/resource/get?id=

All you need to do is paste the complete link with the search id in the “Get Resource” address bar and Hit Send!

您需要做的就是将带有搜索ID的完整链接粘贴到“获取资源”地址栏中,然后点击发送!

Image for post

Congratulations! You’ve just completed your first satellite imagery order. If successful, the jpg thumbnail should be displayed in the body of your request. You can save this thumbnail by using the “save response” feature in Postman.

恭喜你! 您刚刚完成了第一份卫星图像订单。 如果成功,jpg缩略图应显示在请求的正文中。 您可以使用Postman中的“保存响应”功能来保存此缩略图。

Image for post

Now that you’ve made your first download, try downloading other files associated with this, or even making other orders! Note that Postman isn’t designed to download large files, but have a go at trying different methods. Or use our Python Package. https://pypi.org/project/arlulaapi/

既然您已经进行了首次下载,请尝试下载与此相关的其他文件,甚至进行其他订购! 请注意,Postman并非旨在下载大文件,但可以尝试其他方法。 或使用我们的Python包。 https://pypi.org/project/arlulaapi/

If you have any questions or would like to learn more please feel free to contact the Arlula team at hello@arlula.com

如果您有任何疑问或想了解更多信息,请随时联系Arlula团队hello@arlula.com

翻译自: https://medium.com/swlh/arlula-satellite-imagery-api-beginners-guide-5b63d9943539

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值