Polygon

open class Polygon : Geometry<<Error class: unknown class><LngLatAlt>>

Coordinates of a Polygon are an array of linear ring coordinate arrays. The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).

No holes:

  {
      "type": "Polygon",
      "coordinates": [
          [
              [100.0, 0.0],
              [101.0, 0.0],
              [101.0, 1.0],
              [100.0, 1.0],
              [100.0, 0.0]
          ]
      ]
  }

With holes:

  {
      "type": "Polygon",
      "coordinates": [
          [
              [100.0, 0.0],
              [101.0, 0.0],
              [101.0, 1.0],
              [100.0, 1.0],
              [100.0, 0.0]
          ],
          [
              [100.8, 0.8],
              [100.8, 0.2],
              [100.2, 0.2],
              [100.2, 0.8],
              [100.8, 0.8]
          ]
      ]
  }

 https://datatracker.ietf.org/doc/html/rfc7946#appendix-A.3

Constructors

Link copied to clipboard
constructor(polygon: <Error class: unknown class><LngLatAlt>)
constructor()

Properties

Link copied to clipboard
@Json(name = "bbox")
var bbox: List<Double>?
Link copied to clipboard
@Json(name = "coordinates")
var coordinates: ArrayList<<Error class: unknown class><LngLatAlt>>
Link copied to clipboard

In the (abridged) Feature object shown below

Link copied to clipboard
@Json(name = "properties")
var properties: HashMap<String, Any?>?
Link copied to clipboard
@Json(name = "type")
var type: String

Functions

Link copied to clipboard
fun addInteriorRing(points: <Error class: unknown class><LngLatAlt>)
fun addInteriorRing(vararg points: LngLatAlt)
Link copied to clipboard
fun getExteriorRing(): <Error class: unknown class><LngLatAlt>
Link copied to clipboard
fun getInteriorRing(index: Int): <Error class: unknown class><LngLatAlt>
Link copied to clipboard
fun getInteriorRings(): <Error class: unknown class><<Error class: unknown class><LngLatAlt>>