我有一个KML文件,列出了每个国家/地区的多边形坐标。我有一个纬度和经度对,我想检查这个位置所在的国家。我想以最有效的方式做到这一点。
我认为解析KML文件并逐个搜索会给用户带来痛苦,所以我假设我应该能够将这些国家及其坐标存储在离线状态(我希望我的应用程序脱机工作)数据库所以我每次启动Android应用程序时都不需要解析KML文件。
我有两个问题:
以下是一个如何为单个国家/地区组织KML文件的示例:
<Placemark>
<name>Ukraine</name>
<description><![CDATA[<table><tr><td><FeatureID>194</FeatureID></td><td>
<GMI_CNTRY>UKR</GMI_CNTRY></td><td>
<REGION>Europe</REGION></td></tr><tr><td colspan=3>
<a href="http://www.imageshack.us"><img src="http://img317.imageshack.us/img317/3765/ukraine4gw.jpg" border="0" width="250" alt="Image Hosted by ImageShack.us" /></a><br><a href="https://www.cia.gov/library/publications/the-world-factbook/geos//up.html">CIA World Factbook: UP</a></td></tr></table>]]></description>
<Style>
<PolyStyle>
<color>aaffffff</color>
<colorMode>random</colorMode>
</PolyStyle>
</Style>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
23.59208488464356,51.52827835083008,0 23.64609909057617,51.52080154418946,0 23.60860061645508,51.60810089111328,0 23.66670036315918,51.64059829711914,0 23.75359916687012,51.65250015258789,0 23.89669990539552,51.63579940795899,0 23.95389938354492,51.58499908447267,0 24.04310035705567,51.61029815673829,0 24.27939987182618,51.73780059814453,0 24.31329917907715,51.8224983215332,0 24.39669990539551,51.88669967651367,0 24.88529968261721,51.89939880371094,0 25.17939949035645,51.95970153808594,0 25.24419975280762,51.95940017700195,0 25.36109924316407,51.92689895629883,0 25.54697608947754,51.92323684692384,0 25.69580078125,51.92279815673829,0 25.77580070495606,51.93920135498048,0 25.97669982910157,51.91220092773439,0 26.09219932556152,51.91749954223633,0 26.18079948425293,51.86140060424805,0 26.43689918518066,51.85689926147462,0 26.43919944763184,51.82059860229493,0 26.45719909667969,51.81280136108397,0 26.64970016479493,51.82030105590821,0 26.93330001831055,51.74969863891603,0 27.02919960021973,51.76940155029297,0 27.17970085144043,51.76279830932617,0 27.20669937133789,51.7430992126465,0 27.20000076293945,51.6702995300293,0 27.29890060424805,51.65439987182618,0 27.27939987182618,51.59780120849609,0 27.44560050964356,51.60110092163086,0 27.47170066833496,51.62939834594727,0 27.51250076293946,51.63029861450195,0 27.71969985961914,51.59249877929688,0 27.72470092773438,51.5643997192383,0 27.67110061645508,51.50669860839844,0 27.74690055847168,51.46559906005859,0 27.8174991607666,51.53060150146485,0 27.81170082092285,51.58860015869142,0 27.85140037536621,51.62030029296876,0 27.88470077514649,51.61999893188478,0 27.97529983520508,51.56779861450195,0 28.08810043334961,51.56499862670898,0 28.13500022888184,51.58029937744142,0 28.18860054016113,51.6431007385254,0 28.25860023498535,51.66109848022461,0 28.26079940795898,51.61780166625978,0 28.33609962463379,51.57690048217774,0 28.35919952392578,51.53060150146485,0 28.47559928894043,51.5797004699707,0 28.62719917297364,51.56639862060548,0 28.66060066223145,51.45190048217774,0 28.6835994720459,51.4385986328125,0 28.71920013427734,51.45220184326172,0 28.73030090332031,51.4207992553711,0 28.75250053405762,51.41109848022461,0 28.76499938964844,51.41690063476563,0 28.76609992980957,51.48469924926758,0 28.84530067443848,51.55419921875,0 28.92889976501465,51.57669830322266,0 28.99530029296875,51.57469940185548,0 29.02829933166504,51.59579849243165,0 29.04000091552734,51.62469863891603,0 29.08329963684082,51.63830184936523,0 29.18610000610352,51.61220169067384,0 29.20499992370606,51.56829833984375,0 29.24329948425293,51.53779983520508,0 29.25079917907715,51.50469970703125,0 29.23609924316407,51.46640014648438,0 29.28190040588379,51.44329833984375,0 29.31310081481934,51.38499832153321,0 29.35390090942384,51.375,0 29.40970039367677,51.40280151367189,0 29.48310089111328,51.39030075073242,0 29.52389907836914,51.45360183715821,0 29.59440040588379,51.45309829711914,0 29.62170028686523,51.4900016784668,0 29.66970062255859,51.4989013671875,0 29.71780014038086,51.49440002441406,0 29.75919914245606,51.44110107421876,0 29.85140037536621,51.43610000610352,0 29.89579963684082,51.46939849853516,0 29.93390083312989,51.45719909667969,0 29.98329925537109,51.48640060424805,0 30.17639923095703,51.49190139770508,0 30.34810066223145,51.40530014038086,0 30.35029983520508,51.3582992553711,0 30.33499908447266,51.34500122070313,0 30.3838996887207,51.30720138549805,0 30.45999908447266,51.29690170288086,0 30.47970008850098,51.27000045776369,0 30.54940032958985,51.25279998779297,0 30.57169914245606,51.27330017089844,0 30.57080078125,51.30189895629884,0 30.64419937133789,51.33280181884766,0 30.63190078735352,51.35530090332032,0 30.64360046386719,51.37080001831054,0 30.61969947814941,51.41609954833986,0 30.58169937133789,51.43030166625977,0 30.58860015869141,51.45420074462891,0 30.6156005859375,51.45830154418946,0 30.56579971313477,51.51580047607422,0 30.58219909667969,51.53670120239259,0 30.53030014038086,51.55110168457031,0 30.52219963073731,51.56689834594727,0 30.54280090332032,51.57720184326172,0 30.51749992370606,51.59780120849609,0 30.55669975280762,51.62500000000001,0 30.57390022277832,51.6974983215332,0 30.62829971313477,51.71139907836914,0 30.64559936523438,51.74860000610352,0 30.61750030517578,51.76419830322266,0 30.65690040588379,51.77439880371094,0 30.67000007629395,51.7963981628418,0 30.66220092773438,51.82389831542969,0 30.74690055847168,51.89530181884766,0 30.79640007019043,51.9028015136719,0 30.80080032348633,51.94440078735352,0 30.88220024108887,51.96559906005859,0 30.89780044555664,51.99779891967774,0 30.97170066833496,52.00640106201173,0 30.96689987182617,52.02500152587891,0 30.93140029907227,52.03329849243164,0 30.94389915466309,52.04919815063479,0 30.93580055236816,52.06389999389648,0 30.96310043334961,52.0811004638672,0 31.16169929504395,52.08330154418946,0 31.25169944763184,52.04560089111329,0 31.27969932556152,52.05469894409179,0 31.30109977722168,52.09109878540039,0 31.36190032958984,52.11669921875001,0 31.78389930725098,52.10810089111329,0 31.89780044555664,52.09609985351563,0 31.90419960021973,52.05390167236329,0 31.92639923095704,52.03670120239258,0 32.01860046386719,52.05720138549805,0 32.1244010925293,52.04389953613282,0 32.22499847412109,52.07939910888673,0 32.29919815063477,52.10940170288086,0 32.33560180664063,52.15719985961914,0 32.34059906005859,52.22140121459961,0 32.38639831542969,52.25469970703126,0 32.35829925537109,52.31000137329103,0 32.39419937133789,52.33530044555665,0 32.50279998779298,52.31420135498048,0 32.5525016784668,52.31999969482422,0 32.7317008972168,52.26139831542969,0 32.86000061035156,52.27030181884767,0 32.92359924316406,52.24720001220703,0 33.05559921264648,52.3130989074707,0 33.09579849243164,52.31000137329103,0 33.2047004699707,52.37969970703126,0 33.33639907836914,52.35689926147462,0 33.39670181274414,52.3661003112793,0 33.44889831542969,52.34360122680664,0 33.49779891967773,52.36669921875001,0 33.52719879150391,52.34749984741211,0 33.51219940185547,52.31110000610352,0 33.53530120849609,52.29330062866211,0 33.6963996887207,52.36169815063477,0 33.84170150756836,52.34329986572266,0 33.86389923095703,52.31669998168946,0 33.92359924316406,52.2942008972168,0 33.96829986572267,52.23080062866211,0 34.05670166015625,52.20140075683594,0 34.09780120849609,52.15190124511719,0 34.07580184936523,52.11690139770509,0 34.07310104370117,52.06029891967774,0 34.12810134887695,51.98970031738282,0 34.10940170288086,51.95970153808594,0 34.16939926147461,51.95999908447267,0 34.24810028076172,51.90670013427733,0 34.2578010559082,51.87939834594728,0 34.30279922485352,51.88719940185547,0 34.33499908447266,51.8577995300293,0 34.38399887084961,51.84330749511719,0 34.44060134887695,51.7672004699707,0 34.43330001831055,51.7327995300293,0 34.39080047607422,51.71500015258789,0 34.11470031738282,51.68080139160158,0 34.09920120239258,51.66609954833984,0 34.10419845581055,51.64469909667969,0 34.15969848632813,51.62860107421876,0 34.17440032958984,51.58829879760742,0 34.23419952392578,51.54669952392578,0 34.23920059204102,51.42779922485354,0 34.2036018371582,51.40670013427734,0 34.23920059204102,51.37939834594727,0 34.29859924316406,51.36890029907227,0 34.31439971923828,51.34719848632814,0 34.27970123291017,51.29190063476563,0 34.20970153808594,51.2593994140625,0 34.30530166625977,51.23080062866212,0 34.38219833374023,51.26359939575195,0 34.53749847412109,51.23419952392578,0 34.63359832763672,51.2421989440918,0 34.66999816894531,51.17940139770508,0 34.73500061035156,51.17250061035157,0 34.91780090332031,51.19720077514649,0 34.95809936523439,51.22219848632814,0 35.0269012451172,51.20719909667969,0 35.07389831542969,51.22140121459961,0 35.12060165405273,51.20169830322266,0 35.12189865112305,51.14469909667969,0 35.17079925537109,51.0546989440918,0 35.30189895629883,51.06060028076172,0 35.37469863891602,51.03860092163087,0 35.35860061645508,51.01079940795897,0 35.29719924926758,50.99969863891602,0 35.30580139160156,50.95940017700195,0 35.30559921264648,50.94440078735354,0 35.36140060424805,50.92610168457032,0 35.36059951782227,50.87220001220704,0 35.39749908447266,50.84500122070313,0 35.39780044555664,50.80310058593751,0 35.45669937133789,50.77280044555664,0 35.45830154418945,50.69419860839844,0 35.48860168457031,50.67580032348633,0 35.39360046386719,50.63809967041016,0 35.4364013671875,50.52140045166017,0 35.46720123291016,50.48030090332031,0 35.56719970703125,50.45309829711915,0 35.58919906616211,50.37779998779298,0 35.6875,50.34669876098634,0 35.72890090942383,50.35329818725587,0 35.73920059204102,50.38330078125,0 35.7942008972168,50.39419937133791,0 35.85029983520508,50.4286003112793,0 36.0078010559082,50.43920135498047,0 36.13919830322266,50.42530059814453,0 36.16059875488281,50.40029907226564,0 36.18830108642578,50.40110015869141,0 36.20529937744141,50.3661003112793,0 36.29750061035156,50.28440093994141,0 36.36059951782227,50.28939819335938,0 36.41279983520508,50.32170104980469,0 36.51279830932617,50.28110122680664,0 36.56330108642578,50.27640151977539,0 36.54669952392578,50.24670028686524,0 36.55559921264648,50.22719955444336,0 36.63000106811523,50.21220016479492,0 36.65000152587892,50.21469879150391,0 36.70109939575195,50.26689910888672,0 36.79079818725586,50.3036003112793,0 36.97330093383789,50.3488998413086,0 37.05279922485352,50.33689880371095,0 37.13059997558594,50.34830093383789,0 37.23970031738281,50.37689971923828,0 37.31579971313477,50.4281005859375,0 37.45859909057617,50.43970108032229,0 37.46310043334961,50.40000152587892,0 37.49440002441406,50.35139846801758,0 37.62360000610352,50.30530166625977,0 37.60530090332031,50.21670150756837,0 37.7047004699707,50.13359832763672,0 37.73310089111328,50.08779907226564,0 37.92530059814453,50.02470016479492,0 38.01359939575195,49.93439865112304,0 38.00970077514648,49.90390014648439,0 38.02420043945313,49.90330123901367,0 38.10359954833984,49.93859863281251,0 38.14920043945313,49.9281005859375,0 38.18529891967774,49.95109939575196,0 38.1963996887207,49.98939895629883,0 38.18420028686523,50.06560134887695,0 38.31420135498047,50.07310104370118,0 38.33720016479492,50.05920028686523,0 38.3760986328125,49.98749923706055,0 38.45420074462891,49.98419952392578,0 38.4989013671875,49.95190048217773,0 38.59529876708984,49.96580123901367,0 38.64250183105469,49.95690155029298,0 38.68669891357422,49.97890090942383,0 38.69609832763672,49.92750167846679,0 38.75920104980469,49.88719940185547,0 38.88919830322266,49.86809921264648,0 38.9453010559082,49.80749893188477,0 39.06919860839844,49.81779861450195,0 39.14500045776367,49.87609863281251,0 39.19279861450195,49.87779998779298,0 39.27360153198242,49.75189971923828,0 39.36529922485352,49.73310089111329,0 39.46419906616211,49.75830078125,0 39.52059936523438,49.73440170288086,0 39.5807991027832,49.73080062866211,0 39.63970184326172,49.6156005859375,0 39.76110076904297,49.58470153808594,0 39.82170104980469,49.54940032958984,0 39.93920135498047,49.57170104980469,0 40.00500106811523,49.61439895629883,0 40.13491439819336,49.60483932495118,0 40.14780044555664,49.56890106201173,0 40.06999969482422,49.52280044555665,0 40.0531005859375,49.47829818725586,0 40.08890151977539,49.42470169067383,0 40.17079925537109,49.35499954223633,0 40.1796989440918,49.32690048217773,0 40.16059875488282,49.28359985351563,0 40.16690063476563,49.24860000610352,0 40.11920166015625,49.2317008972168,0 40.08190155029297,49.18389892578125,0 39.96640014648438,49.1239013671875,0 39.94060134887695,49.09389877319337,0 39.93889999389648,49.05500030517578,0 39.70330047607423,49.0353012084961,0 39.69440078735353,48.97309875488281,0 39.74610137939453,48.94419860839844,0 39.7672004699707,48.90390014648438,0 39.92359924316406,48.88750076293946,0 39.97060012817383,48.86000061035157,0 40.04190063476563,48.89580154418946,0 40.07059860229492,48.8838996887207,0 40.07669830322267,48.86420059204102,0 40.03969955444336,48.82030105590821,0 39.97579956054688,48.78939819335939,0 39.85029983520508,48.8224983215332,0 39.80390167236329,48.81779861450195,0 39.75719833374023,48.76639938354493,0 39.72719955444336,48.76219940185548,0 39.70220184326172,48.71419906616212,0 39.70169830322266,48.67689895629884,0 39.65689849853516,48.61669921875,0 39.66999816894532,48.58810043334961,0 39.79890060424805,48.58309936523438,0 39.85079956054689,48.55749893188478,0 39.86690139770509,48.50030136108398,0 39.83829879760742,48.4838981628418,0 39.88830184936523,48.44309997558595,0 39.9213981628418,48.36750030517578,0 39.89360046386719,48.33779907226563,0 39.83580017089844,48.31529998779297,0 39.91279983520508,48.27780151367189,0 39.99890136718751,48.29719924926758,0 40.01029968261719,48.2592010498047,0 39.99250030517578,48.23500061035156,0 39.93280029296875,48.21329879760742,0 39.88639831542969,48.14080047607423,0 39.84830093383789,48.11309814453125,0 39.86859893798828,48.04079818725586,0 39.77610015869141,48.02640151977539,0 39.81999969482422,47.96969985961914,0 39.79610061645508,47.91669845581055,0 39.80580139160156,47.87250137329102,0 39.76810073852539,47.83140182495117,0 39.7238998413086,47.81829833984376,0 39.59920120239258,47.83940124511719,0 39.41170120239258,47.8297004699707,0 39.34529876708984,47.85309982299804,0 39.13639831542969,47.83390045166017,0 39.04087066650391,47.86660766601564,0 38.89720153808594,47.86830139160156,0 38.83829879760743,47.85279846191406,0 38.78250122070313,47.76810073852539,0 38.7505989074707,47.68389892578125,0 38.69139862060547,47.69419860839844,0 38.60580062866211,47.63809967041016,0 38.44889831542969,47.62829971313477,0 38.33940124511719,47.60139846801758,0 38.28079986572266,47.50609970092773,0 38.28559875488281,47.39609909057617,0 38.20809936523438,47.31919860839845,0 38.22779846191406,47.29690170288087,0 38.30780029296875,47.29999923706055,0 38.31919860839844,47.27830123901367,0 38.3130989074707,47.25579833984375,0 38.21609878540039,47.19469833374024,0 38.2456169128418,47.09042739868164,0 38.13610076904297,47.05942916870118,0 38.07442855834961,47.09471130371094,0 38.03194046020508,47.08026885986328,0 37.53887939453125,47.0786018371582,0 37.32387924194336,46.87165832519531,0 37.3166618347168,46.90388107299805,0 37.20526885986328,46.9286003112793,0 36.90388107299805,46.81499099731445,0 36.77415084838867,46.6402702331543,0 36.802490234375,46.7180404663086,0 36.74692916870117,46.76305007934571,0 36.61360168457031,46.77526855468751,0 36.35776901245117,46.69776916503907,0 36.26803970336914,46.60387039184571,0 36.20888137817383,46.66276931762696,0 36.06748962402344,46.67026901245117,0 35.80582046508789,46.6161003112793,0 35.64638137817383,46.49943923950196,0 35.48720932006836,46.44443893432617,0 35.28332901000977,46.25609970092774,0 35.17081832885742,46.13388061523438,0 35.00165939331055,46.07249069213867,0 34.98777008056641,46.09387969970704,0 35.19110107421875,46.17499160766602,0 35.25777053833008,46.24665832519532,0 35.30749130249023,46.33166122436525,0 35.26443099975586,46.35498809814453,0 35.28387069702148,46.43415832519531,0 35.19332122802734,46.47998809814453,0 35.16859817504883,46.48749160766602,0 35.21081924438477,46.39331817626953,0 35.11304092407227,46.29499053955079,0 34.927490234375,46.22665023803711,0 34.89693069458008,46.2552604675293,0 34.81110000610352,46.17692947387695,0 34.8266487121582,46.10359954833984,0 34.94942855834961,45.79748916625977,0 35.17610168457031,45.52499008178711,0 35.38666152954102,45.33665084838868,0 35.51749038696289,45.2883186340332,0 35.72109985351563,45.33803939819337,0 35.81998825073242,45.46664810180665,0 35.86360168457031,45.45748901367188,0 35.85665893554688,45.40916061401367,0 35.94692993164063,45.36526107788086,0 36.02164840698242,45.36193084716798,0 36.13970947265625,45.46054077148439,0 36.30553817749023,45.4669303894043,0 36.30443954467773,45.43664932250978,0 36.59859848022461,45.42359924316406,0 36.63721084594727,45.3760986328125,0 36.62554168701172,45.33359909057617,0 36.48942947387695,45.33803939819337,0 36.4286003112793,45.25915908813477,0 36.45138168334961,45.07054138183594,0 36.36582183837891,45.03998947143554,0 36.02970886230469,45.03693008422852,0 35.9911003112793,44.99526977539063,0 35.83470916748047,44.9911003112793,0 35.78582000732422,45.05305099487305,0 35.63637924194336,45.11249160766602,0 35.52388000488281,45.11832046508789,0 35.41831970214844,45.06805038452149,0 35.39416122436523,45.02637100219727,0 35.43138122558594,44.99887847900391,0 35.36193084716797,44.98582077026368,0 35.36304092407228,44.94192886352539,0 35.31943893432617,44.96416091918945,0 35.15110015869141,44.89303970336914,0 35.1008186340332,44.80276107788086,0 35.06692886352539,44.78693008422852,0 34.95442962646484,44.83832931518555,0 34.53470993041992,44.75027084350586,0 34.43555068969727,44.69916152954102,0 34.33192825317383,44.54359817504883,0 34.26776885986328,44.54220962524414,0 34.239990234375,44.49581909179688,0 34.00693893432617,44.39525985717773,0 33.84693145751953,44.39804077148438,0 33.4536018371582,44.51581954956055,0 33.36832046508789,44.58916091918945,0 33.56832122802734,44.61442947387695,0 33.51388168334961,44.64081954956055,0 33.54832077026367,44.70026016235352,0 33.51942825317383,44.77914810180665,0 33.54499053955078,44.83248901367188,0 33.60860061645508,44.86915969848633,0 33.61053848266602,44.96944046020508,0 33.55054092407227,45.10498809814454,0 33.38721084594727,45.18664932250977,0 33.29970932006836,45.16331863403321,0 32.93220901489258,45.34360122680664,0 32.8135986328125,45.35831832885742,0 32.64387893676758,45.31026077270509,0 32.5010986328125,45.34720993041992,0 32.49137878417969,45.41888046264648,0 32.57387924194336,45.48249053955078,0 32.82526016235352,45.55887985229492,0 32.83443069458008,45.60498809814454,0 33.15137100219728,45.73249053955078,0 33.25859832763672,45.74776077270508,0 33.43693923950195,45.83554077148439,0 33.69221115112305,45.86082077026367,0 33.68999099731445,45.90748977661134,0 33.75138092041016,45.91859817504884,0 33.74499130249023,45.94527053833009,0 33.62192916870117,45.94414901733398,0 33.63943099975586,46.10609817504884,0 33.58275985717773,46.15721130371094,0 33.49499130249023,46.04331970214845,0 33.32192993164063,46.11999130249024,0 33.26916122436523,46.14165115356446,0 33.21498870849609,46.12776947021484,0 33.20943832397461,46.19305038452148,0 33.11249160766602,46.12971115112305,0 33.0283203125,46.16387939453125,0 33.03110122680664,46.13137817382814,0 32.86664962768555,46.12192916870117,0 32.50942993164063,46.07498931884766,0 32.2630500793457,46.1272087097168,0 32.24332046508789,46.17303848266602,0 31.8822193145752,46.31443023681642,0 31.89055061340332,46.27970886230469,0 31.80166053771973,46.27999114990236,0 31.75943946838379,46.31082153320313,0 31.77721977233887,46.32526016235353,0 31.98415946960449,46.3527717590332,0 32.05915832519531,46.39582061767578,0 32.00387954711914,46.45109939575195,0 31.80971908569336,46.48498916625977,0 31.70332908630371,46.48971176147461,0 31.68026924133301,46.4308204650879,0 31.51082992553711,46.58137893676758,0 31.84248924255371,46.52888107299805,0 32.35665893554688,46.45888137817384,0 32.42248916625978,46.49026107788087,0 32.42164993286133,46.53693008422852,0 32.55138015747071,46.59471130371095,0 32.32582855224609,46.55609893798828,0 32.23666000366211,46.6030387878418,0 32.1391487121582,46.55915832519531,0 31.98944091796875,46.65803909301759,0 31.93638038635254,46.80553817749023,0 31.98554992675781,46.85359954833984,0 32.00859832763672,46.93276977539064,0 31.93222045898438,46.94916152954102,0 31.97805023193359,47.00999069213868,0 31.86776924133301,47.02138137817384,0 31.88916015625,47.10860061645509,0 31.74832916259766,47.22275924682618,0 31.87166976928711,47.08110046386719,0 31.83638000488281,47.01638031005858,0 31.85832977294922,46.99137878417969,0 31.94416046142578,46.99748992919923,0 31.90055084228516,46.94998931884766,0 31.90472030639648,46.92470932006836,0 31.97443962097168,46.91915893554688,0 31.93972015380859,46.85165023803711,0 31.88249969482422,46.82915115356445,0 31.86360931396485,46.78554916381836,0 31.90888023376465,46.72859954833984,0 31.90082931518555,46.64416122436523,0 31.80916023254395,46.61555099487305,0 31.62137985229493,46.65026855468751,0 31.55722045898438,46.61027145385743,0 31.47499084472657,46.64471054077149,0 31.59193992614746,46.78387069702147,0 31.60137939453125,46.82526016235352,0 31.51582908630371,46.7391586303711,0 31.46944046020509,46.76332092285156,0 31.50638008117677,46.72053909301759,0 31.46194076538086,46.66249084472656,0 31.33499908447266,46.60110092163086,0 31.18943977355957,46.62498092651367,0 30.79610061645509,46.552490234375,0 30.74805068969727,46.50555038452148,0 30.79305076599121,46.43999099731445,0 30.68888092041016,46.31692886352539,0 30.66888046264648,46.27138137817384,0 30.4447193145752,46.04803848266602,0 30.41399955749512,46.0250587463379,0 30.33193969726563,45.99776077270508,0 30.31316947937012,45.94944000244141,0 30.13842010498047,45.8173713684082,0 30.12833023071289,45.85776901245118,0 30.08999061584473,45.80998992919922,0 30.01832962036133,45.83832931518555,0 29.96471977233887,45.83554077148439,0 29.9577693939209,45.78248977661134,0 29.93444061279297,45.72332000732422,0 29.88999938964845,45.76443099975587,0 29.80443954467773,45.73693084716797,0 29.79748916625977,45.71192932128906,0 29.86360931396484,45.66915893554688,0 29.73567962646485,45.60958862304689,0 29.67943954467773,45.69804000854492,0 29.69721984863282,45.78165054321289,0 29.63721084594727,45.82276916503906,0 29.649169921875,45.78248977661134,0 29.59693908691407,45.68777084350586,0 29.59527015686035,45.55221176147462,0 29.65991020202637,45.53496932983399,0 29.600830078125,45.47499084472656,0 29.64193916320801,45.43664932250978,0 29.73443984985352,45.47166061401367,0 29.75527954101563,45.44248962402345,0 29.73055076599121,45.22470855712892,0 29.66176986694336,45.21023941040039,0 29.67082977294922,45.28749084472656,0 29.63694000244141,45.35026931762695,0 29.56193923950195,45.39525985717773,0 29.31415939331055,45.43775939941407,0 29.00444030761719,45.32109832763672,0 28.78443908691406,45.32081985473633,0 28.75694084167481,45.26554107666016,0 28.79972076416016,45.23775863647462,0 28.74860000610352,45.22497940063477,0 28.5586109161377,45.24608993530273,0 28.31665992736816,45.33749008178711,0 28.27610015869141,45.43331909179688,0 28.21201896667481,45.44820022583009,0 28.23810005187988,45.50329971313478,0 28.28389930725098,45.52529907226563,0 28.47750091552734,45.50640106201172,0 28.52280044555664,45.51779937744141,0 28.53030014038086,45.54359817504884,0 28.51140022277832,45.56919860839844,0 28.55610084533692,45.58670043945313,0 28.53359985351563,45.60720062255859,0 28.52829933166504,45.64469909667969,0 28.48940086364746,45.66500091552734,0 28.52689933776856,45.71419906616212,0 28.58250045776367,45.71969985961914,0 28.58359909057617,45.76309967041017,0 28.67530059814453,45.77529907226563,0 28.69470024108887,45.79439926147461,0 28.68889999389648,45.81890106201172,0 28.75469970703125,45.83860015869142,0 28.76889991760254,45.86690139770508,0 28.74780082702637,45.92919921875,0 28.75580024719238,45.95999908447266,0 28.97190093994141,46.00669860839844,0 28.98060035705566,46.02970123291016,0 28.95719909667969,46.10559844970703,0 29.04109954833985,46.19390106201172,0 28.94939994812012,46.27080154418946,0 28.96500015258789,46.3119010925293,0 28.93219947814941,46.42829895019531,0 29.03470039367676,46.49530029296875,0 29.20499992370606,46.54140090942384,0 29.21940040588379,46.53279876708984,0 29.22830009460449,46.48469924926758,0 29.22640037536621,46.41690063476563,0 29.2007999420166,46.38140106201172,0 29.22419929504395,46.36529922485352,0 29.26390075683594,46.39860153198242,0 29.30669975280762,46.40219879150391,0 29.30080032348633,46.44499969482422,0 29.32390022277832,46.47639846801758,0 29.34749984741211,46.47639846801758,0 29.39310073852539,46.41609954833984,0 29.39609909057617,46.4380989074707,0 29.48360061645509,46.49219894409179,0 29.50749969482422,46.48109817504883,0 29.49970054626465,46.43220138549805,0 29.57609939575195,46.41999816894531,0 29.59079933166504,46.38330078125001,0 29.62669944763184,46.36920166015625,0 29.67280006408691,46.39139938354494,0 29.66329956054688,46.4286003112793,0 29.73310089111328,46.43939971923828,0 29.7332992553711,46.47809982299805,0 29.80170059204102,46.42559814453125,0 29.83029937744141,46.38809967041016,0 29.82719993591309,46.36169815063478,0 29.84830093383789,46.3483009338379,0 29.88470077514648,46.35110092163086,0 29.93000030517579,46.38359832763673,0 30.10390090942383,46.38190078735352,0 30.13419914245606,46.41559982299805,0 30.07309913635254,46.42279815673829,0 30.00690078735352,46.45669937133789,0 30.01860046386719,46.46969985961914,0 29.99889945983887,46.49610137939454,0 29.97060012817383,46.48809814453125,0 29.9286003112793,46.50529861450195,0 29.89859962463379,46.52999877929688,0 29.89579963684082,46.55110168457031,0 29.96890068054199,46.57529830932618,0 29.94829940795898,46.63690185546875,0 29.97279930114746,46.73440170288086,0 23.67137908935547,51.43165969848634,0 23.59208488464356,51.52827835083008,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
答案 0 :(得分:1)
2。预先计算每个国家/地区的边界框。当位置在边界框内时,然后加载该国家/地区的多边形并执行更准确的测试。您只需要加载并检查一些多边形。然后,您甚至可以根据需要从KML文件中加载多边形。
答案 1 :(得分:0)
我认为存储这些坐标的最佳方法是为每个只有2D float
标签的国家/地区创建一个非常简单的类(第一个D用于地理点编号,第二个D的大小为2,包含lat或long)
使用您的坐标列表,您可以创建一个Region
列表(使用Path
和Region.setPath(Path, Region)
)并调用Region.contain(X, Y)
来查看X,Y是否位于内部你的国家。