地图流处理 API

Mapflow处理API使您能够对卫星和航空图像运行人工智能驱动的地理空间分析。用它来大规模检测建筑物、道路、森林等。

注意

通过 API 创建的项目和处理与“Mapflow.ai <https://app.mapflow.ai/>”同步。 API 调用会消耗您的 Mapflow 积分。

基本网址

https://api.mapflow.ai/rest

验证

所有 API 请求都需要 API 令牌。在“配置文件设置 <https://app.mapflow.ai/account>”中生成您的配置文件设置。

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
  https://api.mapflow.ai/rest/user/status

有关详细信息,请参阅:doc:授权指南 <../userguides/mapflow_auth>

快速入门

分 3 步运行您的第一个处理:

  1. 创建一个项目

    curl -X POST https://api.mapflow.ai/rest/projects \
      -H "Authorization: Bearer YOUR_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "My First Project",
        "description": "Buildings detection"
      }'
    

    响应:{“id”:“project-uuid”,...}

  2. 创建并运行处理

    curl -X POST https://api.mapflow.ai/rest/processings/v2 \
      -H "Authorization: Bearer YOUR_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "Downtown Buildings",
        "projectId": "project-uuid",
        "wdName": "🏠 Buildings",
        "geometry": {
          "type": "Polygon",
          "coordinates": [[
            [37.6156, 55.7558],
            [37.6256, 55.7558],
            [37.6256, 55.7608],
            [37.6156, 55.7608],
            [37.6156, 55.7558]
          ]]
        },
        "params": {
          "sourceParams": {
            "dataProvider": {
              "providerName": "Mapbox",
              "zoom": 18
            }
          }
        }
      }'
    

    响应:{“id”:“processing-uuid”,“status”:“IN_PROGRESS”,...}

  3. 检查状态和下载结果

    # Check status
    curl https://api.mapflow.ai/rest/processings/{processing-uuid}/v2 \
      -H "Authorization: Bearer YOUR_TOKEN"
    
    # Download results (when status = "OK")
    curl https://api.mapflow.ai/rest/processings/{processing-uuid}/result \
      -H "Authorization: Bearer YOUR_TOKEN" \
      -o results.geojson
    

后续步骤: 探索可用模型 <模型要求>`,上传自定义图像 <upload-images>`,或查看:ref:完整 API 参考 <api-reference>