<div dir="ltr">Hi,<div><br></div><div>this is my first mail on this list, I didn't know if I should have posted on dev list or this one. Don't hesitate to correct.</div><div><br></div><div>With postgis 2.4 we now have the possibility to generate mvt format directly in SQL, what I really like is the ability to construct a mvt response with geometrie + data. The sql result is directly well formated and ready to use. When I need to use geojson in my app I need something like that :</div><div><br></div>{
"type": "Feature", <div> "geometry": </div><div> { </div><div> "type": "Point", </div><div> "coordinates": [125.6, 10.1] </div><div> }, </div><div> "properties": {
"name": "Dinagat Islands"
}</div><div> }</div><div><br></div><div>In order to do that I do :</div><div>SELECT name, st_geojson(geom) as geom FROM mytable</div><div><br></div><div>And then I my code I manipulate "name" to put it in the json under "properties" there hack around to directly return geojson, but they're hack not actual solutions.</div><div><br></div><div>What I imagine is something like that :</div><div><br></div><div>SELECT st_geojson(x) FROM (SELECT name, geom FROM mytable) x</div><div><br></div><div>the signature would be :</div><div><br></div><div>text St_AsGeoJSON(anyelement set row)</div><div><br></div><div>I do not know if this question has already been asked, I found nothing when I googled. Do you think that this is a legitimate feature request ?</div><div><br></div><div>Thanks.</div><div><br><div><br></div></div></div>