Hi,
for a little website I´m dealing with
geojson. Normally I use postgis for heavy stuff like this but as F3 has JIG with JSON Format I thought it could work to
use it and benefit from mapper / cursor sweetness.
Unfortunately it feels so close yet so far ... Here are my needs.
My JIG DB looks like this:
{ "58eceeadb67fd3.98642197": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6,10.1]
},
"properties": {
"id": "1",
"name": "Dinagat Islands",
"desc": "Coffee is good"
}
},
"58eceee4530111.78843208": {
"type": "yeas",
"geometry": {
"type": "Point",
"coordinates": [0,0]
},
"properties": {
"id": "2",
"name": "Null Island",
"desc": "New desc"
}
}
}
1.)
How could I get raw JSON data of all entry means everything under each hash key (f.e. 58eceee4530111.78843208)In the end I would need a JSON structure like.
PSEUDO CODE: $results = $mapper->fullRawJson( '' )
{
"type":"FeatureCollection",
"features":[
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
},
"properties": {
"id":"1",
"name": "Dinagat Islands",
"desc":"Coffee is good"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [0,0]
},
"properties": {
"id":"2",
"name": "Null Island",
"desc":"beer is better"
}
}
]
}
I´ve checked ->read() ->load() ->find() and to extend cursor / JIG Mapper but cannot see the forest because of trees.
(Maybe because I spare to decode as it´s already in JSON)
2)
Say I´m loading an object like
Same here I would need RAW JSON object returned looking like:
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [0,0]
},
"properties": {
"id":"2",
"name": "Null Island",
"desc":"beer is better"
}
}
As always,
thanks for you ideas and help.
– anatol