#include #include #include #include #include #include #include #include #include namespace Format { struct fmtfData { int width; int precision; }; inline fmtfData fmtf(int w, int p) { fmtfData d; d.width = w; d.precision = p; return d; } inline std::ostream& operator<< (std::ostream& os, fmtfData d) { os << std::fixed << std::showpoint << std::setw(d.width) << std::setprecision(d.precision); return os; } struct fmtfiData { int width; }; inline fmtfiData fmtfi(int w) { fmtfiData d; d.width = w; return d; } inline std::ostream& operator<< (std::ostream& os, fmtfiData d) { os << std::fixed << std::noshowpoint << std::setw(d.width) << std::setprecision(0); return os; } struct fmteData { int width; int precision; }; inline fmteData fmte(int w, int p) { fmteData d; d.width = w; d.precision = p; return d; } inline std::ostream& operator<< (std::ostream& os, fmteData d) { os << std::scientific << std::showpoint << std::setw(d.width) << std::setprecision(d.precision); return os; } } // namespace Format using namespace std; using namespace Format; enum ArchStyle { AS_Bungalow, AS_ColonialRevival, AS_Contemporary, AS_Craftsman, AS_EnglishCottage, AS_FrenchChateau, AS_Mission, AS_Prairie, AS_QueenAnne, AS_Ranch, AS_Shingle, AS_Spanish, AS_Tudor, AS_None, AS_Vernacular, AS_first = AS_Bungalow, AS_last = AS_Vernacular, }; const char* styleNames[] = { "Bungalow", "Colonial Revival", "Contemporary", "Craftsman", "English Cottage", "French Chateau", "Mission Revival", "Prairie", "Queen Anne", "Ranch", "Shingle", "Spanish Colonial Revival", "Tudor", "Unknown", "Vernacular", }; unsigned nStyles = sizeof(styleNames) / sizeof(styleNames[0]); const char* archStyleKMLNames[] = { "Bungalow", "ColonialRevival", "Contemporary", "Craftsman", "EnglishCottage", "FrenchChateau", "MissionRevival", "Prairie", "QueenAnne", "Ranch", "Shingle", "SpanishRevival", "Tudor", "Unknown", "Vernacular", }; const char* archStyleIconURLs[] = { "http://arden.org/professorville/icons/Bungalow.tif", "http://arden.org/professorville/icons/ColonialRevival.tif", "http://arden.org/professorville/icons/Contemporary.tif", "http://arden.org/professorville/icons/Craftsman.tif", "http://arden.org/professorville/icons/EnglishCottage.tif", "http://arden.org/professorville/icons/FrenchChateau.tif", "http://arden.org/professorville/icons/MissionRevival.tif", "http://arden.org/professorville/icons/Prairie.tif", "http://arden.org/professorville/icons/QueenAnne.tif", "http://arden.org/professorville/icons/Ranch.tif", "http://arden.org/professorville/icons/Shingle.tif", "http://arden.org/professorville/icons/SpanishRevival.tif", "http://arden.org/professorville/icons/Tudor.tif", "http://arden.org/professorville/icons/Unknown.tif", "http://arden.org/professorville/icons/Vernacular.tif", }; const char* categoryKMLNames[] = { "noncat", "one", "two", "three", "four", }; const char* categoryIconURLs[] = { "http://arden.org/professorville/icons/noncat.tif", "http://arden.org/professorville/icons/one.tif", "http://arden.org/professorville/icons/two.tif", "http://arden.org/professorville/icons/three.tif", "http://arden.org/professorville/icons/four.tif", }; const char* professorialKMLName = "professor"; const char* professorialIconURL = "http://arden.org/professorville/icons/Professor.tif"; const char* nonProfessorialKMLName = "nonprofessor"; const char* nonProfessorialIconURL = "http://arden.org/professorville/icons/NonProfessor.tif"; struct House { const char* number; const char* street; const char* suffix; ArchStyle as; unsigned yearBuilt; unsigned category; bool professorial; double longitude; double latitude; double heading; double range; double longCoord; double latCoord; double altCoord; }; House houses[] = { { "271", "Addison", "Ave", AS_Vernacular, 1894, 4, false, -122.1556046307446, 37.44175830627852, -5.77115218863551e-12, 130.6384174476131, -122.1557765947194,37.4418535359861,0 }, { "281", "Addison", "Ave", AS_ColonialRevival, 1900, 0, false, -122.1555170003095, 37.44186000034649, -1.881877302910865e-10, 141.5506367037588, -122.1556392434786,37.44196950082375,0 }, { "301", "Addison", "Ave", AS_ColonialRevival, 1901, 3, true, -122.1553835404354, 37.44207588144278, -2.390214085997806e-05, 68.28967333207119, -122.1553608586416,37.44225416702915,0 }, { "310", "Addison", "Ave", AS_Contemporary, 1938, 0, false, -122.1551042803924, 37.44233931614109, 0.0001033811035399402, 89.13956873281269, -122.1548621836856,37.44218789553972,0 }, { "319", "Addison", "Ave", AS_Craftsman, 1909, 0, false, -122.1550875305268, 37.44234147077336, 7.183610995033458e-05, 84.49325035784115, -122.1552098993123,37.44247051851139,0 }, { "326", "Addison", "Ave", AS_Vernacular, 1907, 0, false, -122.155063340975, 37.44235116389796, 5.441433338464349e-05, 74.96201369009742, -122.1546899271846,37.44227852923939,0 }, { "327", "Addison", "Ave", AS_ColonialRevival, 1902, 3, true, -122.154870146534, 37.44251689047693, 0.000149382572372808, 52.43594407965966, -122.1550422697998,37.44258959180889,0 }, { "342", "Addison", "Ave", AS_Craftsman, 1912, 0, false, -122.1546320864513, 37.44251360258729, -8.718245121627267e-05, 99.9322366722525, -122.154526869332,37.4424757904339,0 }, { "358", "Addison", "Ave", AS_QueenAnne, 1894, 0, false, -122.1546298871779, 37.44252942094958, -7.275439060771545e-05, 72.04657395360135, -122.1543583183669,37.44260171553888,0 }, { "370", "Addison", "Ave", AS_ColonialRevival, 1895, 0, false, -122.1544920000121, 37.44283799997405, -7.38535512771816e-12, 103.9137522215707, -122.1542951940781,37.44276124234946,0 }, { "376", "Addison", "Ave", AS_ColonialRevival, 1904, 0, false, -122.1544798737764, 37.44285001392311, -3.659510186770922e-11, 89.76882950164885, -122.1542362942318,37.44288948154919,0 }, { "940", "Bryant", "St", AS_ColonialRevival, 1900, 0, false, -122.1557870003871, 37.44219890221593, -0.0006941146037255719, 74.8371571575004, -122.1560491012735,37.44215951137895,0 }, { "943", "Bryant", "St", AS_ColonialRevival, 1904, 0, false, -122.1557842996877, 37.44221660592097, -0.0006542298580934279, 83.52527603103026, -122.1557510320432,37.44248957580929,0 }, { "944", "Bryant", "St", AS_Craftsman, 1902, 0, false, -122.1557920990805, 37.44221070594035, -0.0006294239636201706, 78.63566585536823, -122.1559337467333,37.44210858931044,0 }, { "951", "Bryant", "St", AS_ColonialRevival, 1898, 0, true, -122.155605, 37.442422, 0, 1000, -122.155605,37.442422,0 }, { "1005", "Bryant", "St", AS_ColonialRevival, 1893, 2, true, -122.1556869247658, 37.44221663978695, -0.0004859060298292457, 160.0024815214706, -122.1549820668966,37.44207426709746,0 }, { "1008", "Bryant", "St", AS_Craftsman, 1999, 0, false, -122.1556712009749, 37.44218829428591, -0.0004590909715462426, 178.114664136811, -122.1553496753341,37.44176857351205,0 }, { "1010", "Bryant", "St", AS_ColonialRevival, 1902, 3, true, -122.1556332835812, 37.44213526459518, -0.0004165506095992129, 170.934067464742, -122.1552260986479,37.44164206056649,0 }, { "1020", "Bryant", "St", AS_ColonialRevival, 1901, 3, false, -122.1550021454673, 37.44178716495999, -2.679794619961236e-05, 154.9795432079416, -122.1550501749818,37.44153384390588,0 }, { "1027", "Bryant", "St", AS_ColonialRevival, 1898, 0, false, -122.1549858413424, 37.44179167342239, -2.587454067993351e-05, 125.4174710560778, -122.1545976464089,37.44185685105526,0 }, { "1028", "Bryant", "St", AS_ColonialRevival, 1902, 0, false, -122.1546844515316, 37.44153364843901, 0.0001569548542137692, 117.079681911369, -122.1548943875482,37.44145030683674,0 }, { "1033", "Bryant", "St", AS_ColonialRevival, 1899, 3, true, -122.1546816350613, 37.44153650079677, 0.0001550113311992673, 95.1968147253147, -122.1544649661066,37.44171440300855,0 }, { "1036", "Bryant", "St", AS_ColonialRevival, 1920, 0, false, -122.1546846308122, 37.4415304041549, 0.0001395382772277829, 81.84123878656547, -122.1547534671562,37.44137219520196,0 }, { "1044", "Bryant", "St", AS_Craftsman, 1902, 3, false, -122.1545184361051, 37.44135001225387, 0.0002135730552987858, 75.51935508563956, -122.1546476788387,37.4412871192071,0 }, { "1052", "Bryant", "St", AS_Craftsman, 1900, 4, false, -122.154518155216, 37.44134588769614, 0.0001958789542203277, 53.009792035774, -122.1544923040432,37.44118681263005,0 }, { "1061", "Bryant", "St", AS_ColonialRevival, 1899, 2, false, -122.1543795043318, 37.4415480655956, 0.0002705129719290873, 58.69148494666456, -122.154183098539,37.44154393379549,0 }, { "1100", "Bryant", "St", AS_Craftsman, 1902, 4, false, -122.1541635383842, 37.44108486931948, 0.0003819165542413207, 78.16865766874596, -122.1541081516925,37.44095843577899,0 }, { "1106", "Bryant", "St", AS_Contemporary, 1997, 0, false, -122.1541541541433, 37.4410857102168, 0.0003230057918553051, 76.92599133442384, -122.1539657192476,37.44087990411507,0 }, { "1116", "Bryant", "St", AS_ColonialRevival, 1904, 0, false, -122.1539610739809, 37.4409272920139, 0.000391474174229394, 67.95766006062179, -122.1538471102094,37.44078946478353,0 }, { "1121", "Bryant", "St", AS_ColonialRevival, 1892, 3, false, -122.1537298602978, 37.44092228209809, 0.0005094684475877849, 79.8843998577926, -122.1534229423066,37.44104096207874,0 }, { "1130", "Bryant", "St", AS_Craftsman, 1904, 3, true, -122.1537228147775, 37.44091762486789, 0.0004469511770020612, 72.75072490994502, -122.1536366326555,37.44065669785802,0 }, { "1135", "Bryant", "St", AS_Craftsman, 1910, 0, false, -122.1536685144549, 37.4409243882764, 0.0003992527888788029, 124.4024908989988, -122.1532466265297,37.440945184013,0 }, { "1140", "Bryant", "St", AS_ColonialRevival, 1903, 0, false, -122.1536604456798, 37.44090066766364, 0.0003754807406343288, 132.2948037486817, -122.1534729673714,37.4405738788922,0 }, { "1143", "Bryant", "St", AS_Prairie, 1912, 0, false, -122.1536403632825, 37.44090050677445, 0.0003625343525530352, 121.7593770461665, -122.1531173885236,37.44085973075784,0 }, { "1148", "Bryant", "St", AS_Craftsman, 1902, 0, false, -122.1536320462051, 37.44088413446928, 0.000349388312290361, 117.9125807761204, -122.153340680752,37.44051274058315,0 }, { "1160", "Bryant", "St", AS_ColonialRevival, 1909, 4, false, -122.153597674273, 37.44083648251761, 0.0003186782693754838, 151.7140475629081, -122.1531819646224,37.44040084082705,0 }, { "1200", "Bryant", "St", AS_Tudor, 1904, 3, true, -122.1531223741509, 37.44038005993494, 0.0005846703295445282, 133.4774580438111, -122.152801703621,37.44013248542559,0 }, { "1201", "Bryant", "St", AS_Contemporary, 1966, 0, false, -122.1526044933547, 37.44026790886485, 0.0008572442968281382, 128.1356862016294, -122.1523347580387,37.44044036333031,0 }, { "1225", "Bryant", "St", AS_Contemporary, 1964, 0, false, -122.1525864382565, 37.44026962445812, 0.0008231145541270203, 121.9151139040756, -122.1521866718389,37.44027819787278,0 }, { "1251", "Bryant", "St", // This property is also known as 305 Melville. AS_QueenAnne, 1901, 3, false, -122.1522663666736, 37.43990727184832, 0.0009803387977146492, 112.702584596564, -122.1518087370712,37.43997378003286,0 }, { "1017", "Bryant", "St", AS_ColonialRevival, 1893, 3, true, -122.15478, 37.441942, 0, 1000, -122.15478,37.441942,0 }, { "1055", "Cowper", "St", AS_Mission, 1910, 2, false, -122.151727999963, 37.44396099993694, 1.223611722234779e-11, 78.13377076579229, -122.1517103396668,37.44394663657222,0 }, { "1107", "Cowper", "St", AS_Contemporary, 1998, 0, false, -122.1507258548204, 37.44364710880339, 0.0005113307118527411, 172.0325047931846, -122.1508178465848,37.44346037940583,0 }, { "1140", "Cowper", "St", AS_Contemporary, 1955, 0, false, -122.1516652416558, 37.44329031283547, -5.571135542747179e-05, 111.654111278703, -122.1517040187713,37.44320821295207,0 }, #if 0 // Became 500 Kingsley in 1999 { "1201", "Cowper", "St", AS_None, 1963, 0, false, -122.1502892898936, 37.44274715740696, 0.0007517846798426663, 116.9549024089386, -122.1500578333465,37.44296111982457,0 }, #endif { "1211", "Cowper", "St", AS_Contemporary, 1963, 0, false, -122.1502740007799, 37.44275120318623, 0.0007183024045425958, 116.8040008538504, -122.1499179289487,37.4428227702584,0 }, { "1225", "Cowper", "St", AS_Contemporary, 1948, 0, false, -122.149756, 37.442719, 0, 1000, -122.149756,37.442719,0 }, { "1236", "Cowper", "St", AS_Craftsman, 1910, 0, false, -122.1497355511818, 37.44233993319319, 0.0009441197787386924, 129.4581935251958, -122.1499289483893,37.44224021345357,0 }, { "1238", "Cowper", "St", AS_Craftsman, 1904, 0, false, -122.149593363279, 37.44222742776446, 0.0009171715304321556, 114.3503747262688, -122.1497880265953,37.44218341423453,0 }, { "1247", "Cowper", "St", AS_Spanish, 1927, 1, false, -122.1495833190387, 37.44223885074651, 0.000884077016475993, 109.5043234915873, -122.1492112975145,37.44251260064666,0 }, { "1300", "Cowper", "St", AS_Contemporary, 1958, 0, false, -122.1490760378819, 37.44191066721545, 0.001143026661328998, 104.6182903807923, -122.1491250548814,37.44175500791831,0 }, { "1312", "Cowper", "St", AS_ColonialRevival, 1910, 0, false, -122.1490739167717, 37.44189671727489, 0.001095523834752953, 106.0234895587072, -122.1489763206575,37.44162200653611,0 }, { "1325", "Cowper", "St", AS_Craftsman, 1915, 0, false, -122.1485880294965, 37.44187656251295, 0.001354298001376947, 100.3674897127309, -122.1486151317017,37.44193980496015,0 }, { "1330", "Cowper", "St", AS_Craftsman, 1904, 0, false, -122.1486736930229, 37.44147193884746, 0.001265425482574701, 96.35544787061741, -122.148852546166,37.44151997947731,0 }, { "1335", "Cowper", "St", AS_ColonialRevival, 1904, 0, true, -122.1484937285996, 37.4415127384756, 0.001092643071774649, 99.50652085967243, -122.1484470609206,37.44179516970563,0 }, { "1336", "Cowper", "St", AS_Spanish, 1925, 1, false, -122.1486630195077, 37.4414646750074, 0.001042551637839704, 96.10125865704747, -122.1485904975935,37.44138565621989,0 }, { "1345", "Cowper", "St", AS_Craftsman, 1909, 3, true, -122.1484937285996, 37.4415127384756, 0.001092643071774649, 99.50652085967243, -122.1483042646273,37.44169935038375,0 }, { "1357", "Cowper", "St", AS_Craftsman, 1908, 4, false, -122.1484752809317, 37.44151358197852, 0.001053021311247814, 99.45652814780475, -122.1479972005148,37.44153623575772,0 }, { "1390", "Cowper", "St", AS_Tudor, 1909, 0, false, -122.148279, 37.441175, 0, 1000, -122.148279,37.441175,0 }, { "1401", "Cowper", "St", AS_Craftsman, 1909, 4, false, -122.1479883963843, 37.44115706391364, 0.001144353141884529, 82.62896761086783, -122.147715517963,37.44133790685745,0 }, { "1415", "Cowper", "St", AS_FrenchChateau, 1936, 4, false, -122.1479662739392, 37.44116112267076, 0.001090305133213895, 95.02337677435384, -122.1475791540999,37.44124596330202,0 }, { "235", "Embarcadero", "Rd", AS_Craftsman, 1906, 2, true, -122.15272409802, 37.4395423131954, -0.001117466101010759, 190.3464738831451, -122.1529182087084,37.43956730288303,0 }, { "251", "Embarcadero", "Rd", AS_ColonialRevival, 1906, 0, false, -122.152722312281, 37.43955964053758, -0.0008335003587943338, 94.79337171286228, -122.1526461226488,37.43968148521633,0 }, { "281", "Embarcadero", "Rd", AS_ColonialRevival, 1908, 0, false, -122.1522990200536, 37.43973622080314, -0.000554899988573887, 90.41373471952504, -122.1522560295774,37.43981343092146,0 }, { "359", "Embarcadero", "Rd", AS_Prairie, 1901, 4, false, -122.1504790421439, 37.44021754259547, 0.0004929310777020638, 145.3675275329016, -122.1503243329768,37.44039395407081,0 }, { "425", "Embarcadero", "Rd", AS_Craftsman, 1907, 2, true, -122.1491642948866, 37.44059363279065, 0.0008349908668537518, 82.90110994905501, -122.1490065976654,37.44070393251555,0 }, { "473", "Embarcadero", "Rd", AS_Contemporary, 1988, 0, false, -122.1483901009534, 37.44082061386347, 0.001175116822590795, 125.7897738404688, -122.1482704779591,37.44091219636425,0 }, { "475", "Embarcadero", "Rd", AS_ColonialRevival, 1924, 0, true, -122.148366235038, 37.44083340204546, 0.001099747015231186, 136.2776481225165, -122.1479580396975,37.44103595448715,0 }, { "505", "Embarcadero", "Rd", AS_Craftsman, 1907, 4, false, -122.1473533453278, 37.44116154043836, 0.001423281559632587, 84.20871458197666, -122.1473581114971,37.44116986628836,0 }, { "1091", "Emerson", "St", // Apparently is the same as 225 Lincoln AS_None, 1909, 0, false, -122.155316, 37.440266, 0, 1000, -122.155316,37.440266,0 }, { "1101", "Emerson", "St", AS_Craftsman, 1903, 3, true, -122.15499, 37.440074, 0, 1000, -122.15499,37.440074,0 }, { "1102", "Emerson", "St", AS_Spanish, 1925, 0, false, -122.1552370922469, 37.44019432663617, -0.00143826102181499, 149.0294370309818, -122.1552986805005,37.43973520254546,0 }, { "1111", "Emerson", "St", AS_ColonialRevival, 1903, 4, true, -122.1547326207677, 37.43998287349575, -0.001090035411170812, 133.4932212309083, -122.1548348540781,37.43996184875844,0 }, { "1118", "Emerson", "St", AS_ColonialRevival, 1909, 3, true, -122.1547526156418, 37.43996361093294, -0.001038556626167364, 131.1473426947469, -122.1550581508067,37.43957475734339,0 }, { "1121", "Emerson", "St", AS_ColonialRevival, 1908, 0, false, -122.1548097770026, 37.4393695210431, -0.001029716230334165, 159.851832003332, -122.1546677660164,37.43987801458762,0 }, { "1128", "Emerson", "St", AS_EnglishCottage, 1916, 4, true, -122.1548223824927, 37.4393763402166, -0.0008415045001509575, 151.6344649539364, -122.1549251862,37.43948782555822,0 }, { "1129", "Emerson", "St", AS_Craftsman, 1907, 4, true, -122.1545803906935, 37.43976260929733, -0.0006681570040136924, 139.0009782431764, -122.1544876806493,37.43981006221613,0 }, { "1133", "Emerson", "St", AS_Contemporary, 1976, 0, false, -122.1545729373507, 37.43975879943758, -0.0005937480576878629, 118.7725151743948, -122.1543297568875,37.43964118213083,0 }, { "1134", "Emerson", "St", AS_Craftsman, 1907, 4, true, -122.1547385510915, 37.43940315822267, -0.0006485343618209545, 129.8934597014174, -122.1547693330958,37.4394065682685,0 }, { "1135", "Emerson", "St", AS_Contemporary, 1975, 0, false, -122.1543221824933, 37.43939866758769, -0.0003809231577686662, 130.2645474298315, -122.1540927159545,37.43948890990377,0 }, { "1174", "Emerson", "St", AS_Contemporary, 1980, 0, false, -122.1543358708142, 37.43939359953447, -0.000365801561190092, 123.0536231858594, -122.1546210186761,37.43926237805034,0 }, { "1176", "Emerson", "St", AS_Spanish, 1925, 3, false, -122.154465, 37.43915, 0, 1000, -122.154465,37.43915,0 }, { "200", "Kingsley", "Ave", AS_Craftsman, 1906, 0, false, -122.153560688352, 37.43930085083267, 7.828581837877948e-05, 107.897773465775, -122.1536005372334,37.43935940840389,0 }, { "221", "Kingsley", "Ave", AS_ColonialRevival, 1902, 2, true, -122.1539060729127, 37.43970157193274, -0.000117088924396955, 144.6531520472689, -122.1539961760196,37.4397826094516,0 }, { "222", "Kingsley", "Ave", AS_ColonialRevival, 1906, 0, false, -122.1538768123816, 37.4396884597858, -0.0001103720245435773, 145.5603331482148, -122.153434690528,37.4395355554682,0 }, { "252", "Kingsley", "Ave", AS_Craftsman, 1908, 0, false, -122.1538279443004, 37.43969045573605, -0.000102071718939493, 158.3236174589926, -122.1531765085175,37.43976265955353,0 }, { "257", "Kingsley", "Ave", // Formerly known as 1155 Ramona AS_Craftsman, 1904, 0, false, -122.1534945709166, 37.43986680753621, 9.533013231916369e-05, 202.3449052927335, -122.1533930402219,37.44009890466718,0 }, { "262", "Kingsley", "Ave", AS_Craftsman, 1908, 0, true, -122.1534720331875, 37.4398682657494, 9.101214345288405e-05, 178.0406479820074, -122.1529938664157,37.43994622307675,0 }, { "303", "Kingsley", "Ave", AS_Contemporary, 1963, 0, false, -122.1526424337228, 37.44086249957137, 0.0004842502849127683, 250.7765437861559, -122.1529173159064,37.44072650568846,0 }, { "319", "Kingsley", "Ave", AS_ColonialRevival, 1911, 0, false, -122.1526544669198, 37.44086369750502, 0.0003915893050018586, 136.0849990419416, -122.1526822208014,37.44088037370746,0 }, { "325", "Kingsley", "Ave", AS_Contemporary, 1940, 0, false, -122.1526135090477, 37.44090472911831, 0.0003526350757102877, 79.96193113326066, -122.1526201201698,37.44096282313877,0 }, { "327", "Kingsley", "Ave", AS_Contemporary, 1940, 0, false, -122.152998, 37.441175, 0, 1000, -122.152998,37.441175,0 }, { "333", "Kingsley", "Ave", AS_Contemporary, 1940, 0, false, -122.1526302942981, 37.44125212946249, 0.000326758381209592, 110.2106156160148, -122.152867214779,37.44131467309398,0 }, { "334", "Kingsley", "Ave", AS_ColonialRevival, 1903, 2, true, -122.1526033072898, 37.44122562274864, 0.0003113231046325274, 201.7551373784637, -122.1520768381166,37.44077314374626,0 }, { "335", "Kingsley", "Ave", AS_Contemporary, 1940, 0, false, -122.1525939161151, 37.44121166794133, 0.0002508504133525958, 188.7897011217352, -122.1525012978038,37.44109433806519,0 }, { "343", "Kingsley", "Ave", AS_Contemporary, 1940, 0, false, -122.152606713844, 37.44122417191623, 0.0002353479673032894, 177.7694536037079, -122.1527682286154,37.44143401900043,0 }, { "345", "Kingsley", "Ave", AS_Contemporary, 1940, 0, false, -122.1525846467333, 37.44122179753042, 0.0001741798111094764, 190.3007740770354, -122.1524409343416,37.44121513401624,0 }, { "353", "Kingsley", "Ave", AS_Contemporary, 1940, 0, false, -122.1526029783521, 37.44128338686485, 0.0001384452640260189, 126.7348095876492, -122.1526399900698,37.44152291828927,0 }, { "355", "Kingsley", "Ave", AS_Contemporary, 1940, 0, false, -122.1525905230135, 37.44128318818397, 0.0001321742756741639, 123.8965226732556, -122.1523248498971,37.44129077897496,0 }, { "356", "Kingsley", "Ave", AS_Vernacular, 1899, 1, true, -122.1525630707849, 37.44126607084624, 0.0001269273715745073, 166.4635458726767, -122.1518561556522,37.44087047229584,0 }, { "360", "Kingsley", "Ave", AS_ColonialRevival, 1900, 0, false, -122.1521187585424, 37.4411181267671, 0.0003589212518785247, 166.5504074837251, -122.151785404288,37.44099708771605,0 }, { "363", "Kingsley", "Ave", AS_Contemporary, 1940, 0, false, -122.1521565508238, 37.44116421884612, 0.000326411508177553, 182.5006387981391, -122.1525112777227,37.44163336440059,0 }, { "364", "Kingsley", "Ave", AS_Craftsman, 2000, 0, false, -122.1521324641337, 37.44115992876315, 0.000308277149928958, 170.2286870172625, -122.1517353624146,37.44112713034408,0 }, { "365", "Kingsley", "Ave", AS_Contemporary, 1940, 0, false, -122.1521376330474, 37.44118187894128, 0.0002528395859868815, 159.3760316970922, -122.1521718813556,37.44142313342799,0 }, { "374", "Kingsley", "Ave", AS_Craftsman, 1902, 3, true, -122.152032565617, 37.44118058746198, 0.0002053706077529033, 124.9424589850605, -122.151601479703,37.44123315846353,0 }, { "405", "Kingsley", "Ave", AS_Spanish, 1929, 0, false, -122.1517827665845, 37.44176718543331, 0.0002803217256239097, 218.4868023197017, -122.1516369372991,37.44199300924964,0 }, { "425", "Kingsley", "Ave", AS_Contemporary, 1975, 0, false, -122.1517604117873, 37.44179896029799, 0.0002577612279553969, 210.2597716547043, -122.1514620917389,37.44220446850291,0 }, { "430", "Kingsley", "Ave", AS_ColonialRevival, 1891, 3, true, -122.1517342495, 37.44179872049691, 0.000248881167696233, 177.8797640733329, -122.1510477260784,37.4418470637222,0 }, { "433", "Kingsley", "Ave", AS_ColonialRevival, 1891, 2, false, -122.151787, 37.442436, 0, 1000, -122.151787,37.442436,0 }, { "450", "Kingsley", "Ave", AS_ColonialRevival, 1894, 2, true, -122.1514968058036, 37.44226116666147, 0.0003207059961107487, 176.865532664199, -122.1506246503562,37.44212778462605,0 }, { "457", "Kingsley", "Ave", AS_Tudor, 1914, 2, false, -122.1514650495368, 37.44226745760378, 0.000294101179131736, 183.0818988750365, -122.151205330703,37.44264777195158,0 }, { "459", "Kingsley", "Ave", AS_Tudor, 1914, 0, false, -122.1510781684335, 37.4425661027012, 0.0004269364909098147, 136.0982492392559, -122.1510293994287,37.44288418736824,0 }, { "490", "Kingsley", "Ave", AS_Spanish, 1920, 3, false, -122.1510144646544, 37.4425474308354, 0.0003882583490584966, 219.7792758011203, -122.15028800666,37.44243380137128,0 }, { "500", "Kingsley", "Ave", AS_Spanish, 1999, 0, false, -122.1504141350217, 37.44305900374363, 0.0006426850551751954, 183.7607269940773, -122.1500241326439,37.44297857195744,0 }, { "501", "Kingsley", "Ave", AS_ColonialRevival, 1897, 2, true, -122.1504180505512, 37.44306552344321, 0.0005509953357284667, 160.8232471504321, -122.1504402085172,37.4432119044817,0 }, { "225", "Lincoln", "Ave", // Also known as 1091 Emerson? Category numbers don't match, // could be the second building. AS_Craftsman, 1909, 3, false, -122.1550381575486, 37.4403108685177, 1.171037904684793e-06, 68.41856310823917, -122.1551971806711,37.44033056888763,0 }, { "251", "Lincoln", "Ave", AS_ColonialRevival, 1903, 4, true, -122.1549033766524, 37.44043603013662, 4.399049000383823e-05, 71.69456243443713, -122.1549954600997,37.44060171088986,0 }, { "308", "Lincoln", "Ave", AS_ColonialRevival, 1902, 3, true, -122.1538221492865, 37.44122363937075, 0.0006450215255939504, 113.2726319767271, -122.1537128324611,37.44121173498027,0 }, { "318", "Lincoln", "Ave", AS_ColonialRevival, 1901, 4, true, -122.1538055957753, 37.44122865333048, 0.0006146144387184909, 116.0077322348031, -122.153550391863,37.44140435964853,0 }, { "329", "Lincoln", "Ave", AS_ColonialRevival, 1900, 0, false, -122.1538517638952, 37.44162288755578, 0.0005432802444042009, 146.5126656836441, -122.1540930192714,37.44174076674326,0 }, { "331", "Lincoln", "Ave", AS_ColonialRevival, 1900, 0, false, -122.1538662673233, 37.441640358379, 0.0004995631000614122, 115.9554920222137, -122.1538988647357,37.44180174582436,0 }, { "334", "Lincoln", "Ave", AS_ColonialRevival, 1897, 3, false, -122.1537974501898, 37.44162037654637, 0.0004406219944099899, 123.4354760527301, -122.1532952570084,37.44155112236063,0 }, { "345", "Lincoln", "Ave", AS_ColonialRevival, 1893, 2, true, -122.1535923835331, 37.44192397779202, 0.0005150801797626681, 158.654016951728, -122.1536981580724,37.44200865504298,0 }, { "356", "Lincoln", "Ave", AS_Craftsman, 1896, 1, true, -122.1535420720141, 37.44190540918571, 0.0004684199564305367, 176.8156777323372, -122.1530785661738,37.44174580432305,0 }, { "365", "Lincoln", "Ave", AS_Craftsman, 1903, 2, true, -122.1535565678384, 37.44199851150583, 0.0003622048018797304, 129.7225162491754, -122.1535258232959,37.44229481587235,0 }, { "381", "Lincoln", "Ave", AS_Craftsman, 1894, 4, true, -122.1535434354387, 37.44202491152216, 0.0003413941368828043, 135.003249600812, -122.1532458923324,37.44242396570628,0 }, { "405", "Lincoln", "Ave", AS_Contemporary, 2012, 0, false, -122.1529968796589, 37.44251083527474, 0.0005373888253403288, 134.1467593947284, -122.1529961377214,37.44271632586747,0 }, { "409", "Lincoln", "Ave", AS_Spanish, 1922, 0, false, -122.1528089368495, 37.44278193024643, 0.000611155872866362, 144.8818015053093, -122.1528193134443,37.44286812815916,0 }, { "427", "Lincoln", "Ave", AS_Spanish, 1926, 0, false, -122.1528108941091, 37.44279779328664, 0.0005760386778253114, 109.4652005851265, -122.1526773995972,37.44298482839303,0 }, { "436", "Lincoln", "Ave", AS_ColonialRevival, 1920, 0, false, -122.152730245449, 37.44279130312746, 0.0004978147540553125, 174.5992914172791, -122.1521543598788,37.44281121063774,0 }, { "439", "Lincoln", "Ave", AS_Tudor, 1929, 0, false, -122.152266158864, 37.44311351879257, 0.0007474265850104449, 168.9354002689118, -122.1526149503521,37.44319327670239,0 }, { "451", "Lincoln", "Ave", AS_Spanish, 1924, 0, false, -122.1523107563272, 37.44316014538368, 0.000617137308656617, 95.12024094804998, -122.1524286769512,37.44335322338786,0 }, { "467", "Lincoln", "Ave", AS_Tudor, 1925, 4, false, -122.1521209718544, 37.44345431295908, 0.0006965661792450989, 106.1820451746076, -122.1520899469915,37.44358164858566,0 }, { "510", "Lincoln", "Ave", AS_FrenchChateau, 1931, 3, false, -122.151839629215, 37.44351419133855, 0.0004657289576667389, 164.5915269463706, -122.1512918908062,37.44366419365747,0 }, #if 0 // This property is also known as 1251 Bryant. { "305", "Melville", "Ave", AS_ColonialRevival, 0000, 0, false, -122.1514870250356, 37.44000615284062, 0.0004028313914927222, 103.2975387330448, -122.1517982182743,37.43994743207916,0 }, #endif { "315", "Melville", "Ave", AS_Shingle, 1903, 4, true, -122.1514870250356, 37.44000615284062, 0.0004028313914927222, 103.2975387330448, -122.1516436132855,37.44002514214992,0 }, { "321", "Melville", "Ave", AS_ColonialRevival, 1902, 0, false, -122.1515069586919, 37.44002631838228, 0.0003142370908015092, 81.81273960334016, -122.1515065067462,37.44014023303435,0 }, { "325", "Melville", "Ave", AS_Contemporary, 1961, 0, false, -122.1514933581419, 37.44006886164991, 0.0002182017127799364, 77.31877294773894, -122.1514758377952,37.44026971103924,0 }, { "330", "Melville", "Ave", AS_ColonialRevival, 1900, 0, false, -122.151070890374, 37.44017553986764, 0.0003980241053132198, 154.8087129959338, -122.1508003798488,37.44019044403124,0 }, { "335", "Melville", "Ave", AS_Contemporary, 1958, 0, false, -122.1510980312336, 37.44019066976983, 0.0003577319709906996, 95.99873154560535, -122.1513324063239,37.44034861755922,0 }, { "340", "Melville", "Ave", AS_Contemporary, 1987, 0, false, -122.1510635273976, 37.44020645315754, 0.0003262468083276627, 132.1316847691407, -122.1505797570524,37.44030378022969,0 }, { "353", "Melville", "Ave", AS_ColonialRevival, 1897, 3, true, -122.1512753611171, 37.44035065695055, -8.462460772442463e-05, 100.7829498553397, -122.1512114601389,37.4405412504554,0 }, { "363", "Melville", "Ave", AS_ColonialRevival, 1897, 0, false, -122.1511284409467, 37.44050127291626, 2.615788086733839e-06, 75.31099647897894, -122.1510155525683,37.44067788980768,0 }, { "409", "Melville", "Ave", AS_ColonialRevival, 1901, 0, false, -122.1505359758485, 37.44112882900571, 0.0001322439202887023, 122.3879412889178, -122.1504786304287,37.44117061024001,0 }, { "433", "Melville", "Ave", AS_Shingle, 1894, 2, true, -122.150310495349, 37.44149645147338, 0.0002579670041440167, 120.2997303735716, -122.1502726956094,37.44161228506103,0 }, { "440", "Melville", "Ave", AS_ColonialRevival, 1926, 0, false, -122.150258995619, 37.44146819274201, 0.0002372251587540399, 145.2200770588416, -122.1496357706624,37.44120580926818,0 }, { "450", "Melville", "Ave", AS_Spanish, 1983, 0, false, -122.1494898063313, 37.44145257138238, 0.0006290232644519324, 173.71446692776, -122.1492127768595,37.44133536016714,0 }, { "465", "Melville", "Ave", AS_Contemporary, 1994, 0, false, -122.1495939339239, 37.4415293852198, 0.000504309947081031, 232.3469859048765, -122.1498821109176,37.44182632717254,0 }, { "469", "Melville", "Ave", AS_Contemporary, 1970, 0, false, -122.1498292219502, 37.44156515890575, 4.317359371391699e-05, 128.5028457417462, -122.1496570879077,37.44192286019798,0 }, { "475", "Melville", "Ave", AS_Craftsman, 1911, 2, false, -122.1495943103037, 37.44155626206074, 0.0004774492887107787, 203.8978589713637, -122.1495324831738,37.44203996998919,0 }, { "480", "Melville", "Ave", AS_Contemporary, 1958, 0, false, -122.1495797538738, 37.44155989681428, 0.0004539147317176884, 180.8283322380004, -122.1492575459919,37.44163276043423,0 }, { "500", "Melville", "Ave", AS_Craftsman, 1904, 3, false, -122.1494661102012, 37.4420237348652, 0.0004525171199474297, 185.7108805240094, -122.1488415378799,37.44214424093334,0 }, { "541", "Melville", "Ave", AS_Contemporary, 1951, 0, false, -122.1493679884451, 37.4422046058957, 0.0003516280250069639, 279.9309939879903, -122.148931110957,37.44281497783341,0 }, { "1000", "Ramona", "St", AS_Craftsman, 1905, 0, false, -122.1556739563977, 37.44115799502433, -0.000318830017039687, 148.5923623523216, -122.1559267596695,37.44114889954381,0 }, { "1001", "Ramona", "St", AS_Craftsman, 1908, 3, true, -122.1556725915207, 37.44118254580493, -0.000291556944126168, 165.08181270695, -122.1556443752577,37.44145717992831,0 }, // XXX 1004-6 Ramona, Vernacular, 1911; NC, prof false { "1013", "Ramona", "St", AS_ColonialRevival, 1908, 0, false, -122.1556647220994, 37.44119148411315, -0.0002515841287236354, 144.7925533225043, -122.1554929851157,37.44136145373321,0 }, { "1020", "Ramona", "St", AS_Craftsman, 1907, 0, false, -122.1556730355377, 37.4411764927383, -0.0002106248244036769, 134.3224271600372, -122.1557359266915,37.44101435095342,0 }, { "1021", "Ramona", "St", AS_ColonialRevival, 1905, 4, false, -122.1556593804886, 37.44118100492811, -0.0002006741751425719, 130.6388409750771, -122.1553905591745,37.4412862939141,0 }, { "1024", "Ramona", "St", AS_Craftsman, 1914, 4, false, -122.1556588433782, 37.44116859794728, -0.0001919688362397512, 125.4475699644257, -122.1555889794873,37.44094012840269,0 }, { "1029", "Ramona", "St", AS_ColonialRevival, 1905, 0, true, -122.1556440243826, 37.44116926327003, -0.000185027685765015, 102.1980068126395, -122.1552408795127,37.44120686838689,0 }, { "1030", "Ramona", "St", AS_ColonialRevival, 2011, 0, false, -122.1554803547318, 37.44101138743229, -8.366479761851872e-05, 97.03308917610218, -122.1554520101068,37.44087126263594,0 }, { "1037", "Ramona", "St", AS_ColonialRevival, 1906, 0, true, -122.1554741042805, 37.44101008260167, -7.338618205771159e-05, 87.01347777979998, -122.1551015595206,37.44111236946238,0 }, { "1040", "Ramona", "St", AS_Craftsman, 1914, 0, false, -122.1554610646034, 37.44100403885371, -5.934574339437085e-05, 91.4303427007677, -122.1553315376148,37.44078474964554,0 }, { "1047", "Ramona", "St", AS_ColonialRevival, 1907, 4, true, -122.1554489702035, 37.44099956257002, -5.104127168247713e-05, 85.22210826037825, -122.1549459199812,37.44102277042278,0 }, { "1048", "Ramona", "St", AS_ColonialRevival, 1904, 4, true, -122.1550602890299, 37.44089872747487, 0.0001586640923421267, 93.88554637140544, -122.1551858043603,37.44071007760898,0 }, { "1057", "Ramona", "St", AS_ColonialRevival, 1901, 4, true, -122.1552450934959, 37.44100627160599, 0.0001293683833982199, 117.9013478906626, -122.1546880140519,37.44089556230769,0 }, { "1102", "Ramona", "St", AS_ColonialRevival, 1908, 0, false, -122.1545889374193, 37.44033981031725, 0.0004980307082940542, 136.1144034932147, -122.1547051149955,37.44033505009041,0 }, { "1103", "Ramona", "St", AS_ColonialRevival, 1901, 3, true, -122.1545694066071, 37.44037587565951, 0.0004421083846737006, 117.6522212787374, -122.1543909135946,37.44065415770481,0 }, { "1106", "Ramona", "St", AS_Craftsman, 1905, 0, false, -122.1545711349994, 37.44037038360343, 0.0003903496089294097, 91.53276680626513, -122.1545898206283,37.44024849355379,0 }, { "1112", "Ramona", "St", AS_ColonialRevival, 1905, 0, false, -122.1545668298526, 37.44035978390665, 0.0003390698360863601, 85.83116996868775, -122.1544565011584,37.44018533384189,0 }, { "1115", "Ramona", "St", AS_ColonialRevival, 1903, 2, true, -122.154225, 37.440541, 0, 1000, -122.154225,37.440541,0 }, { "1116", "Ramona", "St", AS_Craftsman, 1902, 0, true, -122.1545250290397, 37.44033031982482, 0.001715154843722664, 112.6093661736787, -122.1542711104849,37.44008383911306,0 }, { "1125", "Ramona", "St", AS_ColonialRevival, 1902, 0, true, -122.1545047413606, 37.44033265430135, 0.001650239401279191, 109.8972605090212, -122.1539969103559,37.4404174261272,0 }, // XXX 1132/1140/1166, Craftsman, 1999 { "1139", "Ramona", "St", AS_ColonialRevival, 1903, 2, false, -122.1538988117518, 37.44016557738312, 0.001924567504249803, 114.0915392111905, -122.1538113870469,37.44026944129398,0 }, { "1147", "Ramona", "St", AS_Craftsman, 1906, 0, true, -122.1538853280001, 37.44016648560567, 0.001649864571249237, 104.6790717703265, -122.1536643197483,37.44018938862121,0 }, #if 0 // Currently known as 257 Kingsley { "1155", "Ramona", "St", AS_Vernacular, 0000, 0, false, -122.1537239777305, 37.44002824890538, 0.001524002125081144, 95.14600556912522, -122.1534100864677,37.44010672451432,0 }, #endif { "1156", "Ramona", "St", AS_Craftsman, 1998, 0, false, -122.1537612018876, 37.44002179739181, 0.001401481638561202, 126.6295448889215, -122.1541275998578,37.43998966468205,0 }, // XXX 1004-6 Ramona, 1132/40/66 Ramona seem to overlap existing // houses. { "1010", "Waverley", "St", AS_Craftsman, 1922, 0, false, -122.1542227441644, 37.44285282346264, 8.549359264025065e-05, 218.9228566512552, -122.1540669592228,37.44294295148891,0 }, { "1020", "Waverley", "St", AS_Shingle, 1902, 0, false, -122.1542096560179, 37.44284420481941, 8.094028911126686e-05, 193.6646589537924, -122.1538749807542,37.44278477809226,0 }, { "1022", "Waverley", "St", AS_ColonialRevival, 1905, 0, false, -122.1541852602775, 37.442828441657, 7.558411671857056e-05, 184.4785009768522, -122.1537462810724,37.4426796467902,0 }, { "1050", "Waverley", "St", AS_Craftsman, 1928, 4, false, -122.1541560971005, 37.44282242128374, 7.285021978223422e-05, 160.8671011376657, -122.1534620026204,37.44254440589261,0 }, { "1101", "Waverley", "St", AS_ColonialRevival, 1922, 0, false, -122.1527340741095, 37.44227283887447, 0.0006306671906934912, 119.1887843613694, -122.1524797357751,37.44247111721091,0 }, { "1110", "Waverley", "St", AS_Contemporary, 1993, 0, false, -122.1527506526932, 37.44223344166442, 0.0005270703865460346, 149.1372831133004, -122.1527596977868,37.44206242854336,0 }, { "1130", "Waverley", "St", AS_Bungalow, 1900, 0, false, -122.1527431245659, 37.44221861829515, 0.0005061489581571212, 136.6041819890217, -122.1525119131877,37.44190886649224,0 }, { "1135", "Waverley", "St", AS_ColonialRevival, 1927, 4, false, -122.1527210317119, 37.44222242470872, 0.0004812510128265335, 134.1129657564024, -122.1523236505211,37.4423270026295,0 }, { "1136", "Waverley", "St", AS_ColonialRevival, 1893, 3, true, -122.1524800029625, 37.44186313107048, 0.0003654090058591355, 192.7888525370082, -122.1523471337606,37.4418091170938,0 }, { "1146", "Waverley", "St", AS_QueenAnne, 1891, 4, true, -122.152451872484, 37.44184342361982, 0.0003395172863069812, 186.9313226774494, -122.1521205919601,37.44164184791102,0 }, { "1155", "Waverley", "St", AS_Spanish, 1927, 4, false, -122.1523824348432, 37.44190191722551, 0.0002757781111594144, 142.889986447581, -122.1520028129894,37.44225282372248,0 }, { "1177", "Waverley", "St", AS_Spanish, 1928, 0, false, -122.1523640508448, 37.4419062591712, 0.0002658064477035818, 130.2075964076828, -122.1518310642274,37.44204217426756,0 }, { "1207", "Waverley", "St", AS_ColonialRevival, 1904, 0, false, -122.151305835216, 37.44144350850667, 0.0007621875453043129, 207.5310966865884, -122.1511330870191,37.44158338713745,0 }, { "1220", "Waverley", "St", AS_Craftsman, 1899, 4, true, -122.1513152095013, 37.4414344593412, 0.0006511850678014775, 180.1769833234568, -122.1513599063584,37.44125939380041,0 }, { "1221", "Waverley", "St", AS_ColonialRevival, 1993, 0, false, -122.15128835352, 37.44143880983155, 0.0006019513517065548, 119.0826273470265, -122.150981745812,37.44150865840577,0 }, { "1240", "Waverley", "St", AS_ColonialRevival, 1905, 0, true, -122.1508417146645, 37.44102423025526, 0.0007924553321891008, 162.7874370122516, -122.1510292514669,37.44098148579079,0 }, { "1245", "Waverley", "St", AS_ColonialRevival, 1902, 0, false, -122.150817, 37.441339, 0, 1000, -122.150817,37.441339,0 }, { "1248", "Waverley", "St", AS_ColonialRevival, 1904, 0, true, -122.1508381628892, 37.44102495250331, 0.0006372851472349501, 138.1020783162083, -122.1507430070343,37.44081581722067,0 }, { "1300", "Waverley", "St", AS_Contemporary, 1990, 0, false, -122.1504739899722, 37.44080863058615, 0.0004312055016299179, 185.471498998781, -122.1503134816022,37.4404336027206,0 }, { "1303", "Waverley", "St", AS_Mission, 1919, 3, false, -122.1504518598415, 37.44081695002862, 0.0004073483340549945, 172.0711958956613, -122.150063264329,37.44093161110246,0 }, { "1321", "Waverley", "St", AS_ColonialRevival, 1916, 0, false, -122.1504171380405, 37.44081855991571, 0.0003821750482700748, 123.8947903115187, -122.1499140589849,37.4408305120456,0 }, { "1327", "Waverley", "St", AS_Contemporary, 1988, 0, false, -122.1496454523827, 37.44062676971759, 0.0006027175924346184, 130.1701533309558, -122.1494022002638,37.44089567489473,0 }, { "1329", "Waverley", "St", AS_Contemporary, 1987, 0, false, -122.149637328459, 37.44061673449875, 0.0004311251732973661, 112.3984974044856, -122.1496961886065,37.4406177186636,0 }, { "1331", "Waverley", "St", AS_Contemporary, 1950, 0, false, -122.149637328459, 37.44061673449875, 0.0004311251732973661, 112.3984974044856, -122.1494855322963,37.44051736218037,0 }, { "334", "Whitman", "Ct", AS_Vernacular, 1904, 0, false, -122.1516489999603, 37.44043299993543, 2.415671969308188e-11, 140.3390955111452, -122.1517116369264,37.44041703634002,0 }, { "373", "Whitman", "Ct", AS_Vernacular, 1908, 4, false, -122.1515038143014, 37.44077707585924, 6.098575280620228e-05, 165.1281623989522, -122.151450105729,37.44093319396879,0 }, }; const unsigned nHouses = sizeof(houses) / sizeof(houses[0]); string kmlStyle(const char* name, const char* url); string kmlHouse(House& h, const char* name, const char* desc, const char* styleName); int main() { unsigned maxStyleNameWidth = 0; for (unsigned i = 0; i != nStyles; ++i) maxStyleNameWidth = std::max(maxStyleNameWidth, static_cast(strlen(styleNames[i]))); unsigned n = 0; // How many of each style were built? n = 0; map countsPerStyle; for (unsigned i = 0; i != nHouses; ++i) ++countsPerStyle[houses[i].as]; cout << "Number of houses in each architectural style currently:" << endl; for (auto p = countsPerStyle.begin(); p != countsPerStyle.end(); ++p) { const char* name = styleNames[p->first]; unsigned pad = maxStyleNameWidth + 1 - strlen(name); cout << " " << name << setw(pad) << " " << setw(2) << p->second << endl; n += p->second; } cout << "Total " << n << endl << endl; // How many of each style were built during the period of // significance? n = 0; map oldCountsPerStyle; for (unsigned i = 0; i != nHouses; ++i) { if (houses[i].yearBuilt == 0 || houses[i].yearBuilt >= 1938) continue; ++oldCountsPerStyle[houses[i].as]; } cout << "Approximate number of houses in each architectural style" << endl << "at the end of the period of significance:" << endl; for (auto p = oldCountsPerStyle.begin(); p != oldCountsPerStyle.end(); ++p) { const char* name = styleNames[p->first]; unsigned pad = maxStyleNameWidth + 1 - strlen(name); cout << " " << name << setw(pad) << " " << setw(2) << p->second << endl; n += p->second; } cout << "Total " << n << endl << endl; // How many of each style were built for the early professors? n = 0; unsigned nProfessorial = 0; map profCountsPerStyle; for (unsigned i = 0; i != nHouses; ++i) if (houses[i].professorial) { ++profCountsPerStyle[houses[i].as]; ++nProfessorial; } cout << "Number of houses in each architectural style built for professors:" << endl; for (auto p = profCountsPerStyle.begin(); p != profCountsPerStyle.end(); ++p) { const char* name = styleNames[p->first]; unsigned pad = maxStyleNameWidth + 1 - strlen(name); cout << " " << name << setw(pad) << " " << setw(2) << p->second << endl; n += p->second; } cout << "Total " << n << endl; cout << fmtfi(0) << ((100.0 * nProfessorial) / nHouses) << "% of houses were built for professors" << endl; cout << endl; // Which styles were built in a given year? struct TotalProf { unsigned nTotal; unsigned nProfs; TotalProf() { nTotal = nProfs = 0; } }; map< unsigned, map > stylesPerYear; for (unsigned i = 0; i != nHouses; ++i) { if (houses[i].yearBuilt == 0) continue; TotalProf& tp(stylesPerYear[houses[i].yearBuilt][houses[i].as]); ++tp.nTotal; if (houses[i].professorial) ++tp.nProfs; //++stylesPerYear[houses[i].yearBuilt][houses[i].as]; } cout << "Architectural styles built in each year, total and for professors:" << endl; for (auto p = stylesPerYear.begin(); p != stylesPerYear.end(); ++p) { cout << " " << p->first << ":"; bool first = true; for (auto q = p->second.begin(); q != p->second.end(); ++q) { const char* name = styleNames[q->first]; unsigned pad = maxStyleNameWidth + 1 - strlen(name); TotalProf& tp(q->second); cout << (first? " ": " ") << name << setw(pad) << " " << setw(2) << tp.nTotal; if (tp.nProfs) cout << " " << setw(2) << tp.nProfs; cout << endl; first = false; } } cout << endl; // When were houses in a given style built? map< ArchStyle, set > yearsPerStyle; for (unsigned i = 0; i != nHouses; ++i) { if (houses[i].yearBuilt == 0) continue; yearsPerStyle[houses[i].as].insert(houses[i].yearBuilt); } cout << "Years in which a style was used:" << endl; for (auto p = yearsPerStyle.begin(); p != yearsPerStyle.end(); ++p) { const char* name = styleNames[p->first]; unsigned pad = maxStyleNameWidth + 1 - strlen(name); cout << " " << name << setw(pad); unsigned nPerRow = 0; for (auto q = p->second.begin(); q != p->second.end(); ++q) { cout << " " << setw(4) << *q; if (++nPerRow == 8) { cout << endl << " " << setw(maxStyleNameWidth) << " "; nPerRow = 0; } } cout << endl; } cout << endl; // Which styles appear in each historic category? n = 0; vector< map > stylesPerCategory(5); for (unsigned i = 0; i != nHouses; ++i) ++stylesPerCategory[houses[i].category][houses[i].as]; cout << "Styles in each numbered historic category:" << endl; for (unsigned i = 0; i <= 4; ++i) { cout << " " << i << ":"; bool first = true; for (auto p = stylesPerCategory[i].begin(); p != stylesPerCategory[i].end(); ++p) { const char* name = styleNames[p->first]; unsigned pad = maxStyleNameWidth + 1 - strlen(name); cout << (first? " ": " ") << name << setw(pad) << " " << setw(2) << p->second << endl; n += p->second; first = false; } } cout << "Total " << n << endl << endl; // Which styles appear in any numbered historic category? n = 0; map categoriesPerStyle; for (unsigned i = 0; i != nHouses; ++i) if (houses[i].category) ++categoriesPerStyle[houses[i].as]; cout << "Numbered historic category houses in each style:" << endl; for (auto p = categoriesPerStyle.begin(); p != categoriesPerStyle.end(); ++p) { const char* name = styleNames[p->first]; unsigned pad = maxStyleNameWidth + 1 - strlen(name); cout << " " << name << setw(pad) << " " << setw(2) << p->second << endl; n += p->second; } cout << "Total " << n << endl << endl; // Which houses were built in a given year? map > housesPerYear; for (unsigned i = 0; i != nHouses; ++i) housesPerYear[houses[i].yearBuilt].push_back(i); map > housesPerDecade; for (unsigned i = 0; i != nHouses; ++i) housesPerDecade[10U * (houses[i].yearBuilt / 10U)].push_back(i); ofstream f("Professorville.kml"); f << "\n" "\n" "\n" "Professorville\n" ; for (unsigned i = 0; i != nStyles; ++i) f << kmlStyle(archStyleKMLNames[i], archStyleIconURLs[i]); for (unsigned i = 0; i != 5; ++i) f << kmlStyle(categoryKMLNames[i], categoryIconURLs[i]); f << kmlStyle(professorialKMLName, professorialIconURL); f << kmlStyle(nonProfessorialKMLName, nonProfessorialIconURL); // XXX other styles, if any, go here // All houses f << "\n" " All\n" " 0\n" " 0\n" ; for (unsigned j = 0; j != nHouses; ++j) { House& h(houses[j]); string addr = h.number; addr += " "; addr += h.street; addr += " "; addr += h.suffix; f << kmlHouse(h, "", addr.c_str(), nonProfessorialKMLName); } f << "\n"; // Sorted by styles f << "\n" " Styles\n" " 0\n" " 0\n" ; for (ArchStyle as = AS_first; as <= AS_last; as = (ArchStyle)((int) as + 1)) { f << "\n" " " << styleNames[as] << "\n" " 0\n" " 0\n" ; for (unsigned j = 0; j != nHouses; ++j) { House& h(houses[j]); if (h.as != as) continue; string addr = h.number; addr += " "; addr += h.street; addr += " "; addr += h.suffix; f << kmlHouse(h, "", addr.c_str(), archStyleKMLNames[h.as]); } f << "\n"; } f << "\n"; // Sorted by category f << "\n" " Categories\n" " 0\n" " 0\n" ; for (unsigned i = 0; i <= 4; ++i) { ostringstream os; os << i; f << "\n" " " << os.str() << "\n" " 0\n" " 0\n" ; for (unsigned j = 0; j != nHouses; ++j) { House& h(houses[j]); if (h.category != i) continue; string addr = h.number; addr += " "; addr += h.street; addr += " "; addr += h.suffix; f << kmlHouse(h, "", addr.c_str(), categoryKMLNames[h.category]); } f << "\n"; } f << "\n"; // Sorted by year f << "\n" " Style By Year Built\n" " 0\n" " 0\n" ; for (auto p = housesPerYear.begin(); p != housesPerYear.end(); ++p) { if (p->first == 0) continue; f << "\n" " " << p->first << "\n" " 0\n" " 0\n" ; vector& hy(p->second); for (auto q = hy.begin(); q != hy.end(); ++q) { House& h(houses[*q]); string addr = h.number; addr += " "; addr += h.street; addr += " "; addr += h.suffix; f << kmlHouse(h, "", addr.c_str(), archStyleKMLNames[h.as]); } f << "\n"; } f << "\n"; f << "\n" " Category By Year Built\n" " 0\n" " 0\n" ; for (auto p = housesPerYear.begin(); p != housesPerYear.end(); ++p) { if (p->first == 0) continue; f << "\n" " " << p->first << "\n" " 0\n" " 0\n" ; vector& hy(p->second); for (auto q = hy.begin(); q != hy.end(); ++q) { House& h(houses[*q]); string addr = h.number; addr += " "; addr += h.street; addr += " "; addr += h.suffix; f << kmlHouse(h, "", addr.c_str(), categoryKMLNames[h.category]); } f << "\n"; } f << "\n"; // Professor's houses f << "\n" " Professor's Houses\n" " 0\n" " 0\n" ; for (unsigned j = 0; j != nHouses; ++j) { House& h(houses[j]); if (!h.professorial) continue; string addr = h.number; addr += " "; addr += h.street; addr += " "; addr += h.suffix; f << kmlHouse(h, "", addr.c_str(), professorialKMLName); } f << "\n"; // Non-professor's houses f << "\n" " Non-professor's Houses\n" " 0\n" " 0\n" ; for (unsigned j = 0; j != nHouses; ++j) { House& h(houses[j]); if (h.professorial) continue; string addr = h.number; addr += " "; addr += h.street; addr += " "; addr += h.suffix; f << kmlHouse(h, "", addr.c_str(), nonProfessorialKMLName); } f << "\n"; // Professorial status by decade built: f << "\n" " Decade Built\n" " 0\n" " 0\n" ; for (auto p = housesPerDecade.begin(); p != housesPerDecade.end(); ++p) { if (p->first == 0) continue; f << "\n" " " << p->first << "\n" " 0\n" " 0\n" ; vector& hy(p->second); for (auto q = hy.begin(); q != hy.end(); ++q) { House& h(houses[*q]); string addr = h.number; addr += " "; addr += h.street; addr += " "; addr += h.suffix; f << kmlHouse(h, "", addr.c_str(), (h.professorial? professorialKMLName: nonProfessorialKMLName)); } f << "\n"; } f << "\n"; // Professorial status by year built: f << "\n" " Year Built\n" " 0\n" " 0\n" ; for (auto p = housesPerYear.begin(); p != housesPerYear.end(); ++p) { if (p->first == 0) continue; f << "\n" " " << p->first << "\n" " 0\n" " 0\n" ; vector& hy(p->second); for (auto q = hy.begin(); q != hy.end(); ++q) { House& h(houses[*q]); string addr = h.number; addr += " "; addr += h.street; addr += " "; addr += h.suffix; f << kmlHouse(h, "", addr.c_str(), (h.professorial? professorialKMLName: nonProfessorialKMLName)); } f << "\n"; } f << "\n"; // XXX other folders go here f << "\n" "\n" ; return 0; } string kmlHouse(House& h, const char* name, const char* desc, const char* styleName) { ostringstream os; os << "\n" << " " << name << "\n" << " 0\n" << " " << desc << "\n" << " \n" << " " << fmtf(0,13) << h.longitude << "\n" << " " << fmtf(0,13) << h.latitude << "\n" << " 0\n" << " " << fmte(0,15) << h.heading << "\n" << " 0\n" << " " << fmtf(0,12) << h.range << "\n" << " relativeToSeaFloor\n" << " \n" << " #msn_" << styleName << "\n" << " \n" << " " << fmtf(0,13) << h.longCoord << "," << fmtf(0,13) << h.latCoord << "," << fmtf(0,1) << h.altCoord << "\n" << " \n" << "\n" ; return os.str(); } string kmlStyle(const char* name, const char* url) { ostringstream os; os << "\n" << " \n" << " normal\n" << " #sn_" << name << "\n" << " \n" << " \n" << " highlight\n" << " #sh_" << name << "\n" << " \n" << "\n" << "\n" << "\n" ; return os.str(); }