> For the complete documentation index, see [llms.txt](https://docs.mapbox.com/mapbox-tiling-service/ja/llms.txt)

# Supported File Formats

## Line-delimited GeoJSON

MTS requires that you format tileset sources as [line-delimited GeoJSON](https://en.wikipedia.org/wiki/JSON_streaming#Line-delimited_JSON) (uncompressed line-delimited sequences of GeoJSON features). Unlike features being collected under a `FeatureCollection` array, like in GeoJSON, features in line-delimited GeoJSON are separated by newline characters in the file. Putting each feature on its own line makes it faster and easier to process individual features.

For example:

```json
{"type":"Feature","id":1,"geometry":{"type":"Point","coordinates":[115.7,12.2]},"properties":{"name":"cool feature"}}
{"type":"Feature","id":2,"geometry":{"type":"Point","coordinates":[125.7,12.2]},"properties":{"name":"neat feature"}}
{"type":"Feature","id":3,"geometry":{"type":"Point","coordinates":[135.7,12.2]},"properties":{"name":"bad place"}}
{"type":"Feature","id":4,"geometry":{"type":"Point","coordinates":[105.7,12.2]},"properties":{"name":"good place"}}
```

The values in `feature.properties` cannot be an object or an array according to the [Mapbox vector tile spec](https://github.com/mapbox/vector-tile-spec/blob/2242b503e14a98c79b423fe7d398c1a1f3597e91/2.1/vector_tile.proto#L19). Any non-primitive types included in `feature.properties` will be dropped when you publish your tileset source to MTS.

### Convert GeoJSON to line-delimited GeoJSON

The Tilesets CLI automatically converts GeoJSON to line-delimited GeoJSON. To learn more about the `upload-source` command and other Tilesets CLI functions, see the [Tilesets CLI documentation](https://github.com/mapbox/tilesets-cli/#upload-source).

### Convert other data formats to line-delimited GeoJSON

If your source data is in a vector format other than GeoJSON, such as a Shapefile or KML, you need to convert it to line-delimited GeoJSON before using it to create a tileset source. The [Fiona CLI tool `fio`](https://fiona.readthedocs.io/en/latest/cli.html#cat) outputs line-delimited GeoJSON by default and is a good option for converting files.

Here is an example converting a Shapefile into a line-delimited sequence of GeoJSON features:

```bash
$ fio cat ~/data/countries.shp > countries.ldgeojson.ld
```

The [`ogr2ogr` utility from GDAL](https://gdal.org/programs/ogr2ogr.html) (version 2.4) can also convert many data formats to line-delimited GeoJSON:

```bash
$ ogr2ogr -f GeoJSONSeq countries.ldgeojson.ld ~/data/countries.shp
```

### Validate line-delimited GeoJSON

You can use the [Tilesets CLI](https://github.com/mapbox/tilesets-cli) to validate the line-delimited GeoJSON in a tileset source file by using the command:

```bash
$ tilesets validate-source path/to/your/data.json
```

To learn more about this command and other Tilesets CLI functions, see the [Tilesets CLI documentation](https://github.com/mapbox/tilesets-cli/#tilesets-cli).

### GeoJSON coordinate system

Line-delimited GeoJSON must use the [`OGC:CRS84` coordinate reference system](https://tools.ietf.org/html/rfc7946#section-4). In other words, it must use longitude and latitude, in that order, decimal degrees, and the WGS84 coordinate system.

## Feature IDs in MTS

MTS allows you to define which field in your tileset source to use as the identifier for your features. By default, MTS will use the top-level `id` field in each GeoJSON feature. You can override this with the rules defined in the [Recipe reference section on IDs](https://docs.mapbox.com/mapbox-tiling-service/ja/recipe-specification/vector/#identification).

Specifying the IDs for each feature allows you to use [feature state](https://docs.mapbox.com/style-spec/reference/expressions/#feature-state), a set of user-defined attributes that can be dynamically assigned to a feature on a map. Feature state relies on each feature in a tileset source having a unique numeric `id` to work correctly.

## Modify a tileset source

After you [publish a tileset](https://docs.mapbox.com/api/maps/mapbox-tiling-service/#publish-a-tileset) using a tileset source, the tileset no longer directly references its tileset source. So if an existing tileset source is modified ([deleted](#delete-a-tileset-source), [replaced](#replace-a-tileset-source), or [appended to](#append-to-a-tileset-source)), this modification will not be reflected in the tilesets that were created using the tileset source.

### Delete a tileset source

If you no longer need a tileset source, you should manually delete it after any related tilesets are finished processing using the [Delete a tileset source](https://docs.mapbox.com/api/maps/mapbox-tiling-service/#delete-a-tileset-source) endpoint. Any tilesets that were created using this tileset source will continue working normally. But if you begin a new publish job using the [Publish a tileset](https://docs.mapbox.com/api/maps/mapbox-tiling-service/#publish-a-tileset) endpoint using the deleted tileset source, the publish job will fail.

### Replace a tileset source

When you replace an existing tileset source with new source data using the [Replace a tileset source](https://docs.mapbox.com/api/maps/mapbox-tiling-service/#replace-a-tileset-source) endpoint, any existing tilesets that were created using the original tileset source will not be modified. To see these changes reflected in a tileset, begin a new publish job using the [Publish a tileset](https://docs.mapbox.com/api/maps/mapbox-tiling-service/#publish-a-tileset) endpoint. This will process the modified tileset source according to your [tileset recipe](https://docs.mapbox.com/mapbox-tiling-service/ja/guides/tileset-recipes/), and the updated tileset will reflect the changes to the tileset source.

### Append to a tileset source

When you append new source data to a tileset source using the [Append to an existing tileset source](https://docs.mapbox.com/api/maps/mapbox-tiling-service/#append-to-an-existing-tileset-source) endpoint, the tileset source will be modified to include the newly uploaded data. But any existing tilesets that were created using this source will not be modified. To see these changes reflected in a tileset, begin a new publish job using the [Publish a tileset](https://docs.mapbox.com/api/maps/mapbox-tiling-service/#publish-a-tileset) endpoint. This will process the modified tileset source according to your [tileset recipe](https://docs.mapbox.com/mapbox-tiling-service/ja/guides/tileset-recipes/), and the updated tileset will reflect the changes to the tileset source.