All Downloads are FREE. Search and download functionalities are using the official Maven repository.

works.worace.geojson.JtsFeature.scala Maven / Gradle / Ivy

The newest version!
package works.worace.geojson.jts

import org.locationtech.jts.geom.Geometry
import io.circe.{Json, JsonObject, Decoder}

case class JtsFeature(id: Option[String], properties: JsonObject, geometry: Geometry) {
  def typed[T](implicit decoder: Decoder[T]): Decoder.Result[TypedJtsFeature[T]] = {
    Json
      .fromJsonObject(properties)
      .as[T](decoder)
      .map(props => TypedJtsFeature(id, props, geometry))
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy