geojson-common

common lib of geojson-common

License

License

Categories

Categories

Data Geo Business Logic Libraries Geospatial JSON
GroupId

GroupId

io.data2viz.geojson
ArtifactId

ArtifactId

geojson-common
Last Version

Last Version

0.6.0
Release Date

Release Date

Type

Type

jar
Description

Description

geojson-common
common lib of geojson-common
Project URL

Project URL

https://github.com/data2viz/geojson-kotlin
Source Code Management

Source Code Management

https://github.com/data2viz/geojson-kotlin

Download geojson-common

How to add to project

<!-- https://jarcasting.com/artifacts/io.data2viz.geojson/geojson-common/ -->
<dependency>
    <groupId>io.data2viz.geojson</groupId>
    <artifactId>geojson-common</artifactId>
    <version>0.6.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.data2viz.geojson/geojson-common/
implementation 'io.data2viz.geojson:geojson-common:0.6.0'
// https://jarcasting.com/artifacts/io.data2viz.geojson/geojson-common/
implementation ("io.data2viz.geojson:geojson-common:0.6.0")
'io.data2viz.geojson:geojson-common:jar:0.6.0'
<dependency org="io.data2viz.geojson" name="geojson-common" rev="0.6.0">
  <artifact name="geojson-common" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.data2viz.geojson', module='geojson-common', version='0.6.0')
)
libraryDependencies += "io.data2viz.geojson" % "geojson-common" % "0.6.0"
[io.data2viz.geojson/geojson-common "0.6.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-common jar 1.2.71
org.jetbrains.kotlinx : kotlinx-coroutines-core-common jar 0.26.1

Project Modules

There are no modules declared in this project.

GeoJson Kotlin

Download Build Status GitHub License

This project goal is to provide GeoJson deserialization for kotlin multiplatform (JVM, JS).

The specific format of GeoJson files does not allow the use of kotlinx.serialization. JS and JVM implementations are completely distinct but they share the same base objects and interfaces.

JVM implementation is based on the project GeoJson-Jackson.

The project is deployed on jcenter so you have to define it in your repositories.

repositories {
    jcenter()
}

The project is deployed using Gradle metadata. You can use the dependency on Gradle Metadata. Depending on your platform (JS or JVM) the correct artifact will be imported.

    compile 'io.data2viz.geojson:core:0.6.2'

The JS version is available in both modes, Legacy and IR.

You can then use the String extension toGeoJsonObject to transform any String into a GeoJsonObject:

val featureCollection = json.toGeoJsonObject() as FeatureCollection

If you deserialize a FeatureCollection that have properties (main use case) you need to pass a function that transform the properties in a specific domain object.

class CountryProperties(val name: String, val id: Int)

val countries = countriesGeoJson.toFeatures {
        CountryProperties(stringProperty("name"), intProperty("id"))
}

You then retrieve a list of Pair<Feature, CountryPropertiess>

io.data2viz.geojson

Versions

Version
0.6.0
0.6.0-RC2