You can get the entire JSON string (or XML or whatever) returned by the server for a geocoding match by using SQL, see GeocodeAddressMatches. This geocodes an address and returns a record for each match with Name and Confidence for each: --SQL9 SELECT StringJsonValue([value], 'name', true) AS [name], StringJsonValue([value], 'confidence', true) AS [confidence] FROM CALL GeocodeAddressMatches([bing], 'New York, Park Ave, 4'); This does the same and adds coordinates returned for each match as well with the lat/lon values and CalculationMethod: --SQL9 FUNCTION decodeMatches(matches NVARCHAR) TABLE AS ( SELECT [index], CAST (StringJsonValue([value], 'coordinates', false) AS FLOAT64X2) AS [coord], StringJsonValue([value], 'calculationMethod', true) AS [method] FROM CALL StringToJsonArrayValues(matches) ) END; SELECT StringJsonValue([value], 'name', true) AS [name], StringJsonValue([value], 'confidence', true) AS [confidence], SPLIT CALL decodeMatches(StringJsonArray([value], 'geocodePoints')) FROM CALL GeocodeAddressMatches([bing], 'New York, Park Ave, 4'); Hope this helps.
|