<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MKGeoJSONDecoder/decode(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MKGeoJSONDecoder(im)geoJSONObjectsWithData:error:"
  },
  "title" : "decode(_:)"
}
-->

# decode(_:)

Decodes the provided data into native MapKit types that a map can display.

```
func decode(_ data: Data) throws -> [any MKGeoJSONObject]
```

## Parameters

`data`

An <doc://com.apple.documentation/documentation/Foundation/NSData> object that contains the JSON to decode.

## Return Value

An array of [`MKGeoJSONObject`](/documentation/MapKit/MKGeoJSONObject) objects, or an error if the decoder encounters an issue.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)