tileserver-php icon indicating copy to clipboard operation
tileserver-php copied to clipboard

Server JSON error when mbtiles file contains a legend

Open VNuhaan opened this issue 7 years ago • 6 comments

Dear Klokantech,

I have two mbtile files, one with a legend the other without a legend. When I put the one with the legend in the tile server directory, I get a JSON server error. I deleted the legend from the mbtile file. Put this modified file in the tile server directory and everything works. Can you change the tileserver.php so it can also serve mbtile files with a legend?

With best regards,

Vincent

VNuhaan avatar Apr 13 '17 14:04 VNuhaan

Thanks for the report. Can you provide us a file with not working legend?

daliborjanak avatar Apr 20 '17 06:04 daliborjanak

Hereby I sent you a small mbtile file with the legend. I hope you can fix the server so that it can use any legend.

Best regards,

Vincent

Van: Dalibor Janák [mailto:[email protected]] Verzonden: donderdag 20 april 2017 8:55 Aan: klokantech/tileserver-php [email protected] CC: Nuhaan, Vincent [email protected]; Author [email protected] Onderwerp: Re: [klokantech/tileserver-php] Server JSON error when mbtiles file contains a legend (#101)

Thanks for the report. Can you provide us a file with not working legend?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/klokantech/tileserver-php/issues/101#issuecomment-295601751, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFi1Ml2xmEdaPPADP4YjYCsi6kvL2vvSks5rxwFZgaJpZM4M8zlb.


This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender immediately and delete this e-mail from your system. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Ricardo (save for reports and other documentation formally approved and signed for release to the intended recipient). Only Directors are authorised to enter into legally binding obligations on behalf of Ricardo. Ricardo may monitor outgoing and incoming e-mails and other telecommunications systems. By replying to this e-mail you give consent to such monitoring. The recipient should check e-mail and any attachments for the presence of viruses. Ricardo accepts no liability for any damage caused by any virus transmitted by this e-mail. "Ricardo" means Ricardo plc and its subsidiary companies. Ricardo plc is a public limited company registered in England with registered number 00222915. The registered office of Ricardo plc is Shoreham Technical Centre, Shoreham-by Sea, West Sussex, BN43 5FG.

VNuhaan avatar Apr 20 '17 18:04 VNuhaan

I didn't receive file but tileserver-php serving legend correctly. See: http://labs.klokantech.com/tileserver-php/geography-class.json You have to modify your viewer to see a legend.

daliborjanak avatar Apr 24 '17 08:04 daliborjanak

I sent the file via email, that didn't work. So hereby I attach it to the post. It worked with the tile server from infostreams.

tileserver_legend Rename extension to mbtiles

VNuhaan avatar Apr 24 '17 19:04 VNuhaan

I found the 'problem'. The legend I create uses ' (quote). I replaced them with " (double quotation mark). It looks like the quote is a special character. Are there more special characters which you can not use in a legend?

VNuhaan avatar Jun 09 '17 09:06 VNuhaan

There is PHP json_decode (http://php.net/manual/en/function.json-decode.php) which is escaping special characters. You cannot use characters which are not allowed unescaped in JSON format.

daliborjanak avatar Jun 14 '17 16:06 daliborjanak