Created
December 15, 2016 18:35
-
-
Save ntsh/4537035920a31cf9f226a36f7647c075 to your computer and use it in GitHub Desktop.
Json Data to latitude longitude list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = {"merchants":[{"storeList":[{"address":"Unit R01 Paddington Station London W2 1HB","name":"Paddington Station","longitude":"-0.177476","latitude":"51.517596"},{"address":"Unit 53 Broadgate Link (opposite Boots) Liverpool Street Station London EC2M 7PY","name":"Liverpool street","longitude":"-0.081423","latitude":"51.519233"},{"address":"Unit 61 Victoria Station (next to M&S) London SW1V 1JT","name":"Victoria Station","longitude":"-0.143641","latitude":"51.494709"},{"address":"281 Wimbledon Park Road Southfields London SW19 6NW","name":"Wimbledon Park Road","longitude":"-0.207318","latitude":"51.44379"},{"address":"Wimbledon Station Wimbledon SW19 7NL","name":"Wimbledon Station","longitude":"-0.206437","latitude":"51.421571"},{"address":"Unit 1 The Vaults London Bridge Station SE1 9SP","name":"London Bridge Station","longitude":"-0.085975","latitude":"51.504856"},{"address":"Barry House 20-22 Worple Road Wimbledon SW19 4DH","name":"Barry House","longitude":"-0.209519","latitude":"51.420975"},{"address":"Raynes Park Station Approach Road SW20 0JY","name":"Raynes Park Station","longitude":"-0.230244","latitude":"51.408756"}]}]}; | |
var merchants = data.merchants; | |
var locations = ""; | |
for (i=0; i< merchants.length; i++) { | |
if(merchants[i].storeList != undefined) { | |
stores = merchants[i].storeList; | |
for(j=0; j< stores.length; j++) { | |
locations += stores[j].latitude + "," + stores[j].longitude + "\n"; | |
} | |
} | |
} | |
console.log(locations); | |
// Copy the output on this app: http://www.darrinward.com/lat-long/?id=2489595 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment