GeoZone
API 文档

GeoZone Public API

一个 GraphQL API,可为全球任意坐标返回结构荷载区数据、地理特征和 PDF 报告。

7 个查询1 个订阅Bearer 认证
POSThttps://team-w.dlubal.com/api/geo-zone/pub/graphql

Web 应用

GeoZone 工具也可作为交互式 Web 应用程序访问 dlubal.com. 在地图上选择任意位置,即可立即查看所有结构荷载区值。

GeoZone Web 应用
GeoZone Web 应用

身份验证

大多数查询需要在 Authorization 标头中传递 Bearer 令牌:

Authorization:Bearer YOUR_TOKEN

标记为 公开 的查询不需要身份验证。其他所有查询每次请求消耗一个 API 额度。

getLoadZoneCharacteristics

查询需要认证

返回给定坐标的荷载区分类和所有特征。接受 loadZoneId(来自 findLoadzones)、layerId 以及十进制字符串格式的纬度/经度。响应包含地址详情、匹配区域和有序的结构特征列表。

字段 code 可以是 OKCOUNTRY_CHANGED(服务器自动选择了更合适的标准)、ANNEX_CHANGEDERROR

雪荷载区
雪荷载区
风荷载区
风荷载区
地震区
地震区
graphql
query {
  getLoadZoneCharacteristics(
    input: {
      address: "Munich, Germany"
      type: SNOW
      standard: "EN 1991-1-3"
      annex: "Germany"
      layerId: 1
    }
    language: EN
  ) {
    code
    message
    geoLocation {
      latitude longitude altitude
      street zip city state country countryCode
    }
    characteristics {
      standard
      annex
      zoneCharacteristics {
        id
        zone { value }
        characteristics {
          name calculatedValue
          nameHtml unitsHtml description
          decimalPlaces sequence
        }
      }
    }
    noLiability
  }
}

getLoadZoneCharacteristicsV1

查询需要认证

getZoneCharacteristics 的旧版本。返回不含地址数据或完整特征序列的精简响应。为向后兼容而保留——新集成应使用 getZoneCharacteristics

graphql
query {
  getLoadZoneCharacteristicsV1(
    input: {
      address: "Munich, Germany"
      type: SNOW
      standard: "EN 1991-1-3"
      annex: "Germany"
      layerId: 1
    }
    language: EN
  )
}

getGeoLocations

查询公开

地理编码查询——将自由格式地址转换为坐标结果。无需身份验证。返回最多 10 个排名结果,包含街道、城市、州/省、国家、邮政编码和十进制坐标。

地址搜索
地址搜索
graphql
query {
  getGeoLocations(
    address: "Altdorf, Uri, Switzerland"
    language: EN
  ) {
    latitude longitude altitude
    displayName street zip city state country countryCode
  }
}

getLoadZoneScreenshot

查询需要认证

生成以给定坐标为中心的地图截图,以 base64 编码的 PNG 或 JPEG 格式输出。适用于在报告或仪表板中嵌入区域地图。

graphql
query {
  getLoadZoneScreenshot(
    input: {
      address: "Munich, Germany"
      type: SNOW
      standard: "EN 1991-1-3"
      annex: "Germany"
      layerId: 1
      zoom: 8
      screenshotType: { type: PNG quality: 90 }
    }
    language: EN
  )
}

getLoadZoneStandards

查询公开

返回荷载区类型、标准、国家附录和图层的完整层级结构。用于填充选择器或发现有效的 loadZoneId 值及其图层 ID、区域标签和颜色。

graphql
query {
  getLoadZoneStandards(
    countryCode: "DE"
    language: EN
  ) {
    name
    standards {
      name
      annexes {
        name
        actual
        layers { id name }
      }
    }
  }
}

findLoadzones

查询需要认证

返回按类型分组的荷载区紧凑列表——适合发现有效的 loadZoneId / layerId 对。

graphql
query {
  findLoadzones(
    countryCode: "DE"
    language: EN
  ) {
    country
    countryCode
    typeGroups {
      name
      loadzones {
        standard annex loadzoneId
        layers { id name }
      }
    }
  }
}

响应示例

json
{
  "data": {
    "findLoadzones": {
      "country": "Germany",
      "countryCode": "DE",
      "typeGroups": [
        {
          "name": "Snow",
          "loadzones": [
            {
              "standard": "EN 1991-1-3",
              "annex": "Germany",
              "loadzoneId": "snow-eu-en-1991",
              "layers": [{ "id": 1, "name": null }]
            }
          ]
        },
        {
          "name": "Wind",
          "loadzones": [
            {
              "standard": "EN 1991-1-4",
              "annex": "Germany",
              "loadzoneId": "wind-eu-en-2005",
              "layers": [{ "id": 1, "name": null }]
            }
          ]
        }
      ]
    }
  }
}

getUserData

查询需要认证

返回已认证用户的电子邮件地址、信用余额以及当前计费周期内剩余的 API 点击次数。

graphql
query {
  getUserData {
    email
    clicks
  }
}

getPdf

订阅需要认证

通过 WebSocket 连接(graphql-ws GraphQL 订阅)生成完整的荷载区 PDF 报告。服务器流式传输进度更新;最终消息包含 base64 编码的 PDF 和建议的文件名。

