---
title: "gpxToGeoJSON | Mobile sdk | Mobile sdk android | Android"
description: "gpxToGeoJSON"
---

# gpxToGeoJSON

suspend fun [gpxToGeoJSON](https://docs.maptiler.com/mobile-sdk/android/api/-map-tiler-s-d-k/com.maptiler.maptilersdk.map/-m-t-map-view-controller/gpx-to-geo-j-s-o-n/)(gpxXml: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?

Converts a GPX XML payload to a GeoJSON FeatureCollection string using the SDK converter.

This does not mutate the map and can be used to prepare data for a `GeoJSON` source.

#### Return

The GeoJSON FeatureCollection as a compact JSON string, or null on failure.

#### Parameters

gpxXml

The GPX file contents as a string.
