positionstack · Capability

Coordinates To Address

Run with Naftiko

Capability Spec

coordinates-to-address.yaml Raw ↑
apiVersion: naftiko.dev/v1
kind: CapabilityWorkflow
metadata:
  name: coordinates-to-address
  description: |
    Convert a latitude/longitude pair (e.g. from a GPS sensor or browser geolocation)
    into a structured postal address with locality, region, and country.
spec:
  inputs:
    - name: latitude
      type: number
      required: true
    - name: longitude
      type: number
      required: true
    - name: language
      type: string
      required: false
      default: en
  steps:
    - id: reverse-lookup
      uses: positionstack-geocoding#reverse
      with:
        query: "{{ inputs.latitude }},{{ inputs.longitude }}"
        language: "{{ inputs.language }}"
        limit: 1
      bind:
        match: data[0]
  outputs:
    label: "{{ match.label }}"
    street: "{{ match.street }}"
    number: "{{ match.number }}"
    locality: "{{ match.locality }}"
    postal_code: "{{ match.postal_code }}"
    region: "{{ match.region }}"
    country: "{{ match.country }}"
    country_code: "{{ match.country_code }}"