Hello,
Before I look how to write this in Python, I was wondering if SQLite had the following internal features:
1. Join some columns so that I only get a single column through SELECT, where each original item should have a \n added so they're still separate
2. Export the table as geojson instead of CVS.
The goal is to turn the following table into a geojson file, where items in the <desc>…</desc> field must be separated with \n:
CREATE TABLE camping(id INTEGER PRIMARY KEY,name TEXT,latitude TEXT,longitude TEXT,phone TEXT,www TEXT,email TEXT);
→
===========
{
"geometry": {
"coordinates": [
2.1239,
48.123
],
"type": "Point"
},
"properties": {
"description": "email=blah@blah.com\nphone=123-4567",
"name": "Some place"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
2.1239,
48.123
],
"type": "Point"
},
"properties": {
"description": "www=www.acme.com",
"name": "Some other place"
},
"type": "Feature"
},
etc.
===========
Thank you.