3

I am using TileStache to serve vector tiles from PostgreSQL and using Tangram to display these tiles by passing URL ('http://localhost:8080/composite/{z}/{x}/{y}.json') in the data source. The response i get is in JSON format, which is what i wanted.

How to encrypt the JSON response? so that it is not human readable at the client end and readable at server end.

Shahzad Bacha
  • 226
  • 2
  • 12
  • You can only obfuscate, because the client needs the data in order to show the tiles. Are you trying to protect your tiles from stealing by the client? – Artjom B. Feb 20 '16 at 10:45
  • Yes exactly that's what i am trying to do... i don't want the client to download and steal my data – Shahzad Bacha Feb 22 '16 at 05:18

1 Answers1

2

You can use protocol buffers for encoding the data. Here are two implementations geobuf and vt-pbf. But stealing of data can not be stopped as it need to be decoded at client side.

Gagan
  • 1,267
  • 3
  • 18
  • 28
  • 1
    You are right, converting json into pbf format can solve my issue up to some extent. Thank you, I am looking into [geobuf](https://github.com/mapbox/geobuf). – Shahzad Bacha Mar 09 '16 at 06:39
  • Just go through this [twkb](https://github.com/TWKB/twkb.js) also, one more lib for same purpose. – Gagan Mar 10 '16 at 09:34