WebSocket 端点: wss://team-w.dlubal.com/api/geo-zone/pub/graphql

graphql
subscription {
  getPdf(
    pdfInput: {
      address: "Munich, Germany"
      standard: "EN 1991-1-3"
      annex: "Germany"
      layerId: 1
    }
    language: EN
  ) {
    currentStep
    steps
    message
    pdfResult { pdf name }
  }
}

JavaScript 客户端示例

javascript
import { createClient } from "graphql-ws";

const client = createClient({
  url: "wss://team-w.dlubal.com/api/geo-zone/pub/graphql",
  connectionParams: { Authorization: "Bearer YOUR_TOKEN" },
});

const unsubscribe = client.subscribe(
  {
    query: `subscription {
      getPdf(pdfInput: {
        address: "Munich, Germany"
        standard: "EN 1991-1-3"
        annex: "Germany"
        layerId: 1
      } language: EN) {
        currentStep steps message
        pdfResult { pdf name }
      }
    }`,
  },
  {
    next({ data }) {
      const step = data?.getPdf;
      console.log(`${step.currentStep}/${step.steps} — ${step.message}`);
      if (step.pdfResult) {
        // step.pdfResult.pdf is base64-encoded
        unsubscribe();
      }
    },
    error(err) { console.error(err); },
    complete()  { console.log("Done"); },
  }
);

枚举

LanguageEnum

语言
ENEnglish
DEGerman
FRFrench
ITItalian
ESSpanish
PTPortuguese
PLPolish
CSCzech
RURussian
ZHChinese

LoadzoneTypeEnum

描述
SNOWSnow load zones (EN 1991-1-3)
WINDWind load zones (EN 1991-1-4)
EARTHQUAKESeismic zones (EN 1998)
TORNADOTornado zones (US only)

ScreenshotTypeEnum

描述
PNGLossless PNG image
JPEGCompressed JPEG image

输入类型

CharacteristicsInput

字段类型描述
addressString!Free-text address or place name
typeLoadzoneTypeEnumZone type filter (SNOW, WIND, EARTHQUAKE, TORNADO)
standardStringStandard name filter
annexStringAnnex / national annex filter
layerIdIntLayer ID within the standard

GetLoadzoneScreenshotPublicInput

字段类型描述
addressString!Free-text address or place name
typeLoadzoneTypeEnumZone type filter
standardStringStandard name filter
annexStringAnnex filter
layerIdIntLayer ID
zoomIntMap zoom level (default 5)
mapStringMap tile style
layerOrderIntLayer rendering order
screenshotTypeScreenshotTypeInputImage format and quality

ScreenshotTypeInput

字段类型描述
typeScreenshotTypeEnum!PNG or JPEG (default PNG)
qualityInt!JPEG quality 0–100 (default 90)

GetLoadzonePdfInput

字段类型描述
addressString!Free-text address or place name
standardStringStandard name filter
annexStringAnnex filter
layerIdIntLayer ID

输出类型

CharacteristicsResponseMiaType

字段类型描述
codeString!Response status code
messageStringHuman-readable message when code ≠ OK
geoLocationGeofinderDataTypeResolved location data
characteristics[CharacteristicsLoadzoneType2]Per-standard zone results
noLiabilityStringDisclaimer text

CharacteristicsLoadzoneType2

字段类型描述
standardString!Standard name
annexString!Annex name
zoneCharacteristicsCharacteristicsLayerType2!Layer result

CharacteristicsLayerType2

字段类型描述
idInt!Layer ID
zoneCharacteristicsZoneType2!Matched zone value
characteristics[CharacteristicsVariableType]!Ordered load values

CharacteristicsVariableType

字段类型描述
nameString!Parameter name (plain text)
nameHtmlString!Parameter name (HTML)
calculatedValueStringComputed value
unitsHtmlString!Units (HTML)
descriptionString!Parameter description
decimalPlacesInt!Display precision
sequenceInt!Display order

GeofinderDataType

字段类型描述
latitudeString!Resolved latitude
longitudeString!Resolved longitude
altitudeString!Elevation
streetStringStreet name and number
zipStringPostal code
cityStringCity / municipality
stateStringState or region
countryStringCountry name
countryCodeStringISO country code

GeoLocationType

字段类型描述
latitudeString!Latitude
longitudeString!Longitude
altitudeString!Elevation
displayNameStringFull formatted address
streetStringStreet name and number
zipStringPostal code
cityStringCity / municipality
stateStringState or region
countryStringCountry name
countryCodeStringISO country code

UserDataType

字段类型描述
emailString!Account email address
clicksInt!Remaining API calls this billing period

LoadzoneGroupShortType

字段类型描述
countryString!Country name
countryCodeString!ISO country code
typeGroups[LoadzoneTypeGroupType]!Zones grouped by type

LoadzoneShortType

字段类型描述
standardString!Standard name
annexString!Annex name
loadzoneIdString!Unique load zone identifier
layers[LoadzoneLayerShortType]!Available layers

PdfProgressType

字段类型描述
currentStepInt!Steps completed
stepsInt!Total steps
messageString!Status message
pdfResultPdfResultTypePresent on final message only

PdfResultType

字段类型描述
pdfString!Base64-encoded PDF
nameString!Suggested filename