koop-retired / koop-server

PROJECT DEPRECATED - DO NOT USE
Apache License 2.0
5 stars 7 forks source link

Return actual JSON from a SQLite database rather than a string. #9

Closed nixta closed 9 years ago

nixta commented 9 years ago

SQLite rows coming back from a database were coming back as strings, not JSON.

[{
"type": "FeatureCollection",
"features": [
"{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-111.4453125,36.87962060502676]}}",
"{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-101.865234375,35.10193405724606]}}",
"{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-108.28125,39.50404070558415]}}",
"{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-86.044921875,37.43997405227057]}}",
"{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-96.85546875,40.58058466412764]}}"
],
"name": "map.geojson",
"updated_at": "2013-08-09T02:29:43Z"
}]

Now they'll come back looking like this:

[{
"type":"FeatureCollection",
"features":[
{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[-111.4453125,36.87962060502676]}},
{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[-101.865234375,35.10193405724606]}},
{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[-108.28125,39.50404070558415]}},
{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[-86.044921875,37.43997405227057]}},
{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[-96.85546875,40.58058466412764]}}
],
"name":"map.geojson",
"updated_at":"2013-08-09T02:29:43Z"
}]
chelm commented 9 years ago

Score. Thanks @nixta!