This project is read-only.
ESRI - 2010 Key US Demographics by ZIP Code, Place and County (Trial)

Category:
TypeProviders.AzureMarketPlace
Description: 2010 Key US Demographics by ZIP Code, Place, and County Data is a select offering of the demographic data required to understand a market. For more information, please goto https://datamarket.azure.com/dataset/c7154924-7cab-47ac-97fb-7671376ff656
Code:
type D = Microsoft.FSharp.Data.TypeProviders.ODataService < ServiceUri = "https://api.datamarket.azure.com/Esri/KeyUSDemographicsTrial/" >

let Esri() =
let pl = D.GetDataContext()
//To sign up for a Windows Azure Marketplace account, please go to https://datamarket.azure.com/account/info
pl.Credentials <- NetworkCredential (Utils.ADM_USER_ID, Utils.ADM_ACCOUNT_ID)

query {
for c in pl.demog1 do
where (c.StateName = "Washington")
where (c.CountyName = "King County")
sortBy c.GeographyId
} |> Seq.filter (fun i -> match i.GeographyName.Trim().ToLower() with
| "redmond" -> true
| "bellevue" -> true
| "kirkland" -> true
| _ -> false)
|> Seq.iter (fun i -> printfn "%A - %A" i.GeographyId i.PerCapitaIncome2010.Value )

// sample output
// "98004" - 58631
// "98005" - 44672
// "98006" - 51553
// "98007" - 36689
// "98008" - 43038
// "98033" - 55849
// "98034" - 39577
// "98052" - 47359
// "98053" - 47164


Execution Result:
"98004" - 58631
"98005" - 44672
"98006" - 51553
"98007" - 36689
"98008" - 43038
"98033" - 55849
"98034" - 39577
"98052" - 47359
"98053" - 47164

Last edited Mar 1, 2012 at 8:05 PM by ttliu2000, version 3

Comments

No comments yet.