简体   繁体   中英

Best way to simply generate charts through days and locations from json data using javascript?

I have a json file that contains crowdsensig data(from different locations and days) and i need to display it through charts on my page.I understand how to draw a chart and access the json data using ajax,but i can do it only for a single chart.

I have to do differents charts on selecting the day and location,but the file is too big and i don't know how to generate different data on a single chart by selecting day and location.Location has its ing and lat ,and sensing data has frequency and amplitude.

window.onload = function () {
    var dataPoints = [];
    var chart = new CanvasJS.Chart("chartContainer",{
        title:{
            text:"grafik"
        },
        data: [{
            type: "line",
            dataPoints : dataPoints,
        }],
        axisX:{
            title: "Frekvencija",
        },
        axisY:{
            title: "Amplituda",
        },
    });

    $.ajax({
                url:'http://localhost/nikola/analiza.json',
                dataType:'json',
                type:'get',
                cache:false,
                success:function(data){
                     for (var i = 0 ; i <1 ; i++) {
                             var text = data[i].analiza;
                                 var obj = JSON.parse(text);
                             //console.log(text);


                     for (var j =0 ; j < obj.length; j++) {
                             // console.log(obj[1]);
                            // console.log(Object.keys(obj[j]));
                             //console.log(Object.values(obj[j]));

                          //console.log(parseInt(Object.keys(obj[j])));

                         //console.log(parseInt(Object.values(obj[j])))
                             dataPoints.push({
                                x: parseInt(Object.keys(obj[j])),
                                y: parseFloat(Object.values(obj[j]))    

                            });
                             chart.render();
                         }
                    }

                    }


                  })
                  chart.render();
                 }

My json file is in this format:

