Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostGIS JSON field #380

Closed
sanfilippopablo opened this issue Mar 27, 2018 · 3 comments
Closed

PostGIS JSON field #380

sanfilippopablo opened this issue Mar 27, 2018 · 3 comments

Comments

@sanfilippopablo
Copy link

Hello! I have a JSON field in my PostGIS table that I want to put as an object in the properties of the feature. However, the json is being put as a string. Is it possible to parse it to an object?

@ARolek
Copy link
Member

ARolek commented Mar 28, 2018

@sacontreras currently the MVT spec has no treatment specifically for objects or lists, which is why the JSON is being encoded as a string. There's a discussion on the spec repo for this topic here.

Near term I think you will need to use JSON.parse() on the client side to convert the string to a JSON object. Alternatively you could pull the important parameters out of the JSON object in your ProviderLayer SQL and encode the values as normal tags.

@sacontreras
Copy link

@ARolek While I do find this topic interesting, I think you've confused me with the original poster (@sanfilippopablo). 👍

@sanfilippopablo
Copy link
Author

@ARolek yes, JSON.parse() client side is what I'm doing right now, I just wanted to avoid that overhead. This isn't an issue with tegola currently, then. I'll close. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants