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

com.github.tsingjyujing.geo.model.GeoJsonPoint.scala Maven / Gradle / Ivy

There is a newer version: 2.8.9-2.11
Show newest version
package com.github.tsingjyujing.geo.model

import java.util.{ArrayList => JavaList}

import com.github.tsingjyujing.geo.element.immutable.GeoPoint

/**
  * Entity class to convert GeoJSON(Point) to GeoObject
  */
class GeoJsonPoint {
    var `type`: String = null
    var coordinates: JavaList[Double] = null
    def verify: Boolean = `type` == "Point"

    def getPoint:GeoPoint = {
        assert(verify,"type mismatch")
        assert(coordinates!=null,"")
        assert(coordinates.size()==2,"coordinates size is not 2")
        GeoPoint(coordinates.get(0), coordinates.get(1))
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy