Skip to content

A simple tool to convert CAP XML files into the GeoJSON format.

License

Notifications You must be signed in to change notification settings

wmo-im/cap2geojson

Repository files navigation

The CAP to GeoJSON Converter

The Python package for making CAP alerts visualizable

License Badge Super-Linter Unit-Tests Publish-To-PyPI

Features

Getting Started

1. Installation

pip install cap2geojson

2A. Using the API

We can convert the CAP XML to GeoJSON using the transform(cap) method:

  • cap: The CAP alert XML string contents.
from cap2geojson import transform

with open(<cap-alert-directory>, 'r') as f:
    cap = f.read()

result = transform(cap)

2B. Using the CLI

We can convert a CAP alert directly to a GeoJSON file using the following command:

cap2geojson transform <cap-alert-directory>

Bugs and Issues

All bugs, enhancements and issues are managed on GitHub.

Contact