I am running a cfhttp request as follows:
<!--- JSON data is sometimes distributed as a JavaScript function.
The following REReplace functions strip the function wrapper. --->
<cfset theData = REReplace(cfhttp.FileContent, "^\s*[[:word:]]*\s*\(\s*","")>
<cfset theData = REReplace(theData, "\s*\)\s*$", "")>
<cfset cfData = DeserializeJSON(theData)>
<cfdump var="#theData#" >
This results in:
{ "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "LIBNAME": "Crownhill Library", "ADD1": "Cross Park Road", "ADD2": "Crownhill", "ADD3": "Plymouth", "PCODE": "PL6 5AN", "TEL": "01752 306248", "EMAIL": "Crownhill.Library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/c rownhilllibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.132955965168074, 50.406718514326919 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Devonport Library", "ADD1": "Welcome Hall", "ADD2": "Fore Street", "ADD3": "Plymouth", "PCODE": "PL1 4DP", "TEL": "01752 305203", "EMAIL": "Devonport.Library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/d evonportlibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.174697018052764, 50.372827940532417 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Efford Library", "ADD1": "19 Torridge Way", "ADD2": "Efford", "ADD3": "Plymouth", "PCODE": "PL3 6JQ", "TEL": "01752 308985", "EMAIL": "Efford.Library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/e ffordlibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.110040307590939, 50.388079925877328 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Eggbuckland Library", "ADD1": "Eggbuckland Community College, Westcott Close", "ADD2": "Eggbuckland", "ADD3": "Plymouth", "PCODE": "PL6 5YB", "TEL": "01752 786353", "EMAIL": "library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/e ggbucklandlibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.122846665154559, 50.39997987154797 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Ernesettle Library", "ADD1": "3 Hornchurch Road", "ADD2": "Ernesettle", "ADD3": "Plymouth", "PCODE": "PL5 2TQ", "TEL": "01752 365522", "EMAIL": "Ernesettle.Library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/e rnesettlelibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.179056232722283, 50.418787316598078 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Estover Library", "ADD1": "Tor Bridge High School, Miller Way", "ADD2": "Estover", "ADD3": "Plymouth", "PCODE": "PL6 8UN", "TEL": "01752 302502", "EMAIL": "estover.library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/e stoverlibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.100470326558343, 50.411525229608934 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Laira Library", "ADD1": "240 Old Laira Road", "ADD2": "Laira", "ADD3": "Plymouth", "PCODE": "PL3 6AF", "TEL": "01752 665737", "EMAIL": "laira.library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/l airalibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.106933464527195, 50.383632173669646 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "North Prospect Library", "ADD1": "163 North Prospect Road", "ADD2": "North Prospect", "ADD3": "Plymouth", "PCODE": "PL2 2ND", "TEL": "01752 398138", "EMAIL": "northprospect.library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\r\ northprospectlibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.164283586221993, 50.388021365334723 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Peverell Library", "ADD1": "242a Peverell Park Road", "ADD2": "Peverell", "ADD3": "Plymouth", "PCODE": "PL3 4QF", "TEL": "01752 305633", "EMAIL": "peverell.library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/p everelllibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.145326106515149, 50.393963077714297 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Plympton Library", "ADD1": "Ridgeway", "ADD2": "Plympton", "ADD3": "Plymouth", "PCODE": "PL7 2AS", "TEL": "01752 305630", "EMAIL": "Plympton.Library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/p lymptonlibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.051702307546147, 50.387879564292582 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Plymstock Library", "ADD1": "Horn Cross Road", "ADD2": "Plymstock", "ADD3": "Plymouth", "PCODE": "PL9 9BU", "TEL": "01752 306606", "EMAIL": "Plymstock.Library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/p lymstocklibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.088128950729001, 50.359990687654388 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Southway Library", "ADD1": "351 Southway Drive", "ADD2": "Southway", "ADD3": "Plymouth", "PCODE": "PL6 6QR", "TEL": "01752 305636", "EMAIL": "southway.library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/s outhwaylibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.125622609595956, 50.429498444324999 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "St Budeaux Library", "ADD1": "The Square, Victoria Road", "ADD2": "St Budeaux", "ADD3": "Plymouth", "PCODE": "PL5 1RQ", "TEL": "01752 306237", "EMAIL": "stbudeaux.library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/s tbudeauxlibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.186906015481138, 50.402964958484922 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Stoke Library", "ADD1": "21 Albert Road", "ADD2": "Stoke", "ADD3": "Plymouth", "PCODE": "PL2 1AB", "TEL": "01752 306239", "EMAIL": "stoke.library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/s tokelibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.170958831568073, 50.379008467120052 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Tothill Library", "ADD1": "Tothill Community Centre, Knighton Road", "ADD2": "St Judes", "ADD3": "Plymouth", "PCODE": "PL4 9DA", "TEL": "01752 667427", "EMAIL": "tothill.library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/t othilllibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.119046670061567, 50.373587405862175 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "West Park Library", "ADD1": "423 -425 Crownhill Road", "ADD2": "Honicknowle", "ADD3": "Plymouth", "PCODE": "PL5 2LJ", "TEL": "01752 306241", "EMAIL": "westpark.library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/w estparklibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.166488144592547, 50.412585857276191 ] ] } }, { "type": "Feature", "properties": { "LIBNAME": "Central Library", "ADD1": "Armada Way", "ADD2": "City Centre", "ADD3": "Plymouth", "PCODE": "PL4 8AL", "TEL": "01752 305912", "EMAIL": "library@plymouth.gov.uk", "WEB": "http:\/\/www.plymouth.gov.uk\/homepage\/leisureandtourism\/libraries\/findyourlibrary\/c entrallibrary\/lendinglibrary.htm", "NOTES": null }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -4.137880281630226, 50.374063170919605 ] ] } } ] }
I have searched the internet on DeSerializeJSON() to try and make sense of the above but am getting nowhere. How would I turn it into a query or read it so that I can get the information out into a nice formatted way - or if all I wanted to do is get the coordinates out so I could plot a map - how would I do that - I am guessing it needs to be a query of sorts.
All the answers I have found get me errors like "Complex structures" or "Runtime".
Many thanks for helping in advance - this isn't the only one I have to try and make head or tail out of!! So advice also on how different types of structures like the above are read would be really useful.
J