[
  {
    "_id": "5cffcff9b6ed3",
    "vreme": "2019-06-11T17:59:53Z",
    "mac": "54:DC:1D:73:5F:44",
    "naziv": "naziv",
    "lat": 44.7711145,
    "lon": 20.4763012,
    "opis": "opis",
    "analiza": "[{\"0\":3.917390779395977},{\"5\":7.475976873230694},{\"10\":16.33162257755259},{\"15\":9.688201446060168},{\"20\":5.478183216329952},{\"25\":4.042249969761543},{\"30\":3.18927074217896},{\"35\":2.8451340274669},{\"40\":2.7139986970568755},{\"45\":2.257400053232554},{\"50\":2.083863438066691},{\"55\":1.7526316836609488},{\"60\":1.6185489196627403},{\"65\":1.3414906930025277},{\"70\":1.257007974033987},{\"75\":1.088545810607995},{\"80\":1.0384079451925063},{\"85\":0.9695744525064723},{\"90\":0.8589431336721263},{\"95\":0.8473513907241508},{\"100\":0.823475549104601},{\"105\":0.8641894524199009},{\"110\":0.8256248731865958},{\"115\":0.8229870233576272},{\"120\":0.8052080911038603},{\"125\":0.7892281314007762},{\"130\":0.774335614084865},{\"135\":0.7315031367437214},{\"140\":0.6845552137384564},{\"145\":0.6300071285613599},{\"150\":0.5316283057793433},{\"155\":0.4604893230943407},{\"160\":0.4159360370577539},{\"165\":0.43631594722390804},{\"170\":0.43206496870349886},{\"175\":0.4357461473119441},{\"180\":0.4337069289831665},{\"185\":0.4258134639806576},{\"190\":0.42642815642888765},{\"195\":0.4046156123946494},{\"200\":0.41291306451928717},{\"205\":0.40336740696586965},{\"210\":0.3994132740981157},{\"215\":0.40296388284332785},{\"220\":0.412811083474098},{\"225\":0.38913848016927344},{\"230\":0.39382245838235785},{\"235\":0.3776880703744829},{\"240\":0.34219455102061835},{\"245\":0.3517531375849036},{\"250\":0.3165518692332135},{\"255\":0.3208534011502812},{\"260\":0.3354436878079288},{\"265\":0.32258531498069026},{\"270\":0.31249590497679985},{\"275\":0.303682667157439},{\"280\":0.31645935028920863},{\"285\":0.3126205302234231},{\"290\":0.31490055899895536},{\"295\":0.2937611915852614},{\"300\":0.2690444323677682},{\"305\":0.2638474448417963},{\"310\":0.25232787379073907},{\"315\":0.25104220714816383},{\"320\":0.25433998719898115},{\"325\":0.23209089102455255},{\"330\":0.22285212969471896},{\"335\":0.2126710672134105},{\"340\":0.19705749104961362},{\"345\":0.19575260661574176},{\"350\":0.18551996280154145},{\"355\":0.18552476212728805},{\"360\":0.1799557815982331},{\"365\":0.17067932621796172},{\"370\":0.17357322411228499},{\"375\":0.1688195020942017},{\"380\":0.17175321564022916},{\"385\":0.18132211580233404},{\"390\":0.187036600223668},{\"395\":0.1766028712697536},{\"400\":0.18392766032944077},{\"405\":0.18470132083363516},{\"410\":0.18505761180766128},{\"415\":0.1793111699933933},{\"420\":0.17718203778372962},{\"425\":0.17333264862943654},{\"430\":0.17123745810143615},{\"435\":0.16875554144301186},{\"440\":0.15149327625192707},{\"445\":0.14282868870795123},{\"450\":0.14002695608554777},{\"455\":0.14431369997669619},{\"460\":0.14419686060500714},{\"465\":0.13953349779545354},{\"470\":0.13530652830932663},{\"475\":0.13754051182749866},{\"480\":0.1321428313372896},{\"485\":0.13700311913840638},{\"490\":0.13343578464622832},{\"495\":0.1321655505705365},{\"500\":0.13465796706481353},{\"505\":0.1320263205081478},{\"510\":0.13067575904185735},{\"515\":0.12604789697214286},{\"520\":0.1276411254524488},{\"525\":0.12180175796931242},{\"530\":0.12130420839019339},{\"535\":0.12389107472485873},{\"540\":0.1203453270745494},{\"545\":0.11513662456517447},{\"550\":0.11121000772759042},{\"555\":0.10544747239312006},{\"560\":0.10534828595996491},{\"565\":0.10557853397706068},{\"570\":0.10550184314832438},{\"575\":0.10769389000815476},{\"580\":0.10239720307294346},{\"585\":0.10769251732439074},{\"590\":0.11235700090531135},{\"595\":0.10485440692451824},{\"600\":0.10443947406395432},{\"605\":0.10331466715138289},{\"610\":0.10408584836397905},{\"615\":0.10326388286907506},{\"620\":0.10298182930975892},{\"625\":0.10800580245502905},{\"630\":0.11220074458925137},{\"635\":0.11983767502327737},{\"640\":0.12282818432196284},{\"645\":0.1115850538777886},{\"650\":0.10928283416464944},{\"655\":0.10614238214105111},{\"660\":0.10021910097938325},{\"665\":0.09503998307972773},{\"670\":0.09479584590870173},{\"675\":0.09169223728186245},{\"680\":0.08959979090172827},{\"685\":0.09094544576945018},{\"690\":0.09119485823109046},{\"695\":0.0912038264734867},{\"700\":0.09067311539191632},{\"705\":0.0919868073336041},{\"710\":0.0879380511267752},{\"715\":0.08660145559450523},{\"720\":0.08717344147221259},{\"725\":0.08408891095623335},{\"730\":0.08670992852581662},{\"735\":0.08434155946316936},{\"740\":0.08688691214681704},{\"745\":0.08558174752206274},{\"750\":0.08218418079547027},{\"755\":0.08404453493339553},{\"760\":0.0804740529679163},{\"765\":0.07990790995465945},{\"770\":0.08261514609254948},{\"775\":0.08113798138612179},{\"780\":0.08264772011636648},{\"785\":0.08154212944279049},{\"790\":0.08182643748956044},{\"795\":0.07976339222781408},{\"800\":0.07982200211705252},{\"805\":0.08257545663012819},{\"810\":0.07932740399765706},{\"815\":0.08001558941842633},{\"820\":0.0791962974914527},{\"825\":0.0763849471790243},{\"830\":0.07359060290045606},{\"835\":0.07262985815819463},{\"840\":0.07396348912216957},{\"845\":0.06945143669364715},{\"850\":0.06731904787156635},{\"855\":0.06723413182750686},{\"860\":0.06683051345944409},{\"865\":0.06521706834510925},{\"870\":0.06531805625956509},{\"875\":0.06330734936139079},{\"880\":0.0614549961938492},{\"885\":0.06125142022071348},{\"890\":0.06220022053600693},{\"895\":0.06082244701822898},{\"900\":0.06187558471939529},{\"905\":0.06063998860936531},{\"910\":0.061932266351203934},{\"915\":0.05834313757566143},{\"920\":0.05888487280097756},{\"925\":0.059563943247553285},{\"930\":0.05838228037614734},{\"935\":0.05753739522975587},{\"940\":0.06364328545364173},{\"945\":0.062046741931165966},{\"950\":0.0636473767043252},{\"955\":0.0642677677868101},{\"960\":0.06639047648297476},{\"965\":0.06579058907656123},{\"970\":0.06282597285870521},{\"975\":0.06295144269441794},{\"980\":0.06139098903495948},{\"985\":0.05957130491710573},{\"990\":0.05900731251325334},{\"995\":0.058290371590354925},{\"1000\":0.056332799245393896},{\"1005\":0.05700843908693141},{\"1010\":0.05678693999960965},{\"1015\":0.05641715937051973},{\"1020\":0.05505973020324616},{\"1025\":0.05601115385197406},{\"1030\":0.054881653610801155},{\"1035\":0.05584936220308984},{\"1040\":0.05466412889336171},{\"1045\":0.05472411387555235},{\"1050\":0.05498907783241538},{\"1055\":0.054930824676464665},{\"1060\":0.05534632842546955},{\"1065\":0.05545104720347028},{\"1070\":0.05368568998223436},{\"1075\":0.05578020264747458},{\"1080\":0.05469355483550597},{\"1085\":0.05348830539136959},{\"1090\":0.054503195544669814},{\"1095\":0.053438467411539105},{\"1100\":0.05308340447121849},{\"1105\":0.05409738645249288},{\"1110\":0.056560316785436035},{\"1115\":0.0539032979561159},{\"1120\":0.05361741394031425},{\"1125\":0.052147082420070795},{\"1130\":0.054039176490543336},{\"1135\":0.05344277152822378},{\"1140\":0.05415714377712948},{\"1145\":0.05168620677333625},{\"1150\":0.05353630191871894},{\"1155\":0.05221104197075697},{\"1160\":0.05208762092416434},{\"1165\":0.05220941226564293},{\"1170\":0.05243038697603365},{\"1175\":0.052720724098776324},{\"1180\":0.05030977707409891},{\"1185\":0.052380226791095864},{\"1190\":0.05168516883532162},{\"1195\":0.05253949719746896},{\"1200\":0.051575454912060906},{\"1205\":0.05195145950968452},{\"1210\":0.052339964475282566},{\"1215\":0.053962748695750955},{\"1220\":0.05314203196619293},{\"1225\":0.05276633214173996},{\"1230\":0.05181868307731211},{\"1235\":0.050846439975729865},{\"1240\":0.05136939237132328},{\"1245\":0.051313570330968644},{\"1250\":0.05134959335236712},{\"1255\":0.05049649774215895},{\"1260\":0.05000217139744825},{\"1265\":0.0510827124516461},{\"1270\":0.04997812034739473},{\"1275\":0.05140663388463926},{\"1280\":0.05258283331575544},{\"1285\":0.05110319102549427},{\"1290\":0.05033245815574115},{\"1295\":0.05253840082985468},{\"1300\":0.05084331275867209},{\"1305\":0.05207709792445355},{\"1310\":0.0517510589405001},{\"1315\":0.05209075721903191},{\"1320\":0.05363211095288752},{\"1325\":0.0515898859272017},{\"1330\":0.055672251765661096},{\"1335\":0.05487101036626601},{\"1340\":0.0553439063923267},{\"1345\":0.05371223561533201},{\"1350\":0.05341231538352997},{\"1355\":0.05532067287287096},{\"1360\":0.05102258273933389},{\"1365\":0.050365515336684985},{\"1370\":0.05185178945492351},{\"1375\":0.051763127298968516},{\"1380\":0.05068788721706193},{\"1385\":0.0528922985207337},{\"1390\":0.04903409946596551},{\"1395\":0.04916440660204018},{\"1400\":0.04861276808322019},{\"1405\":0.05017114469153787},{\"1410\":0.047837625233629694},{\"1415\":0.04858780636958487},{\"1420\":0.048840644008086534},{\"1425\":0.04832629656729874},{\"1430\":0.04806019813801955},{\"1435\":0.04624537025270546},{\"1440\":0.047011561469513616},{\"1445\":0.046253101704834036},{\"1450\":0.04559919060393784},{\"1455\":0.04793491262262155},{\"1460\":0.044664151277802835},{\"1465\":0.045216856036473435},{\"1470\":0.043318898115409926},{\"1475\":0.04544488064600879},{\"1480\":0.04480952455734549},{\"1485\":0.044691614496326096},{\"1490\":0.044101817508584475},{\"1495\":0.04397685025812293},{\"1500\":0.04293926512153774},{\"1505\":0.04296539454783506},{\"1510\":0.04257965674305962},{\"1515\":0.043329915964305174},{\"1520\":0.0419075880049352},{\"1525\":0.04256246946380697},{\"1530\":0.041318229260625707},{\"1535\":0.041254634093651675},{\"1540\":0.04271802252149129},{\"1545\":0.04258574679689937},{\"1550\":0.04344114459911783},{\"1555\":0.040949172976833696},{\"1560\":0.04053711974576971},{\"1565\":0.04023021758735093},{\"1570\":0.04031754568097872},{\"1575\":0.0398916502491004},{\"1580\":0.03873181386473657},{\"1585\":0.039147896633581494},{\"1590\":0.039310832269109246},{\"1595\":0.03962820208195784},{\"1600\":0.039379031021863665},{\"1605\":0.03823609324670774},{\"1610\":0.03814716650968189},{\"1615\":0.036967206520868906},{\"1620\":0.03817488233349678},{\"1625\":0.03747799311945764},{\"1630\":0.037378422533969766},{\"1635\":0.03596315168320327},{\"1640\":0.03555233675928438},{\"1645\":0.03469132379534334},{\"1650\":0.03661517225566827},{\"1655\":0.03672997334371664},{\"1660\":0.03509392504672192},{\"1665\":0.03603104637626437},{\"1670\":0.035528631122469484},{\"1675\":0.03564649779823075},{\"1680\":0.035558885948790316},{\"1685\":0.03563489413150125},{\"1690\":0.035221061090560016},{\"1695\":0.03435789009723769},{\"1700\":0.03488375167095111},{\"1705\":0.03509905155472811},{\"1710\":0.03529694911834617},{\"1715\":0.03583120974807997},{\"1720\":0.03579926611024364},{\"1725\":0.0352362480538877},{\"1730\":0.0356918541727617},{\"1735\":0.03527904074253932},{\"1740\":0.03619294010571718},{\"1745\":0.035797373941397696},{\"1750\":0.03672153891566316},{\"1755\":0.036513529425612805},{\"1760\":0.03622071766212635},{\"1765\":0.037510679363816614},{\"1770\":0.03676208631921998},{\"1775\":0.036170359328754495},{\"1780\":0.03629053114371868},{\"1785\":0.035607401452661},{\"1790\":0.035106188309360374},{\"1795\":0.034892465433543095},{\"1800\":0.0362184131660194},{\"1805\":0.03583025186869786},{\"1810\":0.036366090488768835},{\"1815\":0.035659655847264625},{\"1820\":0.03546111574423166},{\"1825\":0.03542982255237572},{\"1830\":0.035637537817493646},{\"1835\":0.03563744758073381},{\"1840\":0.03462674104403078},{\"1845\":0.03473504412635996},{\"1850\":0.0347116209031503},{\"1855\":0.035528779579018045},{\"1860\":0.03503381797044755},{\"1865\":0.034998402666152964},{\"1870\":0.03514551362808957},{\"1875\":0.034770469701873086},{\"1880\":0.035166845663830326},{\"1885\":0.03475432060914171},{\"1890\":0.03491559738230214},{\"1895\":0.0356769367760619},{\"1900\":0.03566226502176944},{\"1905\":0.03591966055578922},{\"1910\":0.03629952890999754},{\"1915\":0.03534249067704248},{\"1920\":0.035369536327189845},{\"1925\":0.034746279352079794},{\"1930\":0.03426415149806587},{\"1935\":0.035385163556825784},{\"1940\":0.03424505914203774},{\"1945\":0.03461593186722944},{\"1950\":0.03476368961762465},{\"1955\":0.035043119382361876},{\"1960\":0.03517485585046561},{\"1965\":0.03438914453105503},{\"1970\":0.03446857856210758},{\"1975\":0.034222812491106126},{\"1980\":0.03453507262710858},{\"1985\":0.034791871740446824},{\"1990\":0.03375940847807158},{\"1995\":0.033374779992075713},{\"2000\":0.03374230776897537},{\"2005\":0.0336560837663588},{\"2010\":0.034202985594221136},{\"2015\":0.033320043322484144},{\"2020\":0.03408523506693504},{\"2025\":0.03345809018270682},{\"2030\":0.03475539645035015},{\"2035\":0.03409221735605668},{\"2040\":0.03377468261307895},{\"2045\":0.03371709004249133},{\"2050\":0.03300903054839336},{\"2055\":0.032542202551480014},{\"2060\":0.03335869571882479},{\"2065\":0.03402076171094732},{\"2070\":0.033816072464436804},{\"2075\":0.03244513558920968},{\"2080\":0.03246805810494144},{\"2085\":0.0332466431777696},{\"2090\":0.03363844295422692},{\"2095\":0.03402626284894272},{\"2100\":0.03394719504129429},{\"2105\":0.03494809673940044},{\"2110\":0.033843079954540424},{\"2115\":0.03183362716574456},{\"2120\":0.03240807764430001},{\"2125\":0.03306730605298999},{\"2130\":0.03253776841379195},{\"2135\":0.033444798764209374},{\"2140\":0.032587872946607345},{\"2145\":0.03227762893247648},{\"2150\":0.032702207995527095},{\"2155\":0.032566493763918854},{\"2160\":0.031712340107641054},{\"2165\":0.03161516818619808},{\"2170\":0.03126097781826059},{\"2175\":0.03190520659431124},{\"2180\":0.032277770136937174},{\"2185\":0.03133447568729969},{\"2190\":0.03313144158345767},{\"2195\":0.03153142901560832},{\"2200\":0.03092037270105104},{\"2205\":0.03230393273452783},{\"2210\":0.030881492548928965},{\"2215\":0.030824904826835278},{\"2220\":0.032516741471499376},{\"2225\":0.03259560252980855},{\"2230\":0.0314279094171233},{\"2235\":0.03188553234266456},{\"2240\":0.03227064893300537},{\"2245\":0.031551779307063994},{\"2250\":0.031508198256142456},{\"2255\":0.03099609438509332},{\"2260\":0.03131889175029078},{\"2265\":0.0321598520287695},{\"2270\":0.03182833955264921},{\"2275\":0.03057974940550126},{\"2280\":0.03184801600308241},{\"2285\":0.03186566967922726},{\"2290\":0.03204264360823313},{\"2295\":0.03227081381228462},{\"2300\":0.03209401637526982},{\"2305\":0.03225793595790457},{\"2310\":0.03140829614834581},{\"2315\":0.03230366702381403},{\"2320\":0.03138980050102706},{\"2325\":0.032655287746335575},{\"2330\":0.03193861810277441},{\"2335\":0.03153324846395533},{\"2340\":0.031475108861895265},{\"2345\":0.03050394189502739},{\"2350\":0.030828200018150637},{\"2355\":0.03076771827831476},{\"2360\":0.030221372959736995},{\"2365\":0.03114772209088418},{\"2370\":0.03145946473865149},{\"2375\":0.03186460014932385},{\"2380\":0.030789905833585755},{\"2385\":0.030315681732978526},{\"2390\":0.03126511384737296},{\"2395\":0.03138672978356231},{\"2400\":0.031374872745224415},{\"2405\":0.03075913844263042},{\"2410\":0.03130733183529932},{\"2415\":0.030571805971743728},{\"2420\":0.031130572359813296},{\"2425\":0.02943935473022695},{\"2430\":0.030952120711103943},{\"2435\":0.03059338777569775},{\"2440\":0.03044695187015878},{\"2445\":0.030252449642153095},{\"2450\":0.03120266175366747},{\"2455\":0.030357030848412864},{\"2460\":0.02998722916951034},{\"2465\":0.030288706251925968},{\"2470\":0.0307276159590942},{\"2475\":0.030470060025951443},{\"2480\":0.030709134359233153},{\"2485\":0.031054583430286595},{\"2490\":0.030622721568494268},{\"2495\":0.03148081199180891},{\"2500\":0.0308566330995131},{\"2505\":0.03056619812676476},{\"2510\":0.03050166927612915},{\"2515\":0.03016222900350341},{\"2520\":0.030542772037159938},{\"2525\":0.030709538959490298},{\"2530\":0.03136963327502106},{\"2535\":0.030697988755067466},{\"2540\":0.031080174452520325},{\"2545\":0.030423005128048495},{\"2550\":0.030140089022849186},{\"2555\":0.03202255204591989},{\"2560\":0.03063415768378887},{\"2565\":0.031222668604599085},{\"2570\":0.03078238011607576},{\"2575\":0.03099576781725085},{\"2580\":0.030791247966480223},{\"2585\":0.031103364868758813},{\"2590\":0.030496103817538537},{\"2595\":0.0306389606752536},{\"2600\":0.030726576043142394},{\"2605\":0.029802893448790644},{\"2610\":0.03030416135303763},{\"2615\":0.030976129414066765},{\"2620\":0.02987266848846265},{\"2625\":0.02982035148615545},{\"2630\":0.030039813463025967},{\"2635\":0.03021807518012715},{\"2640\":0.029647440246262233},{\"2645\":0.029620989960753016},{\"2650\":0.02995017129458759},{\"2655\":0.030313850557816054},{\"2660\":0.030454606107331403},{\"2665\":0.029783133819734745},{\"2670\":0.03170162077861693},{\"2675\":0.030143588237721015},{\"2680\":0.029684093188612176},{\"2685\":0.030209907699472016},{\"2690\":0.029714358362598073},{\"2695\":0.030581747032923993},{\"2700\":0.030605903689910258},{\"2705\":0.03188523147255109},{\"2710\":0.030168093480758974},{\"2715\":0.03166189112477723},{\"2720\":0.031317744112560914},{\"2725\":0.02992408798754856},{\"2730\":0.03149958382490599},{\"2735\":0.031055613287377867},{\"2740\":0.031228973363766288},{\"2745\":0.029934068866259083},{\"2750\":0.030451729900836208},{\"2755\":0.03156624254808427},{\"2760\":0.03127456879116138},{\"2765\":0.031073676518037767},{\"2770\":0.03113696119980007},{\"2775\":0.03057143468011867},{\"2780\":0.03139462599258439},{\"2785\":0.03129855935850826},{\"2790\":0.0317605151857643},{\"2795\":0.031157425345294497},{\"2800\":0.03008953323466082},{\"2805\":0.03164627821448753},{\"2810\":0.029633181177856505},{\"2815\":0.032738981682914364},{\"2820\":0.03189219194741977},{\"2825\":0.030615660439358656},{\"2830\":0.03159257780501348},{\"2835\":0.031839008956798275},{\"2840\":0.0315577773488511},{\"2845\":0.03175560039817242},{\"2850\":0.03091637790007522},{\"2855\":0.030723129934199393},{\"2860\":0.031394673614561795},{\"2865\":0.031905756065870414},{\"2870\":0.03129431303805328},{\"2875\":0.031205442991180672},{\"2880\":0.031416109359663026},{\"2885\":0.03130431536733633},{\"2890\":0.03082264086471835},{\"2895\":0.03140022216787481},{\"2900\":0.03290732247509904},{\"2905\":0.031761260361177594},{\"2910\":0.03183257945200996},{\"2915\":0.032015228843544775},{\"2920\":0.031949647880815925},{\"2925\":0.03179181060060493},{\"2930\":0.032234993158740524},{\"2935\":0.030523650943295746},{\"2940\":0.032108017274996695},{\"2945\":0.03151496587929464},{\"2950\":0.03218514735161319},{\"2955\":0.03221606181934134},{\"2960\":0.031976841805895155},{\"2965\":0.03171501669238808},{\"2970\":0.033080224657028645},{\"2975\":0.03198802587549856},{\"2980\":0.03272048370688716},{\"2985\":0.030756517858875537},{\"2990\":0.031964937554024936},{\"2995\":0.031909069028514966},{\"3000\":0.03125488649459903},{\"3005\":0.030358940644015245},{\"3010\":0.031657880635449304},{\"3015\":0.03213063217277205},{\"3020\":0.03084641319718632},{\"3025\":0.031207483530900113},{\"3030\":0.03083832694752821},{\"3035\":0.029674778335338676},{\"3040\":0.029950577734026044},{\"3045\":0.03037390880817773},{\"3050\":0.029951397111188764},{\"3055\":0.029099187845173406},{\"3060\":0.028483532695241145},{\"3065\":0.02942056024625229},{\"3070\":0.02833896381369612},{\"3075\":0.0281016567742615},{\"3080\":0.028454437265547864},{\"3085\":0.02767009941956646},{\"3090\":0.027515708484367348},{\"3095\":0.026673572488910117},{\"3100\":0.02657823698263971},{\"3105\":0.026490128621573312},{\"3110\":0.02532922461939262},{\"3115\":0.025198499594791483},{\"3120\":0.02492896829001961},{\"3125\":0.02469744717454438},{\"3130\":0.025013704040609135},{\"3135\":0.024332646988370205},{\"3140\":0.02395635725433453},{\"3145\":0.023679493778319523},{\"3150\":0.023865926140815657},{\"3155\":0.023329108377633273},{\"3160\":0.02332675939881538},{\"3165\":0.023207319454438994},{\"3170\":0.02253814398200962},{\"3175\":0.02280910170938602},{\"3180\":0.022531262190209338},{\"3185\":0.02264548827251694},{\"3190\":0.022483630338907823},{\"3195\":0.022209805220691534}]"
  },..and so on

This seems to be more of a data-structure question. If I personally would be presented with this problem I would take a look at binary trees. Then I would take all my data and insert it into the tree sorted by my criteria (long, lat, freq, amp).

As the size of your file seems to be of relevance we should take a look at runtimes:
The runtime of the tree initialisation should be fine. A complexity of a bit over O(n*log n) and worst O(n*n) depending on your data, which is usually fine.
Searching the tree for entries would be O(n).

Using the binary tree you could then do search queries like:

(longitude > 40° && longitude < 60°) ||  (freq < 1 || amp > 40)

That's just my take on your situation. It might be completely wrong too, as your problem is not really that clear to me.

Edit: I should add that this is a bit more on the advanced side of things but not at all something to be intimidated by.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM