# Json export of tmx - wrong (offset?) id in chunks array

**URL:** <https://discourse.mapeditor.org/t/json-export-of-tmx-wrong-offset-id-in-chunks-array/3116>\
**Category:** Uncategorized\
**Created:** [April 2, 2018, 5:27pm UTC](https://discourse.mapeditor.org/t/json-export-of-tmx-wrong-offset-id-in-chunks-array/3116 "2018-04-02T17:27:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil123456](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@phil123456](https://discourse.mapeditor.org/u/phil123456)\
**Post date:** [April 2, 2018, 5:27pm UTC](https://discourse.mapeditor.org/t/json-export-of-tmx-wrong-offset-id-in-chunks-array/3116/1 "2018-04-02T17:27:57Z")

</div>

Hello,

I added a second tile set to my map, and in the exported json, I get values like 32769 instead of 1 for my tiles ids

that number comes from nowhere, I use 128x128 tiles set, so 32769 is not even a multiple of these

it’s probably an offset id or something, but it would be nice to have the offset in the exported json file for refrerence, it really seems like a Tiled internal value so it should rather be trimed to 1

I did that in my import and indeed it does the trick but it is a workaround and I am afraid I would have to adjust that offset everytime I add another tileset or if Tiled gets updated

regards

---

<div class="post-metadata">

**Author:** ![phil123456](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@phil123456](https://discourse.mapeditor.org/u/phil123456)\
**Post date:** [April 4, 2018, 6:24pm UTC](https://discourse.mapeditor.org/t/json-export-of-tmx-wrong-offset-id-in-chunks-array/3116/2 "2018-04-04T18:24:26Z")

</div>

found it 🙂

```
 "tilesets":[
        {
         "firstgid":1,
         "source":"..\/..\/..\/graphics_sources\/tiles.tsx"
        }, 
        {
         "firstgid":16385,
         "source":"..\/..\/..\/graphics_sources\/props.tsx"
        }, 
        {
         "firstgid":32769,
         "source":"..\/..\/..\/graphics_sources\/physics.tsx"
        }],
```

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [April 4, 2018, 10:05pm UTC](https://discourse.mapeditor.org/t/json-export-of-tmx-wrong-offset-id-in-chunks-array/3116/3 "2018-04-04T22:05:57Z")

</div>

Yeah, this is not a hardcoded offset but it’s based on the number of tiles in each tileset. This is documented on the [TMX Map Format page](http://doc.mapeditor.org/en/latest/reference/tmx-map-format/#data), but a link to this is missing from the [JSON Format](http://doc.mapeditor.org/en/latest/reference/json-map-format/) page, which in general is lacking some information ([#925](https://github.com/bjorn/tiled/issues/925)) and needs some corrections ([#1924](https://github.com/bjorn/tiled/issues/1924)).
