diff --git a/ConvexHul.jpg b/ConvexHul.jpg new file mode 100644 index 0000000..c53980e Binary files /dev/null and b/ConvexHul.jpg differ diff --git a/ConvexHull_NearestNeighbor.kml b/ConvexHull_NearestNeighbor.kml new file mode 100644 index 0000000..402c1e3 --- /dev/null +++ b/ConvexHull_NearestNeighbor.kml @@ -0,0 +1,89 @@ + + + + + +Ellendale Pl +#z1-118.288866,34.031748 + +Orchard Ave +#z1-118.288262,34.028371 + +Vermont Ave +#z1-118.291541,34.025607 + +Figueroa St +#z1-118.280103,34.021895 + +Mcclintok +#z1-118.287602,34.024325 + +SGM +#z1-118.289053,34.021449 + +USC BookStore +#z1-118.286601,34.020773 + +Tommy Trojan +#z1-118.285451,34.020555 + +Leavey Library +#z1-118.282912,34.021787 + +Exposition +#z1-118.282274,34.018429 + +Ralph's +#z1-118.291335,34.032799 + +West Adams Blvd +#z1-118.286460,34.032707 + + + + + + +-118.282274,34.018429 +-118.289053,34.021449 +-118.291541,34.025607 +-118.291335,34.032799 +-118.28646,34.032707 +-118.280103,34.021895 +-118.282274,34.018429 + + + + + + + +#nearest + + +-118.291335,34.032799, -118.288866,34.031748 +-118.288262,34.028371, -118.288866,34.031748 +-118.28646,34.032707, -118.288866,34.031748 +-118.291541,34.025607, -118.288866,34.031748 + + + + + diff --git a/Coordinates.rtf b/Coordinates.rtf new file mode 100644 index 0000000..8f810ab --- /dev/null +++ b/Coordinates.rtf @@ -0,0 +1,68 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf100 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +{\*\expandedcolortbl;;} +\margl1440\margr1440\vieww33400\viewh18480\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 + +\f0\fs24 \cf0 -118.288866,34.031748 Ellendale\ +-118.288262,34.028371 Orchard Ave\ +-118.291541,34.025607 Vermont Ave\ +-118.280103,34.021895 Figueroa St\ +-118.287602,34.024325 Mcclintok\ +-118.289053,34.021449 SGM\ +-118.286601,34.020773 USC BookStore\ +-118.285451,34.020555 Tommy Trojan\ +-118.283537,34.023030 Trousdale Parkway\ +-118.282912,34.021787 Leavey Library\ +-118.282274,34.018429 Exposition \ +-118.291359,34.028425 Lion's Bike Shop\ +-118.291335,34.032799 Ralph's\ +\ +\ +let data = [\ +\{"long":-118.288866,"lat":34.031748,"name":"Ellendale"\},\ +\{"long":-118.288262,"lat":34.028371,"name": "Orchard Ave"\},\ +\{"long":-118.291541,"lat":34.025607,"name":"Vermont Ave"\},\ +\{"long":-118.280103,"lat":34.021895,"name": "Figueroa St"\},\ +\{"long":-118.287602,"lat":34.024325,"name": "Mcclintok"\},\ +\{"long":-118.289053,"lat":34.021449,"name": "SGM"\},\ +\{"long":-118.286601,"lat":34.020773,"name": "USC BookStore"\},\ +\{"long":-118.285451,"lat":34.020555,"name": "Tommy Trojan"\},\ +\{"long":-118.282912,"lat":34.021787,"name": "Leavey Library"\},\ +\{"long":-118.282274,"lat":34.018429,"name": "Exposition"\},\ +\{"long":-118.291335,"lat":34.032799,"name": "Ralph's"\},\ +\{"long":-118.286460,"lat":34.032707,"name":"West Adams Blvd"\}\ +];\ + \ +localStorage.setItem("USCdata",JSON.stringify(data));\ +let dataStored = JSON.parse(localStorage.getItem("USCdata"));\ +console.log(dataStored); \ +\ +function initMap() \{\ + map = new OpenLayers.Map('map');\ + basemap = new OpenLayers.Layer.OSM("Simple OSM Map");\ + map.addLayer(basemap);\ + markers = new OpenLayers.Layer.Markers("Markers");\ + map.addLayer(markers);\ +\}\ +\ +function addMarker(latitude, longitude) \{\ + let lonLat = new OpenLayers.LonLat(longitude, latitude)\ + .transform(\ + new OpenLayers.Projection("EPSG:4326"), \ + map.getProjectionObject() \ + );\ + let point = new OpenLayers.Marker(lonLat);\ + markers.addMarker(point);\ + map.setCenter(lonLat, 8);\ +\}\ +\ +initMap();\ +let a = dataStored; \ +for(var indx in a) \{\ + console.log(a[indx]);\ + addMarker(a[indx].lat,a[indx].long,a[indx].name);\ +\}\ +\ +} \ No newline at end of file diff --git a/Nearest_Neighbor.jpg b/Nearest_Neighbor.jpg new file mode 100644 index 0000000..ff56523 Binary files /dev/null and b/Nearest_Neighbor.jpg differ diff --git a/OpenlayerCode.txt b/OpenlayerCode.txt new file mode 100644 index 0000000..147a864 --- /dev/null +++ b/OpenlayerCode.txt @@ -0,0 +1,45 @@ +let data = [ +{"long":-118.288866,"lat":34.031748,"name":"Ellendale"}, +{"long":-118.288262,"lat":34.028371,"name": "Orchard Ave"}, +{"long":-118.291541,"lat":34.025607,"name":"Vermont Ave"}, +{"long":-118.280103,"lat":34.021895,"name": "Figueroa St"}, +{"long":-118.287602,"lat":34.024325,"name": "Mcclintok"}, +{"long":-118.289053,"lat":34.021449,"name": "SGM"}, +{"long":-118.286601,"lat":34.020773,"name": "USC BookStore"}, +{"long":-118.285451,"lat":34.020555,"name": "Tommy Trojan"}, +{"long":-118.282912,"lat":34.021787,"name": "Leavey Library"}, +{"long":-118.282274,"lat":34.018429,"name": "Exposition"}, +{"long":-118.291335,"lat":34.032799,"name": "Ralph's"}, +{"long":-118.286460,"lat":34.032707,"name":"West Adams Blvd"} +]; + +localStorage.setItem("USCdata",JSON.stringify(data)); +let dataStored = JSON.parse(localStorage.getItem("USCdata")); +console.log(dataStored); + +function initMap() { + map = new OpenLayers.Map('map'); + basemap = new OpenLayers.Layer.OSM("Simple OSM Map"); + map.addLayer(basemap); + markers = new OpenLayers.Layer.Markers("Markers"); + map.addLayer(markers); +} + +function addMarker(latitude, longitude,name) { + let lonLat = new OpenLayers.LonLat(longitude, latitude) + .transform( + new OpenLayers.Projection("EPSG:4326"), + map.getProjectionObject() + ); + let point = new OpenLayers.Marker(lonLat); + markers.addMarker(point); + map.setCenter(lonLat, 8); +} + +initMap(); +let a = dataStored; +for(var indx in a) { + console.log(a[indx]); + addMarker(a[indx].lat,a[indx].long,a[indx].name); +} + diff --git a/Placemarkers.jpg b/Placemarkers.jpg new file mode 100644 index 0000000..c24e1de Binary files /dev/null and b/Placemarkers.jpg differ diff --git a/Spiro.kml b/Spiro.kml new file mode 100644 index 0000000..40bf184 --- /dev/null +++ b/Spiro.kml @@ -0,0 +1,529 @@ + + + + + + + + +-118.289053,34.021949,0 +-118.28908665543113,34.02195145826986,0 +-118.28911974488852,34.02195880112182,0 +-118.2891517095759,34.02197093308714,0 +-118.28918200496129,34.02198769639341,0 +-118.28921010768335,34.02200887295994,0 +-118.28923552219014,34.022034187155846,0 +-118.28925778702626,34.02206330928613,0 +-118.28927648068887,34.022095859761436,0 +-118.28929122697858,34.022131413898975,0 +-118.28930169977758,34.02216950729378,0 +-118.28930762719456,34.02220964169249,0 +-118.2893087950239,34.022251291295305,0 +-118.28930504947574,34.02229390940648,0 +-118.289296299142,34.022336935349344,0 +-118.28928251617366,34.02237980155824,0 +-118.28926373665463,34.02242194075793,0 +-118.289240060167,34.02246279313955,0 +-118.28921164855366,34.022501813442446,0 +-118.28917872389354,34.022538477852336,0 +-118.28914156571543,34.022572290628624,0 +-118.28910050748512,34.02260279037704,0 +-118.28905593241092,34.022629555888294,0 +-118.28900826861982,34.02265221146892,0 +-118.2889579837661,34.022670431697016,0 +-118.28890557913968,34.022683945542575,0 +-118.28885158334953,34.02269253980046,0 +-118.28879654566141,34.02269606179256,0 +-118.28874102907434,34.02269442130495,0 +-118.28868560322347,34.0226875917356,0 +-118.28863083719885,34.02267561043811,0 +-118.28857729237114,34.022658578257094,0 +-118.2885255153146,34.022636658261135,0 +-118.28847603091727,34.022610073689265,0 +-118.28842933576509,34.02257910513703,0 +-118.28838589188376,34.02254408701759,0 +-118.28834612091752,34.02250540334273,0 +-118.28831039881817,34.02246348287693,0 +-118.28827905111184,34.02241879372606,0 +-118.2882523488031,34.02237183742876,0 +-118.28823050496818,34.02232314262547,0 +-118.28821367208066,34.02227325838504,0 +-118.28820194010294,34.02222274727332,0 +-118.28819533536813,34.02217217825129,0 +-118.2881938202662,34.02212211949267,0 +-118.28819729373835,34.02207313121165,0 +-118.28820559257348,34.02202575859151,0 +-118.28821849349035,34.02198052490351,0 +-118.28823571597891,34.021937924903035,0 +-118.2882569258652,34.021898418586524,0 +-118.28828173955435,34.021862425388,0 +-118.28830972889853,34.021830318888796,0 +-118.2883404266277,34.02180242210705,0 +-118.28837333227513,34.02177900342682,0 +-118.28840791852218,34.02176027321809,0 +-118.28844363788264,34.021746381190454,0 +-118.28847992964168,34.021737414514,0 +-118.28851622696202,34.02173339673101,0 +-118.28855196406725,34.02173428747238,0 +-118.28858658341161,34.02173998298222,0 +-118.2886195427455,34.02175031744411,0 +-118.28865032198738,34.02176506509215,0 +-118.28867842981538,34.02178394308014,0 +-118.28870340989486,34.02180661507266,0 +-118.28872484666373,34.02183269551259,0 +-118.2887423706018,34.02186175451112,0 +-118.2887556629181,34.02189332329842,0 +-118.28876445959646,34.02192690016614,0 +-118.28876855474844,34.021961956826466,0 +-118.28876780323115,34.02199794510741,0 +-118.28876212249689,34.022034303899744,0 +-118.28875149365115,34.0220704662676,0 +-118.28873596170567,34.022105866632934,0 +-118.28871563502334,34.022139947943046,0 +-118.2886906839619,34.022172168730435,0 +-118.2886613387337,34.02220200997579,0 +-118.28862788650844,34.02222898168737,0 +-118.28859066779557,34.02225262911351,0 +-118.28855007215223,34.02227253850981,0 +-118.28850653327072,34.022288342387974,0 +-118.28846052350777,34.02229972418003,0 +-118.2884125479248,34.022306422258914,0 +-118.28836313791454,34.022308233264575,0 +-118.28831284449424,34.02230501469361,0 +-118.2882622313509,34.02229668671959,0 +-118.2882118677258,34.02228323322113,0 +-118.28816232122871,34.02226470200469,0 +-118.28811415067246,34.02224120421925,0 +-118.28806789901843,34.02221291297033,0 +-118.28802408652236,34.02218006115078,0 +-118.28798320416678,34.02214293851585,0 +-118.28794570746346,34.02210188803946,0 +-118.287912010704,34.022057301597755,0 +-118.28788248173129,34.02200961503452,0 +-118.28785743729799,34.021959302670815,0 +-118.28783713907077,34.02190687132828,0 +-118.2878217903306,34.02185285394161,0 +-118.28781153341102,34.02179780284105,0 +-118.28780644790676,34.021742282789724,0 +-118.28780654967521,34.02168686386389,0 +-118.28781179064357,34.021632114266126,0 +-118.28782205942385,34.02157859316229,0 +-118.28783718272824,34.02152684363283,0 +-118.28785692756679,34.02147738582754,0 +-118.28788100419955,34.0214307104103,0 +-118.28790906980602,34.0213872723767,0 +-118.28794073282542,34.02134748532269,0 +-118.28797555791284,34.0213117162367,0 +-118.28801307144882,34.0212802808811,0 +-118.28805276753239,34.021253439821365,0 +-118.28809411438216,34.02123139515315,0 +-118.28813656106422,34.021214287968675,0 +-118.2881795444619,34.02120219659441,0 +-118.28822249639941,34.02119513562232,0 +-118.28826485082908,34.02119305574705,0 +-118.28830605099144,34.021195844410876,0 +-118.28834555645756,34.0212033272485,0 +-118.28838284996478,34.021215270313256,0 +-118.28841744395912,34.021231383056644,0 +-118.28844888676194,34.02125132202351,0 +-118.28847676828268,34.02127469521617,0 +-118.28850072520552,34.02130106707225,0 +-118.28852044558458,34.02132996399333,0 +-118.28853567278902,34.02136088035454,0 +-118.28854620874897,34.02139328491902,0 +-118.2885519164604,34.02142662757623,0 +-118.28855272171795,34.02146034631892,0 +-118.28854861405335,34.021493874370435,0 +-118.28853964686787,34.02152664737241,0 +-118.28852593675693,34.021558110541825,0 +-118.28850766203546,34.02158772570701,0 +-118.28848506048271,34.02161497813367,0 +-118.28845842633504,34.021639383054506,0 +-118.28842810656451,34.02166049182002,0 +-118.28839449649057,34.02167789759264,0 +-118.28835803478023,34.021691240512155,0 +-118.28831919789984,34.0217002122673,0 +-118.2882784940888,34.02170456001548,0 +-118.28823645693119,34.021704089601236,0 +-118.2881936386068,34.02169866803268,0 +-118.28815060290673,34.02168822518458,0 +-118.28810791810186,34.021672754706685,0 +-118.28806614975458,34.021652314125554,0 +-118.28802585356435,34.021627024138844,0 +-118.28798756833764,34.02159706711092,0 +-118.28795180917143,34.02156268478861,0 +-118.28791906093586,34.02152417526631,0 +-118.28788977213911,34.021481889238494,0 +-118.28786434925141,34.021436225587216,0 +-118.28784315156054,34.021387626360294,0 +-118.28782648662339,34.02133657120367,0 +-118.28781460637141,34.02128357131833,0 +-118.28780770391904,34.02122916301827,0 +-118.28780591111543,34.02117390097077,0 +-118.2878092968705,34.021118351204656,0 +-118.2878178662766,34.02106308397472,0 +-118.28783156053652,34.02100866657271,0 +-118.28785025769916,34.020955656175666,0 +-118.28787377419341,34.020904592821964,0 +-118.28790186714069,34.02085599260407,0 +-118.28793423741715,34.02081034116381,0 +-118.28797053342673,34.020768087572584,0 +-118.28801035553734,34.02072963867385,0 +-118.28805326112413,34.02069535395928,0 +-118.288098770156,34.02066554104357,0 +-118.28814637125487,34.02064045179493,0 +-118.28819552815101,34.0206202791703,0 +-118.28824568645274,34.02060515479522,0 +-118.28829628064513,34.02059514731896,0 +-118.28834674122902,34.02059026156578,0 +-118.28839650191014,34.02059043849293,0 +-118.28844500674758,34.020595555956,0 +-118.28849171717101,34.02060543027194,0 +-118.28853611877814,34.0206198185599,0 +-118.28857772782634,34.02063842183041,0 +-118.28861609733646,34.0206608887838,0 +-118.28865082273155,34.02068682026974,0 +-118.28868154693934,34.020715774351665,0 +-118.28870796489383,34.02074727191198,0 +-118.28872982737921,34.020780802727145,0 +-118.28874694416743,34.020815831935884,0 +-118.28875918640972,34.02085180681873,0 +-118.28876648825204,34.02088816380317,0 +-118.28876884765363,34.02092433560581,0 +-118.28876632639884,34.02095975842135,0 +-118.28875904930158,34.02099387906728,0 +-118.28874720261284,34.02102616199426,0 +-118.28873103165122,34.02105609607326,0 +-118.28871083768641,34.02108320107378,0 +-118.2886869741152,34.02110703375131,0 +-118.2886598419781,34.02112719346692,0 +-118.28862988487366,34.021143327268,0 +-118.28859758333417,34.021155134365976,0 +-118.2885634487346,34.02116236995423,0 +-118.28852801681121,34.02116484831813,0 +-118.28849184087191,34.02116244519772,0 +-118.28845548478454,34.02115509937322,0 +-118.28841951583111,34.02114281345337,0 +-118.28838449751906,34.021125653856544,0 +-118.28835098243984,34.021103749984896,0 +-118.28831950526532,34.021077292602044,0 +-118.2882905759707,34.02104653143472,0 +-118.2882646733695,34.02101177202875,0 +-118.28824223904213,34.020973371899075,0 +-118.28822367173542,34.02093173602253,0 +-118.28820932230312,34.02088731173038,0 +-118.28819948925205,34.02084058306502,0 +-118.28819441494983,34.020792064672484,0 +-118.28819428254211,34.02074229530769,0 +-118.28819921361857,34.02069183103466,0 +-118.28820926665689,34.0206412382077,0 +-118.28822443626458,34.02059108632223,0 +-118.28824465322809,34.020541940825666,0 +-118.28826978536878,34.02049435597926,0 +-118.2882996391947,34.02044886786106,0 +-118.28833396232753,34.020405987598636,0 +-118.28837244667375,34.02036619491685,0 +-118.28841473230031,34.02032993208258,0 +-118.2884604119653,34.020297598322614,0 +-118.2885090362469,34.020269544785556,0 +-118.28856011920523,34.020246070111284,0 +-118.28861314450604,34.02022741666403,0 +-118.28866757192839,34.02021376747669,0 +-118.28872284417422,34.02020524394503,0 +-118.28877839389386,34.02020190430084,0 +-118.28883365083844,34.020203742883496,0 +-118.28888804904878,34.020210690218995,0 +-118.2889410339901,34.02022261390553,0 +-118.28899206954213,34.02023932029439,0 +-118.28904064475628,34.02026055694495,0 +-118.28908628029463,34.020286015822705,0 +-118.28912853446897,34.020315337199904,0 +-118.289167008804,34.02034811420944,0 +-118.28920135305391,34.020383897994506,0 +-118.28923126960933,34.02042220338883,0 +-118.28925651723853,34.02046251505571,0 +-118.28927691411596,34.02050429400822,0 +-118.28929234009954,34.020546984428115,0 +-118.28930273822813,34.02059002069738,0 +-118.28930811542007,34.020632834553254,0 +-118.2893085423641,34.02067486227655,0 +-118.28930415260402,34.020715551822185,0 +-118.28929514082854,34.02075436980187,0 +-118.28928176038815,34.02079080823066,0 +-118.28926432007019,34.020824390952036,0 +-118.28924318017314,34.020854679660346,0 +-118.28921874792952,34.020881279444374,0 +-118.2891914723354,34.02090384378207,0 +-118.28916183845192,34.02092207892318,0 +-118.28913036125077,34.020935747604405,0 +-118.28909757908157,34.020944672050206,0 +-118.2890640468436,34.0209487362211,0 +-118.28903032894834,34.020947887281324,0 +-118.28899699216167,34.02094213626699,0 +-118.2889645984164,34.02093155794653,0 +-118.28893369768586,34.02091628987511,0 +-118.28890482100867,34.02089653065491,0 +-118.28887847375296,34.020872537423344,0 +-118.28885512920512,34.020844622600954,0 +-118.28883522256416,34.02081314994012,0 +-118.28881914541768,34.020778529924414,0 +-118.2888072407692,34.020741214576994,0 +-118.28879979867973,34.02070169174345,0 +-118.2887970525788,34.0206604789215,0 +-118.28879917629142,34.020618116715546,0 +-118.28880628181871,34.0205751619988,0 +-118.28881841790016,34.02053218086946,0 +-118.28883556937583,34.02048974148999,0 +-118.28885765735635,34.02044840690003,0 +-118.28888454019877,34.02040872789378,0 +-118.28891601527586,34.02037123605198,0 +-118.28895182151643,34.02033643701649,0 +-118.28899164268469,34.02030480409257,0 +-118.289035111357,34.02027677225971,0 +-118.28908181354595,34.020252732666776,0 +-118.28913129391326,34.02023302768096,0 +-118.2891830615053,34.020217946553295,0 +-118.2892365959393,34.02020772175541,0 +-118.28929135396145,34.02020252603386,0 +-118.28934677629437,34.02020247021935,0 +-118.28940229468719,34.02020760181841,0 +-118.28945733907928,34.02021790440551,0 +-118.28951134478675,34.020233297823125,0 +-118.28956375962126,34.02025363918734,0 +-118.28961405085093,34.020278724686236,0 +-118.28966171191519,34.02030829214834,0 +-118.28970626880908,34.02034202434863,0 +-118.28974728605593,34.020379553010315,0 +-118.28978437219308,34.020420463451885,0 +-118.28981718470123,34.02046429982051,0 +-118.28984543431517,34.020510570845765,0 +-118.28986888866125,34.020558756040884,0 +-118.28988737517581,34.02060831227314,0 +-118.28990078326756,34.020658680620315,0 +-118.2899090656964,34.0207092934265,0 +-118.28991223915172,34.02075958146816,0 +-118.28991038402233,34.02080898113971,0 +-118.2899036433613,34.020856941567814,0 +-118.28989222105868,34.02090293156459,0 +-118.28987637924521,34.02094644633157,0 +-118.28985643495982,34.02098701382984,0 +-118.28983275612305,34.0210242007358,0 +-118.28980575686744,34.02105761790721,0 +-118.28977589228373,34.0210869252904,0 +-118.28974365264942,34.02111183620666,0 +-118.28970955721265,34.02113212096359,0 +-118.28967414760989,34.02114760974579,0 +-118.28963798100087,34.02115819474823,0 +-118.28960162300731,34.021163831525506,0 +-118.28956564054494,34.02116453953978,0 +-118.28953059463917,34.021160401900545,0 +-118.28949703331568,34.02115156429949,0 +-118.28946548465522,34.021138233153955,0 +-118.28943645010106,34.02112067298243,0 +-118.28941039810316,34.02109920304524,0 +-118.28938775817981,34.021074193293,0 +-118.28936891547161,34.021046059673985,0 +-118.28935420585674,34.021015258859705,0 +-118.28934391168919,34.020982282455506,0 +-118.28933825821395,34.02094765076927,0 +-118.28933741070439,34.02091190621707,0 +-118.2893414723581,34.02087560644908,0 +-118.28935048297764,34.02083931728277,0 +-118.28936441845319,34.02080360553262,0 +-118.28938319105323,34.02076903182705,0 +-118.28940665051998,34.020736143503406,0 +-118.28943458595545,34.02070546767078,0 +-118.2894667284744,34.02067750452847,0 +-118.28950275459069,34.02065272102442,0 +-118.28954229029415,34.0206315449339,0 +-118.28958491576637,34.02061435943335,0 +-118.28963017067595,34.02060149823786,0 +-118.28967755998619,34.02059324136381,0 +-118.28972656020166,34.020589811570375,0 +-118.28977662597494,34.02059137152463,0 +-118.28982719698983,34.020598021726386,0 +-118.28987770503396,34.02060979921875,0 +-118.28992758117158,34.02062667710089,0 +-118.28997626292566,34.020648564849104,0 +-118.29002320137859,34.02067530944203,0 +-118.2900678681017,34.02070669727604,0 +-118.29010976182599,34.020742456846286,0 +-118.2901484147697,34.02078226215977,0 +-118.29018339854278,34.02082573683712,0 +-118.2902143295535,34.020872458851294,0 +-118.29024087384913,34.0209219658433,0 +-118.29026275132897,34.020973760947705,0 +-118.29027973927711,34.02102731905427,0 +-118.29029167516974,34.021082093426635,0 +-118.29029845872175,34.02113752259426,0 +-118.29030005314671,34.02119303743058,0 +-118.29029648561433,34.02124806832783,0 +-118.29028784689955,34.021302052377905,0 +-118.29027429022773,34.021354440468386,0 +-118.2902560293306,34.02140470420408,0 +-118.29023333573741,34.02145234256651,0 +-118.29020653533567,34.02149688822729,0 +-118.2901760042449,34.02153791343539,0 +-118.2901421640556,34.02157503540399,0 +-118.29010547649347,34.02160792112881,0 +-118.29006643757663,34.02163629157693,0 +-118.29002557133948,34.02165992519323,0 +-118.28998342320259,34.02167866068003,0 +-118.2899405530725,34.02169239901494,0 +-118.28989752825869,34.02170110468118,0 +-118.28985491629716,34.02170480609507,0 +-118.28981327777144,34.021703595225134,0 +-118.2897731592218,34.02169762640763,0 +-118.28973508623217,34.02168711437361,0 +-118.28969955678247,34.0216723315123,0 +-118.28966703495001,34.02165360440553,0 +-118.28963794503994,34.02163130967698,0 +-118.28961266621872,34.02160586920867,0 +-118.28959152771856,34.02157774478532,0 +-118.28957480467346,34.0215474322341,0 +-118.28956271463954,34.02151545513405,0 +-118.2895554148435,34.02148235817459,0 +-118.28955300019412,34.0214487002471,0 +-118.28955550208194,34.021415047357,0 +-118.28956288798227,34.02138196544581,0 +-118.28957506186654,34.02135001321409,0 +-118.28959186541678,34.02131973503587,0 +-118.28961308002789,34.02129165405424,0 +-118.28963842957245,34.0212662655454,0 +-118.28966758389298,34.021244030635,0 +-118.28970016297761,34.02122537044627,0 +-118.28973574176631,34.0212106607539,0 +-118.28977385552695,34.021200227211374,0 +-118.28981400573319,34.02119434121186,0 +-118.28985566636993,34.02119321643525,0 +-118.28989829058648,34.02119700612488,0 +-118.28994131761358,34.021205801128346,0 +-118.28998417985649,34.02121962872725,0 +-118.29002631007477,34.021238452270644,0 +-118.29006714855781,34.021262171616826,0 +-118.2901061502054,34.02129062437787,0 +-118.2901427914239,34.021323587951194,0 +-118.29017657675074,34.021360782312506,0 +-118.29020704512355,34.02140187353475,0 +-118.29023377571464,34.02144647798858,0 +-118.29025639325701,34.02149416717139,0 +-118.29027457279467,34.02154447310358,0 +-118.29028804379713,34.021596894224196,0 +-118.29029659358608,34.02165090171103,0 +-118.29030007003077,34.021705946145566,0 +-118.2902983834784,34.02176146443841,0 +-118.29029150789465,34.0218168869276,0 +-118.29027948120027,34.02187164456012,0 +-118.29026240479926,34.02192517606582,0 +-118.2902404423048,34.02197693503306,0 +-118.29021381747884,34.0220263967965,0 +-118.29018281141151,34.02207306505021,0 +-118.29014775897605,34.0221164781022,0 +-118.29010904460388,34.022156214691506,0 +-118.29006709743354,34.022191899294256,0 +-118.29002238589452,34.02222320685151,0 +-118.28997541179459,34.022249866859255,0 +-118.28992670398544,34.02227166676883,0 +-118.28987681168663,34.022288454654635,0 +-118.28982629755224,34.02230014111564,0 +-118.28977573056794,34.02230670038647,0 +-118.28972567886822,34.02230817064405,0 +-118.2896767025647,34.02230465350609,0 +-118.28962934667598,34.022296312727484,0 +-118.28958413424863,34.02228337211139,0 +-118.28954155975623,34.02226611266119,0 +-118.28950208285977,34.022244869009455,0 +-118.28946612260853,34.022220025169005,0 +-118.28943405215458,34.022192009659875,0 +-118.28940619404774,34.02216129007366,0 +-118.28938281617064,34.0221283671441,0 +-118.28936412836504,34.02209376839878,0 +-118.2893502797922,34.0220580414723,0 +-118.2893413570607,34.02202174716529,0 +-118.28933738314524,34.02198545233728,0 +-118.28933831711022,34.02194972272305,0 +-118.28934405464156,34.02191511576338,0 +-118.28935442937997,34.02188217354089,0 +-118.28936921503883,34.021851415910184,0 +-118.28938812828007,34.021823333909246,0 +-118.28941083231132,34.02179838353531,0 +-118.28943694115934,34.02177697996396,0 +-118.2894660245652,34.0217594922845,0 +-118.28949761343974,34.021746238818274,0 +-118.28953120580996,34.021737483078866,0 +-118.28956627318156,34.02173343042561,0 +-118.28960226723677,34.021734225452434,0 +-118.28963862678312,34.021739950145175,0 +-118.28967478486514,34.021750622830666,0 +-118.28971017594907,34.02176619793087,0 +-118.28974424308976,34.02178656652515,0 +-118.28977644498924,34.02181155771358,0 +-118.28980626285755,34.021840940764115,0 +-118.28983320698919,34.02187442801636,0 +-118.28985682297203,34.02191167850536,0 +-118.28987669745021,34.02195230225951,0 +-118.28989246336809,34.021995865218265,0 +-118.28990380462892,34.02204189470752,0 +-118.28991046010958,34.02208988540335,0 +-118.28991222698026,34.02213930570885,0 +-118.28990896328736,34.022189604463264,0 +-118.28990058976689,34.022240217898805,0 +-118.28988709086549,34.02229057675701,0 +-118.28986851495596,34.0223401134748,0 +-118.28984497374482,34.02238826934933,0 +-118.2898166408793,34.022434501591036,0 +-118.28978374977123,34.0224782901758,0 +-118.2897465906656,34.022519144409415,0 +-118.28970550699063,34.02255660912164,0 +-118.28966089103552,34.022590270411236,0 +-118.28961317901077,34.02261976086955,0 +-118.28956284555305,34.022644764216565,0 +-118.28951039774458,34.022665019290734,0 +-118.28945636872231,34.022680323342236,0 +-118.28940131095789,34.022690534588016,0 +-118.28934578929308,34.02269557399623,0 +-118.28929037381918,34.022695426277615,0 +-118.28923563268995,34.02269014007125,0 +-118.28918212495917,34.022679827322264,0 +-118.28913039353337,34.02266466185953,0 +-118.28908095832884,34.02264487719113,0 +-118.28903430971924,34.02262076354562,0 +-118.28899090235701,34.02259266419645,0 +-118.28895114944623,34.022560971115965,0 +-118.28891541753976,34.02252612001401,0 +-118.28888402192622,34.02248858482381,0 +-118.28885722266513,34.0224488717049,0 +-118.28883522132035,34.02240751263881,0 +-118.28881815843327,34.02236505869865,0 +-118.28880611176734,34.0223220730775,0 +-118.28879909534656,34.02227912396391,0 +-118.28879705929974,34.022236777354486,0 +-118.28879989051269,34.02219558989441,0 +-118.28880741408001,34.02215610183656,0 +-118.2888193955381,34.022118830208036,0 +-118.28883554385126,34.02208426227071,0 +-118.28885551511308,34.022052849358296,0 +-118.28887891691618,34.022025001167904,0 +-118.28890531333522,34.02200108057839,0 +-118.28893423046027,34.02198139906077,0 +-118.28896516241021,34.021966212738924,0 +-118.28899757775045,34.021955719150306,0 +-118.28903092623382,34.021950054747634,0 + + + + + + + + \ No newline at end of file diff --git a/Spiro_ArcGIS.png b/Spiro_ArcGIS.png new file mode 100644 index 0000000..68f761f Binary files /dev/null and b/Spiro_ArcGIS.png differ diff --git a/Spiro_GoogleEarth.jpg b/Spiro_GoogleEarth.jpg new file mode 100644 index 0000000..c7b34a7 Binary files /dev/null and b/Spiro_GoogleEarth.jpg differ diff --git a/convexhull_and_nearestneighbor.jpg b/convexhull_and_nearestneighbor.jpg new file mode 100644 index 0000000..f36a3b9 Binary files /dev/null and b/convexhull_and_nearestneighbor.jpg differ diff --git a/index.js b/index.js new file mode 100644 index 0000000..0d51b4a --- /dev/null +++ b/index.js @@ -0,0 +1,9 @@ +let a=4,r=1,R=8; +let x=0,y=0; +for (let i = 0.0; i < Math.PI * 16; i+=0.1) { + x=((R+r)*Math.cos((r/R)*i)-a*Math.cos((1+r/R)*i))*0.0001+34.021449; + y=((R+r)*Math.sin((r/R)*i)-a*Math.sin((1+r/R)*i))*0.0001+(-118.289053); + console.log(y+","+x+","+0); +} + +//COORDINATES OF SGM : (34.021,-118.289); \ No newline at end of file diff --git a/spatial.sql b/spatial.sql new file mode 100644 index 0000000..f0c321d --- /dev/null +++ b/spatial.sql @@ -0,0 +1,44 @@ +CREATE EXTENSION postgis; + + +CREATE TABLE spatial( +location_name TEXT, +longitude FLOAT, +latitude FLOAT, +where_is GEOGRAPHY ); + + +INSERT INTO spatial VALUES ('Ellendale Place',-118.288866,34.031748,NULL); +INSERT INTO spatial VALUES ('Orchard Ave',-118.288262,34.028371,NULL); +INSERT INTO spatial VALUES ('Vermont Ave',-118.291541,34.025607,NULL); +INSERT INTO spatial VALUES ('Figueroa St',-118.280103,34.021895,NULL); +INSERT INTO spatial VALUES ('Mcclintok Ave',-118.287602,34.024325,NULL); +INSERT INTO spatial VALUES ('SGM',-118.289053,34.021449,NULL); +INSERT INTO spatial VALUES ('USC BookStore',-118.286601,34.020773,NULL); +INSERT INTO spatial VALUES ('Tommy Trojan',-118.285451,34.020555,NULL); +INSERT INTO spatial VALUES ('Leavey Library',-118.282912,34.021787,NULL); +INSERT INTO spatial VALUES ('Exposition',-118.282274,34.018429,NULL); +INSERT INTO spatial VALUES ('Ralphs',-118.291335,34.032799,NULL); +INSERT INTO spatial VALUES ('West Adams Blvd',-118.286460,34.032707,NULL); + + +-- Set where_is to give geographic location of the point(long,lat) +UPDATE spatial SET where_is = ST_POINT(longitude,latitude); + + +SELECT * FROM spatial; + + +-- Convex Polygon Query +SELECT ST_AsText(ST_ConvexHull(ST_Collect(where_is::geometry))) AS convex_hull +FROM spatial; + + +-- Four Nearest Neighbor Query +SELECT ST_AsText(where_is::geometry),location_name,where_is +FROM spatial +where location_name<>'Ellendale Place' +ORDER BY where_is::geometry <-> st_setsrid(st_makepoint(-118.288866,34.031748),4326) +limit 4; + + \ No newline at end of file