This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
WKT <-> GeoJSON parser/unparser
version 1.0.4
license BSD-3-Clause
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.4
Committed At 2018-04-21 13:16:02 UTC
mgold/elm-geojson 2.0.0 <= v < 3.0.0 2.0.1
krisajenkins/formatting 4.2.0 <= v < 5.0.0 4.2.0
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1
Bogdanp/elm-combine 3.1.1 <= v < 4.0.0 3.1.1

Modules

README

elm-wkt

This library is a naive, incomplete, yet pragmatic implementation of OGC 06-103r4 version 1.2.1. As such, and as it stands now, it is solely intended for conversion between itself and GeoJSON.

Install

elm-package install StoatPower/elm-wkt

Test

npm install
npm run test

Usage

Read WKT into GeoJson Geometries

import WellKnown exposing (read)

wkt = "GEOMETRYCOLLECTION (POINT (4 6), LINESTRING (4 6, 7 10))"

geometry : Result String Geometry
geometry =
    read wkt

Write GeoJson Geometries to a WKT String

import WellKnown exposing (write)

geometry : Geometry
geometry = 
    GeometryCollection
        [ Point ( 4.0, 6.0, 0.0 )
        , LineString [ ( 4.0, 6.0, 0.0 ), ( 7.0, 10.0, 0.0 ) ]
        ]

wkt : String
wkt =
    write geometry