Last active
December 2, 2016 16:26
-
-
Save diegomozqueda/f2b2bfa498561a03d4817db1523774d8 to your computer and use it in GitHub Desktop.
MySQL, Query to generate GeoJson | MySQL, Consulta para generar GeoJson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
1 as id, | |
JSON_OBJECT( | |
'type', 'FeatureCollection', | |
'features', | |
JSON_OBJECT( | |
'type', 'Feature', | |
'properties', | |
JSON_OBJECT( | |
'clave', '1293', | |
'table-header', JSON_ARRAY('clave','Elemento'), | |
'table-body', JSON_ARRAY(JSON_ARRAY('053','Elemento 53'),JSON_ARRAY('054','Elemento 54'),JSON_ARRAY('070','Elemento 70')), | |
'color', 'blue', | |
'rank', '7', | |
'ascii', '71' | |
), | |
'geometry', ST_AsGeoJSON(ST_GeomFromText('POINT(11.11111 12.22222)'),2) | |
) | |
) as geojson |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment