地理围栏
目的:通过python判断点坐标是否在一个范围之内。
一、准备数据:
1、xy随机坐标值点。
2、一个闭合的面的坐标串。(闭合的面要首尾坐标相同,否则程序运行会报错)
[
[ 117.107107687090775, 36.709505905573721 ], [ 117.1071246868093, 36.708675902880834 ], [ 117.107174687037869, 36.707665899416241 ], [ 117.107732687254838, 36.707119897876701 ], [ 117.109374687219898, 36.707167897898437 ], [ 117.11167068676292, 36.707335898458922 ], [ 117.111924687206184, 36.705977893977703 ], [ 117.113902686732047, 36.706233894911044 ], [ 117.114492686735915, 36.706323895424838 ], [ 117.115290687152239, 36.70642789555113 ], [ 117.113993686968627, 36.707566899709938 ], [ 117.113997687166588, 36.708730903380015 ], [ 117.1185596870138, 36.707614899452523 ], [ 117.121550687041193, 36.707301898100752 ], [ 117.124642687350672, 36.707714900140253 ], [ 117.126860687076061, 36.708005900710027 ], [ 117.128469687429288, 36.708218901453023 ], [ 117.129757687391972, 36.708395901824275 ], [ 117.133095686850581, 36.708851904051627 ], [ 117.133918687381339, 36.708962904345384 ], [ 117.136054687090891, 36.709253905230199 ], [ 117.13618768716033, 36.708218901453023 ], [ 117.135850686876296, 36.70789490047418 ], [ 117.135859687097224, 36.706717896337182 ], [ 117.136405686720153, 36.704565889069684 ], [ 117.138776687504659, 36.704664889761148 ], [ 117.139051686965914, 36.70343588561505 ], [ 117.139298686838202, 36.703431885540205 ], [ 117.140247686867156, 36.703617885921076 ], [ 117.140258686737781, 36.70373788634614 ], [ 117.142271687322136, 36.703758886293258 ], [ 117.142379687277071, 36.702465882247111 ], [ 117.142376686903958, 36.702451881807463 ], [ 117.142347687489973, 36.702233881113962 ], [ 117.143211687130346, 36.702407881849474 ], [ 117.143184687366144, 36.702506882439778 ], [ 117.143190687213874, 36.702507882110432 ], [ 117.143377686811633, 36.7025508823411 ], [ 117.143383687557673, 36.702545882549941 ], [ 117.143420687367637, 36.702453881870419 ], [ 117.143426687215367, 36.702451881807463 ], [ 117.143946686899127, 36.702573882672425 ], [ 117.143962686792719, 36.702572882282254 ], [ 117.143967686815515, 36.702219881352256 ], [ 117.143491687512778, 36.70221888095756 ], [ 117.143485686766653, 36.70221588121408 ], [ 117.142761686868496, 36.702089881076645 ], [ 117.142755687020667, 36.702090880752721 ], [ 117.142793687553791, 36.701157877692665 ], [ 117.143141686810139, 36.700946876928072 ], [ 117.143147687556166, 36.700946876928072 ], [ 117.143651687346434, 36.70086087680869 ], [ 117.143579687376445, 36.700417875096313 ], [ 117.143577686828181, 36.700411875468582 ], [ 117.14390168669334, 36.698958869957117 ], [ 117.144156686961537, 36.698674869188615 ], [ 117.144436687343884, 36.697960866639001 ], [ 117.144925687065395, 36.698021866698312 ], [ 117.144757686836016, 36.699396871438957 ], [ 117.144779687475648, 36.699989873585992 ], [ 117.144775687277601, 36.699995873966891 ], [ 117.144961687050525, 36.700420874910044 ], [ 117.145175687310783, 36.700330874686145 ], [ 117.145272687395106, 36.698317868022478 ], [ 117.14527368722004, 36.698303868267786 ], [ 117.145352686862694, 36.697375864746029 ], [ 117.145374687502311, 36.69713086386804 ], [ 117.145379687525192, 36.697125863724452 ], [ 117.144832687179118, 36.697026863406286 ], [ 117.144822687133342, 36.697021863976175 ], [ 117.14484868707261, 36.695882859845248 ], [ 117.144843687049729, 36.695882859845248 ], [ 117.144383686742188, 36.695868859647184 ], [ 117.144468687130967, 36.694842856503314 ], [ 117.146158686776616, 36.695792859350284 ], [ 117.146100687050435, 36.697374865008669 ], [ 117.146759687549491, 36.697345864695137 ], [ 117.146851686712722, 36.697597865911035 ], [ 117.147076686843604, 36.697752866379936 ], [ 117.147809686962603, 36.697903866894073 ], [ 117.148106687063475, 36.697973866726585 ], [ 117.148325687346627, 36.698025867054717 ], [ 117.148797687349798, 36.69798686681186 ], [ 117.149211686728307, 36.69821686762581 ], [ 117.149826686846509, 36.698651869131204 ], [ 117.149592687393096, 36.699057870668213 ], [ 117.149212687451453, 36.701159877789287 ], [ 117.149488686737726, 36.701304877814785 ], [ 117.149855687158706, 36.701124877891196 ], [ 117.149814687150879, 36.6998238729444 ], [ 117.150231686902401, 36.699722873085882 ], [ 117.150372687367664, 36.699195870901058 ], [ 117.150822686731217, 36.69984987320732 ], [ 117.149943687022287, 36.700769876686408 ], [ 117.149906687212493, 36.70187988038861 ], [ 117.149779686990769, 36.703882886549721 ], [ 117.150544686896865, 36.703916886980011 ], [ 117.150195686917371, 36.705830893430502 ], [ 117.15287968679803, 36.705869893294462 ], [ 117.153019687438444, 36.70422688804927 ], [ 117.153919687063848, 36.702623882711116 ], [ 117.153972686767233, 36.700963876714098 ], [ 117.155121686812819, 36.700937876827943 ], [ 117.156293687322886, 36.700897876930412 ], [ 117.157742686944246, 36.700863876605013 ], [ 117.157427687300014, 36.70165487958058 ], [ 117.157486686851215, 36.704534889299822 ], [ 117.156913687463984, 36.704505888806793 ], [ 117.157260686895299, 36.705103890774382 ], [ 117.157614686897688, 36.705086891183754 ], [ 117.157571687239979, 36.705266891911499 ], [ 117.15691768676372, 36.705309892038962 ], [ 117.15713868669674, 36.705693893216129 ], [ 117.157302686728073, 36.705989893804166 ], [ 117.157369687573564, 36.706247894661821 ], [ 117.158386687374829, 36.706247894661821 ], [ 117.15845068694891, 36.707193897837797 ], [ 117.158429687032523, 36.70788190062418 ], [ 117.161347687264822, 36.707821900069526 ], [ 117.159957687194748, 36.697985867082402 ], [ 117.160423687350104, 36.697418864966565 ], [ 117.161012687529137, 36.696705862742014 ], [ 117.164082687199084, 36.695066857314814 ], [ 117.164034687518495, 36.693354851061073 ], [ 117.163996686985286, 36.691864846015505 ], [ 117.164266687322126, 36.691206844219614 ], [ 117.163923687190547, 36.691111843478737 ], [ 117.163869686763746, 36.690724842015328 ], [ 117.162796686886082, 36.690758842503001 ], [ 117.162742687357763, 36.689697838822084 ], [ 117.162764687099084, 36.688392834130575 ], [ 117.163017686819103, 36.688208834082758 ], [ 117.164169687237717, 36.687373831148669 ], [ 117.163485687522368, 36.685870826216245 ], [ 117.163272687087201, 36.685507824596904 ], [ 117.162995687077697, 36.685041823217553 ], [ 117.162025687132271, 36.683384817707505 ], [ 117.162593687394917, 36.681776811767726 ], [ 117.164137687450719, 36.682157813263856 ], [ 117.164620687324415, 36.682034813202698 ], [ 117.16446568751374, 36.680465807641667 ], [ 117.164170687062565, 36.680398807593939 ], [ 117.164095686719648, 36.679916806089807 ], [ 117.164621687149349, 36.679925805768939 ], [ 117.164793687576761, 36.680390807207985 ], [ 117.1651786875412, 36.680510807866725 ], [ 117.165071687411114, 36.681181810453644 ], [ 117.165747686730398, 36.681225810312512 ], [ 117.165865686731181, 36.68087280934423 ], [ 117.165961686990656, 36.680536808176896 ], [ 117.167131686952729, 36.67977180535128 ], [ 117.167120687082033, 36.679039802771747 ], [ 117.167163686739727, 36.678110799469017 ], [ 117.167420687556003, 36.67797379956675 ], [ 117.167261687547281, 36.677110796445341 ], [ 117.167033687043386, 36.675554790872063 ], [ 117.162567687455649, 36.675197789714893 ], [ 117.163879686809508, 36.674617787727833 ], [ 117.165767686821937, 36.674186786585857 ], [ 117.166088687212195, 36.673756785235511 ], [ 117.165691687552211, 36.673507783845778 ], [ 117.165874686952023, 36.673128782843023 ], [ 117.166560687215366, 36.671667777811933 ], [ 117.167204686747567, 36.670874775289619 ], [ 117.167665686880028, 36.670781774819183 ], [ 117.168153686776705, 36.670689774320493 ], [ 117.168470686969101, 36.67062677474587 ], [ 117.168545687312204, 36.670212772963772 ], [ 117.169566687311317, 36.67019677295454 ], [ 117.169587687227619, 36.66884576819794 ], [ 117.171100687321271, 36.668561767179419 ], [ 117.170562687196025, 36.668165765765359 ], [ 117.170692686892366, 36.667259763108724 ], [ 117.170798687197518, 36.666848761629296 ], [ 117.170820686938839, 36.666263759409297 ], [ 117.171604687111525, 36.666281759798835 ], [ 117.171690687325238, 36.664551754034413 ], [ 117.171679687454528, 36.663940751503709 ], [ 117.173986686868346, 36.663372749688079 ], [ 117.173761686737464, 36.662520747031834 ], [ 117.174769687216013, 36.660911741495823 ], [ 117.173493686948788, 36.658820734413588 ], [ 117.170132687025713, 36.658571733699141 ], [ 117.168844687062929, 36.658473733000292 ], [ 117.166586687154734, 36.657741731025794 ], [ 117.164515686844013, 36.65877073399902 ], [ 117.161337687219131, 36.658967734752508 ], [ 117.159880687201877, 36.660615740325049 ], [ 117.158592687239107, 36.660857741591101 ], [ 117.158569686774641, 36.661980745317024 ], [ 117.157411687406423, 36.663323749527798 ], [ 117.156473687247981, 36.664390753386485 ], [ 117.156033687031908, 36.664898754710869 ], [ 117.153616687114976, 36.664507754007232 ], [ 117.153344687128353, 36.664459753293606 ], [ 117.153155686982515, 36.665505756956136 ], [ 117.152940686897395, 36.665488757257599 ], [ 117.1526186875805, 36.665462756905953 ], [ 117.152291687342327, 36.665432756655576 ], [ 117.152007686761849, 36.665239756494927 ], [ 117.151391686818712, 36.664829754476635 ], [ 117.150908677961795, 36.664769754912029 ], [ 117.150746687461577, 36.664826754715662 ], [ 117.150715687499428, 36.66515675582157 ], [ 117.150328686986811, 36.665398756501865 ], [ 117.150076687091726, 36.665553757017221 ], [ 117.149706687195945, 36.665794757742461 ], [ 117.148592687310355, 36.665553757017221 ], [ 117.148533686860674, 36.665863758552597 ], [ 117.148271686919998, 36.667049762411359 ], [ 117.147960687473713, 36.66701476211945 ], [ 117.147697686809622, 36.66698476175344 ], [ 117.147296686951591, 36.666936761864221 ], [ 117.146255686861025, 36.666812761831665 ], [ 117.145554687427406, 36.666719761496054 ], [ 117.14541168731229, 36.667460763537918 ], [ 117.145385687373022, 36.667624763900719 ], [ 117.145358686710509, 36.66776176493763 ], [ 117.145304687182104, 36.668037765796868 ], [ 117.144720687025966, 36.670982775416057 ], [ 117.141900686702925, 36.670690774404868 ], [ 117.141077687070577, 36.670614774443607 ], [ 117.14107468669765, 36.670621774319933 ], [ 117.140267686958694, 36.670491773939602 ], [ 117.140259687461011, 36.670492774026464 ], [ 117.139593687289207, 36.670466773924389 ], [ 117.139143687027527, 36.670451774055486 ], [ 117.139131687331883, 36.670447773705661 ], [ 117.138435687022763, 36.670414773693871 ], [ 117.137509687458191, 36.67062677474587 ], [ 117.136106686969327, 36.6703027731334 ], [ 117.13517568738186, 36.672001779394058 ], [ 117.134529687301594, 36.672117779185783 ], [ 117.134518687430884, 36.672109779379724 ], [ 117.134507687560273, 36.672109779379724 ], [ 117.134512687583069, 36.67210177957277 ], [ 117.134598686898556, 36.671541777330326 ], [ 117.134641687454561, 36.671171775993024 ], [ 117.134636687431765, 36.671166776323105 ], [ 117.134357686874182, 36.671093775628194 ], [ 117.133971687084809, 36.670982775416057 ], [ 117.133973686734578, 36.670977775733704 ], [ 117.133966687061914, 36.670974775491871 ], [ 117.133052687192887, 36.671180775974676 ], [ 117.133047687170006, 36.671180775974676 ], [ 117.133050687543104, 36.671175776305198 ], [ 117.132961686956293, 36.670952775156003 ], [ 117.132854686826207, 36.670669774792771 ], [ 117.132554687250618, 36.670397773638548 ], [ 117.132254686776477, 36.670139772804966 ], [ 117.132256687324727, 36.670134773067808 ], [ 117.132391687043864, 36.66939176991103 ], [ 117.130393687426732, 36.668523767237645 ], [ 117.130396686901449, 36.668513767553279 ], [ 117.131619687465204, 36.666860761798247 ], [ 117.132153687392588, 36.66614075915647 ], [ 117.13237168695251, 36.66587575815462 ], [ 117.132839686757634, 36.665306756773582 ], [ 117.133698687273338, 36.66419575243723 ], [ 117.134452687308723, 36.663211749456266 ], [ 117.136273687374043, 36.660822741365713 ], [ 117.134624686837824, 36.660277739612035 ], [ 117.131690686712048, 36.659315736333127 ], [ 117.131744687138578, 36.658652733785509 ], [ 117.131738687290849, 36.658650734024619 ], [ 117.13134068690762, 36.658245732729895 ], [ 117.131319686991233, 36.657212728908128 ], [ 117.131319686991233, 36.656868728245328 ], [ 117.131308687120523, 36.655861724684435 ], [ 117.131303687097727, 36.655055722038654 ], [ 117.131297687249912, 36.655061721601363 ], [ 117.127306687139878, 36.655086721575721 ], [ 117.127301687116997, 36.655082721868666 ], [ 117.127024687107578, 36.653910718023759 ], [ 117.127158687001867, 36.652848714619168 ], [ 117.127163687024748, 36.652834714515777 ], [ 117.127372687262223, 36.652332712628699 ], [ 117.127376687460085, 36.652324712207481 ], [ 117.127801686709205, 36.651876711075559 ], [ 117.127827687546784, 36.651859711249919 ], [ 117.128642686783238, 36.651472709795215 ], [ 117.128649687354297, 36.651471709461092 ], [ 117.131106687454206, 36.651393709311371 ], [ 117.131110686753757, 36.651386709127742 ], [ 117.132183687529718, 36.651308708891783 ], [ 117.132190687202481, 36.651307709276367 ], [ 117.132408686762304, 36.651240709065213 ], [ 117.132415687333449, 36.651238709111766 ], [ 117.131568687411516, 36.649655703386593 ], [ 117.13255868744848, 36.649088701762096 ], [ 117.13253368733406, 36.649078701714998 ], [ 117.129078686801364, 36.647804697353081 ], [ 117.1290716871287, 36.647805697014057 ], [ 117.128696687209853, 36.646170692042553 ], [ 117.128704686707451, 36.646150691910073 ], [ 117.129133687052928, 36.644505685760372 ], [ 117.129136687426026, 36.644491686302516 ], [ 117.1290716871287, 36.642349678735108 ], [ 117.128964686998529, 36.638588666008339 ], [ 117.128965686823548, 36.638568666069659 ], [ 117.129598687383435, 36.636975660693601 ], [ 117.128890687378671, 36.636338658365027 ], [ 117.128889687553738, 36.636333658595184 ], [ 117.128921687340821, 36.634817653026637 ], [ 117.128944686907076, 36.634814653538072 ], [ 117.129638687566327, 36.634523652134739 ], [ 117.129620687124657, 36.634521652468088 ], [ 117.128543687049131, 36.634196651163819 ], [ 117.128683686791064, 36.633447648813629 ], [ 117.128171687503396, 36.632998646877645 ], [ 117.128200686917367, 36.631588642150625 ], [ 117.129609687254046, 36.630750639397569 ], [ 117.129704686790191, 36.6292976345676 ], [ 117.130959687141129, 36.627454628242091 ], [ 117.130972687559904, 36.627451628467 ], [ 117.13431968723927, 36.625815622670387 ], [ 117.134328687460112, 36.625810622938737 ], [ 117.140270687331807, 36.623969616800174 ], [ 117.140275687354602, 36.623965616919037 ], [ 117.140769687099095, 36.623448614682552 ], [ 117.140785686992501, 36.623444614774499 ], [ 117.141359687102877, 36.623258614492656 ], [ 117.141365686950692, 36.623254614574662 ], [ 117.141337687361556, 36.622156610499978 ], [ 117.140543687143179, 36.621726609099625 ], [ 117.140539686945317, 36.621721609102849 ], [ 117.137717686972422, 36.621222607785342 ], [ 117.137699687428963, 36.621218607761648 ], [ 117.13695968673899, 36.621003606908175 ], [ 117.136944687568729, 36.620998606864418 ], [ 117.134121686872589, 36.619154600338987 ], [ 117.132914687100737, 36.61538058787449 ], [ 117.132911686727624, 36.615375587466048 ], [ 117.133750687151789, 36.611929576401103 ], [ 117.132519687090436, 36.608664565405313 ], [ 117.132852687176424, 36.608174563363612 ], [ 117.133130687010691, 36.603974549308845 ], [ 117.132981687047831, 36.600511537611091 ], [ 117.132888687161369, 36.598342530551882 ], [ 117.132295686784488, 36.597273526370977 ], [ 117.128007687471793, 36.592898512179602 ], [ 117.126074687253592, 36.591998508617081 ], [ 117.124834686971312, 36.592143509467611 ], [ 117.122380687244515, 36.594437517231981 ], [ 117.120485687559423, 36.595074518909428 ], [ 117.118618687463396, 36.595296520164943 ], [ 117.11474468752931, 36.594446516804354 ], [ 117.114116686992219, 36.594498517117565 ], [ 117.104932687023165, 36.599897535394732 ], [ 117.094946687338052, 36.599768534911547 ], [ 117.092854687111227, 36.599741535168839 ], [ 117.090516686837049, 36.601058539411476 ], [ 117.087513687114196, 36.602600544710036 ], [ 117.081247687377527, 36.601153539513398 ], [ 117.079902687513325, 36.606226556758521 ], [ 117.071414686954995, 36.614715585505408 ], [ 117.068657687279426, 36.617472594759811 ], [ 117.064760686880774, 36.62136960778809 ], [ 117.064064687469966, 36.622232610709304 ], [ 117.063829687293392, 36.623100613970394 ], [ 117.063829687293392, 36.624607618965321 ], [ 117.063673686759401, 36.625475622157396 ], [ 117.063272686901371, 36.62618762414268 ], [ 117.062481687056192, 36.626581625306287 ], [ 117.060435686859989, 36.62675162583416 ], [ 117.05970468728907, 36.626815626639619 ], [ 117.058628687038393, 36.628296631167608 ], [ 117.057256687409989, 36.629642635726263 ], [ 117.055962686701093, 36.629866636759097 ], [ 117.053480687385246, 36.630850639814405 ], [ 117.05043168673329, 36.629198634200677 ], [ 117.048649687026028, 36.627212627982082 ], [ 117.047173686742255, 36.625955623675488 ], [ 117.046595687332328, 36.626346624765034 ], [ 117.045542687546117, 36.627058627355431 ], [ 117.044169687194483, 36.628229631126274 ], [ 117.043802686773404, 36.628209631382276 ], [ 117.041508686880064, 36.628022630425605 ], [ 117.039448687338634, 36.62685162639346 ], [ 117.036867687390114, 36.628274631612456 ], [ 117.035672687313706, 36.629468635491598 ], [ 117.034728687307549, 36.630088637359044 ], [ 117.031895687464029, 36.630088637359044 ], [ 117.031981686779432, 36.631328641268468 ], [ 117.031305687460062, 36.631918643698313 ], [ 117.030561687470353, 36.632035643920709 ], [ 117.028437687456531, 36.632637645719612 ], [ 117.026315687092307, 36.63373864995539 ], [ 117.026118687448772, 36.633014647409034 ], [ 117.024524687164302, 36.633999650475523 ], [ 117.022423686716465, 36.634866653306474 ], [ 117.022314686936497, 36.634903653452973 ], [ 117.020942687308107, 36.635401655040674 ], [ 117.019517687078107, 36.635849656853921 ], [ 117.018144686726387, 36.636177657829812 ], [ 117.017393687064114, 36.636349658434064 ], [ 117.01718368700179, 36.636377658864923 ], [ 117.017172687131094, 36.636381658822621 ], [ 117.017164686735185, 36.636384658970933 ], [ 117.016784686793628, 36.636509658802218 ], [ 117.016653687272353, 36.636590659028656 ], [ 117.015987687100548, 36.636659659341227 ], [ 117.015869687099666, 36.636073657864998 ], [ 117.015784686710887, 36.635651656248321 ], [ 117.015712686740898, 36.635598655748602 ], [ 117.015128687483056, 36.635144654245451 ], [ 117.014854686948354, 36.634755653481051 ], [ 117.01459668720554, 36.634410652145732 ], [ 117.014732686749696, 36.63388365019334 ], [ 117.01337468736503, 36.633908650554766 ], [ 117.012536686765714, 36.633601648927979 ], [ 117.011781686905394, 36.633323648188927 ], [ 117.010279687580564, 36.63325564834291 ], [ 117.007307686921564, 36.633280648187238 ], [ 117.007082686790682, 36.633756650019677 ], [ 117.006824687047867, 36.634304651565238 ], [ 117.00772568739643, 36.63489065352038 ], [ 117.007525687379783, 36.635630656449088 ], [ 117.007796687541472, 36.63588865688051 ], [ 117.008113686835586, 36.636123657879523 ], [ 117.008316687225232, 36.636274658259723 ], [ 117.008573687143112, 36.637850663678961 ], [ 117.008658687531891, 36.638146664423139 ], [ 117.008396686692819, 36.638877666921317 ], [ 117.008627687569827, 36.639583669737881 ], [ 117.008243687430308, 36.64035367222499 ], [ 117.008587687386836, 36.641029674099912 ], [ 117.007764686856092, 36.641995677739388 ], [ 117.007122686973673, 36.642812680721811 ], [ 117.007145687438225, 36.642916680959658 ], [ 117.007230686928693, 36.643092681264122 ], [ 117.007547687121189, 36.643704683189256 ], [ 117.007713686802489, 36.644262685285611 ], [ 117.007773687077005, 36.644580686570734 ], [ 117.007797687366406, 36.645016687653886 ], [ 117.007793687168373, 36.645245688591388 ], [ 117.007791687518591, 36.645405689223239 ], [ 117.007762687206309, 36.647153694781586 ], [ 117.007797687366406, 36.648343699386665 ], [ 117.007818687282793, 36.648317699010143 ], [ 117.008891687160371, 36.648438699606885 ], [ 117.008852686802314, 36.649823704187334 ], [ 117.008851686977465, 36.650581706829144 ], [ 117.008852686802314, 36.650839707636969 ], [ 117.008842686756637, 36.651803710822691 ], [ 117.008702687014519, 36.653456716342532 ], [ 117.008552687226725, 36.654317718934777 ], [ 117.008764686938832, 36.654465719518832 ], [ 117.00871368688523, 36.654747720798674 ], [ 117.008659687356911, 36.65482572115436 ], [ 117.00865468733403, 36.655398722591855 ], [ 117.00867168705237, 36.655928724478059 ], [ 117.008658687531891, 36.6559977247639 ], [ 117.008722687105973, 36.656376726536621 ], [ 117.008515687416846, 36.656354726351566 ], [ 117.008612687501085, 36.657477730189044 ], [ 117.008102686964875, 36.657477730189044 ], [ 117.007979686941283, 36.657681730980684 ], [ 117.00778668749571, 36.65774973088417 ], [ 117.007771687427052, 36.657980731930728 ], [ 117.007770686703907, 36.658064731942829 ], [ 117.007866686963297, 36.658343732998418 ], [ 117.008741687372577, 36.658425732847732 ], [ 117.00872068745619, 36.658993735136221 ], [ 117.00889468753347, 36.658905734467339 ], [ 117.009398687323724, 36.659351736034125 ], [ 117.009432686760505, 36.659381736492776 ], [ 117.009414687217145, 36.659398736098943 ], [ 117.008917687099725, 36.660048738697 ], [ 117.008831686886012, 36.660203739176829 ], [ 117.00881568699252, 36.660354739911412 ], [ 117.008740687547728, 36.660422739615683 ], [ 117.008799687098929, 36.660620740680471 ], [ 117.008987687419932, 36.660939741645045 ], [ 117.009164686971928, 36.661197742334657 ], [ 117.009281687147777, 36.661470743781884 ], [ 117.009302687064164, 36.661591743886667 ], [ 117.009345686721772, 36.661711744320876 ], [ 117.009452686851873, 36.661866745055171 ], [ 117.009603687363068, 36.662159745874156 ], [ 117.009624687279455, 36.662572746831586 ], [ 117.009581686723365, 36.663019748954547 ], [ 117.009581686723365, 36.663363749513877 ], [ 117.009667686937249, 36.663777751391187 ], [ 117.009699686724247, 36.663829751062245 ], [ 117.009753687150862, 36.663914751349765 ], [ 117.009867686953712, 36.66439575349677 ], [ 117.00984568721239, 36.664390753386485 ], [ 117.009423687437973, 36.664314752968082 ], [ 117.009148687078422, 36.664275752923466 ], [ 117.009139686857594, 36.664266752854864 ], [ 117.009170686819743, 36.663844751501358 ], [ 117.009166687520093, 36.663836751555763 ], [ 117.00877368715966, 36.663853751619165 ], [ 117.008837686733841, 36.664232752906678 ], [ 117.008515687416846, 36.66417175270756 ], [ 117.008537687158082, 36.663810751366654 ], [ 117.008511687218814, 36.663810751366654 ], [ 117.008077686850626, 36.663806751392165 ], [ 117.007979686941283, 36.663801751243696 ], [ 117.008000686857585, 36.664628754381845 ], [ 117.008004687055617, 36.664646754433249 ], [ 117.007618687266245, 36.664788754370925 ], [ 117.008092686919198, 36.666469760253591 ], [ 117.007438687341235, 36.66664176094195 ], [ 117.007481686998943, 36.667567764007558 ], [ 117.009018687381996, 36.667444763677189 ], [ 117.010077687016022, 36.667360763092482 ], [ 117.01014468696313, 36.66996477244809 ], [ 117.010032686810234, 36.67159077730205 ], [ 117.00995368716741, 36.672735781327688 ], [ 117.01014568678815, 36.674438787326046 ], [ 117.010308686994634, 36.674876788706989 ], [ 117.010592687575112, 36.675066789112975 ], [ 117.011775687057579, 36.676918796037327 ], [ 117.011993687515798, 36.677059796383659 ], [ 117.012604687436138, 36.677454797419003 ], [ 117.014792687024226, 36.677660797843721 ], [ 117.016577687104416, 36.678034799632286 ], [ 117.017448687315749, 36.678126799993926 ], [ 117.018175686688636, 36.6782027997398 ], [ 117.021378687326234, 36.678391800592991 ], [ 117.023158687383727, 36.678388800640256 ], [ 117.025077687358291, 36.678385800687352 ], [ 117.026074687067933, 36.678384800703078 ], [ 117.026238687099436, 36.678469800763935 ], [ 117.026198686916544, 36.678803802356803 ], [ 117.026123687471667, 36.679079803234337 ], [ 117.026045686755552, 36.680186806811228 ], [ 117.025839686891274, 36.681795812070568 ], [ 117.028527686969795, 36.682290813905205 ], [ 117.028897686865676, 36.682363814061965 ], [ 117.02955268716687, 36.682531814800974 ], [ 117.031760686846411, 36.6830968166311 ], [ 117.032068686817979, 36.683165817054785 ], [ 117.032298686971842, 36.682193813806762 ], [ 117.032883686952829, 36.682167813336271 ], [ 117.034115686839115, 36.680876809152004 ], [ 117.034249686733403, 36.680338807200663 ], [ 117.034341686794932, 36.679913805476183 ], [ 117.034378687503207, 36.679648805077044 ], [ 117.034389687373817, 36.679386803678959 ], [ 117.034381686977923, 36.678733801642601 ], [ 117.035670686765627, 36.678734801622348 ], [ 117.035419686695391, 36.678525801244362 ], [ 117.035441687335009, 36.678443800475613 ], [ 117.035634686780583, 36.678512800750525 ], [ 117.035830687497494, 36.678631801476065 ], [ 117.035915686988048, 36.678666801527193 ], [ 117.035899687094371, 36.678694801700836 ], [ 117.035935687079402, 36.678727801763607 ], [ 117.036046687407534, 36.678739801521061 ], [ 117.036784687549513, 36.678745802119479 ], [ 117.037713687487027, 36.678771801585349 ], [ 117.038175687444422, 36.678775802222859 ], [ 117.037955687336336, 36.679236803516176 ], [ 117.037412687188109, 36.680680808239437 ], [ 117.037321686951614, 36.680828808562993 ], [ 117.038192687162763, 36.680912808853627 ], [ 117.038600686693457, 36.681050809955373 ], [ 117.038632687378765, 36.681360811015836 ], [ 117.039056686803136, 36.681407810607347 ], [ 117.039031686688716, 36.681736811987264 ], [ 117.038929687479808, 36.681792812250535 ], [ 117.03885468713672, 36.682015812959008 ], [ 117.038784686816513, 36.682403814236871 ], [ 117.038784686816513, 36.682451814563521 ], [ 117.038795686687209, 36.682830815744623 ], [ 117.039235686903211, 36.682808815917156 ], [ 117.039283687482097, 36.683002816601736 ], [ 117.039232687428495, 36.683002816601736 ], [ 117.039033687236881, 36.68335581716012 ], [ 117.039143686841683, 36.683896819359695 ], [ 117.039540687399978, 36.683788818630624 ], [ 117.039465687056975, 36.683233816774774 ], [ 117.040158686993081, 36.683257817043035 ], [ 117.039615686844769, 36.685015822989449 ], [ 117.040780686784046, 36.685215823963986 ], [ 117.04097468695268, 36.684754822484244 ], [ 117.041381687556921, 36.684814822314415 ], [ 117.041505687405447, 36.684294820309937 ], [ 117.042216686884828, 36.685007823083737 ], [ 117.042135686693911, 36.685089823338586 ], [ 117.041637686751571, 36.684929823058809 ], [ 117.04146568722237, 36.685359823911419 ], [ 117.04217368722712, 36.685592824711051 ], [ 117.042345686756235, 36.685187824002973 ], [ 117.043205687096858, 36.686279827176726 ], [ 117.042035687134799, 36.686025826554413 ], [ 117.041510687428328, 36.686841829225088 ], [ 117.04444268700604, 36.687695832458729 ], [ 117.045898687198275, 36.688138833283467 ], [ 117.045968687518481, 36.688005833390058 ], [ 117.045974687366211, 36.68800483353084 ], [ 117.046129687176972, 36.688035833483575 ], [ 117.046258687048379, 36.687824832721645 ], [ 117.0465276875602, 36.687879833013525 ], [ 117.046623686921279, 36.68777683214649 ], [ 117.046864686945838, 36.687502831231377 ], [ 117.046870686793483, 36.687496831316054 ], [ 117.046811687242283, 36.687445830936667 ], [ 117.046784687478166, 36.687419831521247 ], [ 117.046747686769891, 36.687380830940974 ], [ 117.046698687264367, 36.687334830545034 ], [ 117.046973686725707, 36.68694882939586 ], [ 117.047442687254076, 36.685812825544694 ], [ 117.047450686751674, 36.685798825674006 ], [ 117.047455686774555, 36.685782825304358 ], [ 117.047555687231991, 36.685475824453391 ], [ 117.047586687194141, 36.685379823942739 ], [ 117.047708687392884, 36.685004822668617 ], [ 117.047727686761093, 36.684945822885695 ], [ 117.047792687058504, 36.684744822027689 ], [ 117.048091686809244, 36.684072819635645 ], [ 117.048448687184631, 36.683270817455423 ], [ 117.049074687173459, 36.681861812403149 ], [ 117.049071686800531, 36.681844811995397 ], [ 117.049086686869103, 36.681830812123025 ], [ 117.049103687485655, 36.681788812490367 ], [ 117.049155687364276, 36.681664811897463 ], [ 117.049750687391125, 36.680222806835793 ], [ 117.050084687301876, 36.679078803259031 ], [ 117.050086686951659, 36.679066802834114 ], [ 117.050091686974639, 36.679051803200935 ], [ 117.050098687545599, 36.679029803013037 ], [ 117.050142687028327, 36.678877802198436 ], [ 117.050142687028327, 36.67517678989195 ], [ 117.050146687226189, 36.675160789473978 ], [ 117.050142687028327, 36.675150789931628 ], [ 117.050142687028327, 36.674743788215658 ], [ 117.050140687378374, 36.674730788523753 ], [ 117.050133686807399, 36.674727788428292 ], [ 117.050142687028327, 36.674708788541118 ], [ 117.050032687423439, 36.674175786157292 ], [ 117.04922268731147, 36.674132785908149 ], [ 117.049163686861974, 36.674321786673325 ], [ 117.048938686731091, 36.674295787144573 ], [ 117.048788686943212, 36.675595791005932 ], [ 117.048774686699488, 36.675591790923619 ], [ 117.048290687000772, 36.675569791187186 ], [ 117.048283687328194, 36.675569791187186 ], [ 117.048460686880091, 36.674610788215041 ], [ 117.04845668758054, 36.674601787914092 ], [ 117.047929687325905, 36.674511787729365 ], [ 117.048102687578165, 36.673367783523602 ], [ 117.048271686734338, 36.673231783151927 ], [ 117.048260686863642, 36.672869781743522 ], [ 117.048764687552108, 36.672878782247061 ], [ 117.048768686851673, 36.672871781855505 ], [ 117.048780687445614, 36.672745781904503 ], [ 117.048790687491291, 36.672746781241557 ], [ 117.049342686962135, 36.672765781613144 ], [ 117.050062687560569, 36.672826781484964 ], [ 117.050088687499922, 36.67216377931571 ], [ 117.050093687522804, 36.671974779013723 ], [ 117.050104687393414, 36.671707777784512 ], [ 117.050105687218263, 36.671697777793277 ], [ 117.050089687324771, 36.671677777807076 ], [ 117.050104687393414, 36.671526777671033 ], [ 117.050169686792444, 36.670844774987465 ], [ 117.050899687436726, 36.670806774731986 ], [ 117.050931687223809, 36.670522773745347 ], [ 117.050936687246605, 36.670526774091272 ], [ 117.051629687182711, 36.670466773924389 ], [ 117.051634687205592, 36.670466773924389 ], [ 117.051988687207881, 36.670289773411568 ], [ 117.051988687207881, 36.670281773415432 ], [ 117.05200068690344, 36.670226772788894 ], [ 117.052111687231474, 36.669738771101919 ], [ 117.052321687293798, 36.669738771101919 ], [ 117.0523246867685, 36.669744771681778 ], [ 117.052562687318172, 36.669628771194873 ], [ 117.052573687188882, 36.669622771326445 ], [ 117.05256468696804, 36.669467770359716 ], [ 117.055487687223305, 36.669480770220375 ], [ 117.055503687116797, 36.669480770220375 ], [ 117.056078687052107, 36.6694687704599 ], [ 117.056592686887967, 36.669471770760438 ], [ 117.05659568726098, 36.669482770420466 ], [ 117.056613686804255, 36.669786771405121 ], [ 117.057940687125168, 36.669742771488608 ], [ 117.057951686995793, 36.669742771488608 ], [ 117.057956687018674, 36.669415770174673 ], [ 117.057960687216706, 36.669407770087588 ], [ 117.058208686913844, 36.669389770429206 ], [ 117.058101686783672, 36.669067768862995 ], [ 117.058110687004586, 36.669064769267223 ], [ 117.059033687094285, 36.66880176846395 ], [ 117.059088687346019, 36.668787768379481 ], [ 117.059095687018583, 36.669044769317168 ], [ 117.059090686995788, 36.669111769165504 ], [ 117.06004568687257, 36.669107769466535 ], [ 117.06005268744363, 36.669102768941826 ], [ 117.060201687406575, 36.669163769555986 ], [ 117.060208687079239, 36.669167769252027 ], [ 117.060841686740815, 36.669175769363981 ], [ 117.061865687113041, 36.66918876927393 ], [ 117.061876686983567, 36.669352770277463 ], [ 117.062890687310031, 36.669360770370226 ], [ 117.062906687203522, 36.669029769171068 ], [ 117.062922687097114, 36.668341766725476 ], [ 117.06292768711991, 36.668336766871519 ], [ 117.063802687529105, 36.668195766391428 ], [ 117.063953687141918, 36.668171765747381 ], [ 117.064551687541694, 36.668074765860325 ], [ 117.064908687018786, 36.668016765460727 ], [ 117.064680687413102, 36.666495760265072 ], [ 117.065190687051086, 36.666482760620688 ], [ 117.065197686723849, 36.666480760342608 ], [ 117.06535868728055, 36.667147762279761 ], [ 117.065546686703158, 36.667935765140413 ], [ 117.067470686700702, 36.667695764757823 ], [ 117.06770768742544, 36.667514763854136 ], [ 117.068022687069671, 36.667273762750526 ], [ 117.068028686917486, 36.667269762956074 ], [ 117.068081687519182, 36.666056759310194 ], [ 117.069138687503425, 36.666051758587336 ], [ 117.069143687526307, 36.666051758587336 ], [ 117.069331686948914, 36.666413760365486 ], [ 117.069337686796743, 36.666421760043207 ], [ 117.069503687376425, 36.666680761228861 ], [ 117.069586687217026, 36.666817761784564 ], [ 117.069594686714709, 36.667273762750526 ], [ 117.069653687164205, 36.667514763854136 ], [ 117.069659687012035, 36.667522764137949 ], [ 117.06991168690702, 36.667871765351656 ], [ 117.069916686929915, 36.667884765481958 ], [ 117.070217687228819, 36.668181766196824 ], [ 117.070225686726417, 36.668181766196824 ], [ 117.07119868704487, 36.668241765983652 ], [ 117.072149686723776, 36.668299766213515 ], [ 117.072771687413137, 36.66874676822075 ], [ 117.072721687184384, 36.670193772682332 ], [ 117.072716687161488, 36.670201772687612 ], [ 117.072708686765509, 36.670317773031343 ], [ 117.072683687549471, 36.670658774581987 ], [ 117.072667686757669, 36.670916775116609 ], [ 117.072673687503794, 36.670920775442013 ], [ 117.073776687518674, 36.671564777570886 ], [ 117.073068687514009, 36.672506780732846 ], [ 117.072785686758465, 36.67267278126652 ], [ 117.072784686933531, 36.672683781189541 ], [ 117.072784686933531, 36.672859781903362 ], [ 117.073460687151197, 36.673190783199423 ], [ 117.073932687154283, 36.673397783562677 ], [ 117.074495687393863, 36.673410783479817 ], [ 117.074500687416844, 36.673410783479817 ], [ 117.074554686945248, 36.671852778591337 ], [ 117.076576686851865, 36.672772782014292 ], [ 117.077760687057562, 36.673315783812484 ], [ 117.077778687499318, 36.673319783292698 ], [ 117.079090686853277, 36.673948785609241 ], [ 117.0790986872491, 36.673952785777082 ], [ 117.079101686723902, 36.676640794597233 ], [ 117.079107687469929, 36.677875799076716 ], [ 117.079111686769579, 36.678742802180516 ], [ 117.07911268749281, 36.678748802058266 ], [ 117.079924687254461, 36.680257806883539 ], [ 117.081389686769413, 36.680302807230369 ], [ 117.081400687538419, 36.680302807230369 ], [ 117.083728686868525, 36.680405807300616 ], [ 117.083728686868525, 36.680396807677617 ], [ 117.083673687515187, 36.679805805638487 ], [ 117.084425687002494, 36.679127803473854 ], [ 117.084433687398388, 36.6791318033724 ], [ 117.085927687225535, 36.679127803473854 ], [ 117.085940686746014, 36.679118802980966 ], [ 117.08638968718293, 36.678895802519136 ], [ 117.086396686855593, 36.678894802541436 ], [ 117.087158687286973, 36.678864802484512 ], [ 117.087121687477008, 36.679088803011346 ], [ 117.087180687028294, 36.6793128036064 ], [ 117.087161686761689, 36.680367807444647 ], [ 117.087148687241211, 36.68110280948148 ], [ 117.087149687066145, 36.682397813923828 ], [ 117.085202687502431, 36.682479814800139 ], [ 117.083757687180906, 36.682538815033993 ], [ 117.083758687005655, 36.682550814917214 ], [ 117.0836876868606, 36.684688821752516 ], [ 117.083683687561049, 36.684694821886865 ], [ 117.082368686935681, 36.684680821812783 ], [ 117.082363686912799, 36.684680821812783 ], [ 117.082319687430342, 36.68516182382416 ], [ 117.082325687277972, 36.685162823720326 ], [ 117.083107686902494, 36.685286823716645 ], [ 117.083151687283433, 36.685179823394705 ], [ 117.083150687458499, 36.685174823914679 ], [ 117.083966687418197, 36.685152823316891 ], [ 117.08399868720528, 36.685158823414994 ], [ 117.08465168695831, 36.685145823321903 ], [ 117.0846946875144, 36.685670825504253 ], [ 117.083972687266012, 36.685688825676095 ], [ 117.083967687243216, 36.685688825676095 ], [ 117.084627687567206, 36.686321827238551 ], [ 117.085008687333698, 36.686638828525815 ], [ 117.085018687379389, 36.686643828631126 ], [ 117.085013687356494, 36.687207830640219 ], [ 117.085040687120795, 36.687387830732561 ], [ 117.085185686885694, 36.688129833845025 ], [ 117.084633687415035, 36.688198834075358 ], [ 117.084627687567206, 36.68820183364555 ], [ 117.084729686776114, 36.688462834698676 ], [ 117.084649687308527, 36.688750835851202 ], [ 117.084601686729641, 36.688986836721867 ], [ 117.084563687094729, 36.689267837732686 ], [ 117.084901687203612, 36.689306837356035 ], [ 117.084907687051427, 36.689305837513693 ], [ 117.084886687134869, 36.689421837866576 ], [ 117.084793687248592, 36.690535841932899 ], [ 117.084778687179934, 36.690712842687041 ], [ 117.084773687157139, 36.690711842142683 ], [ 117.083330687383508, 36.690579842203171 ], [ 117.083271686934012, 36.691852846144812 ], [ 117.084490687299905, 36.692006846864096 ], [ 117.084300687329034, 36.693265850999175 ], [ 117.085572687398312, 36.692822849457684 ], [ 117.086098686929802, 36.692706849193264 ], [ 117.086291687273686, 36.692663849218484 ], [ 117.086541687518903, 36.69260584862802 ], [ 117.086734686964391, 36.692558848676448 ], [ 117.087367687524264, 36.69252384846385 ], [ 117.087748687290755, 36.692493848680662 ], [ 117.087918687170088, 36.692482847988835 ], [ 117.087997686812827, 36.692581848395818 ], [ 117.08798168691942, 36.693463851830195 ], [ 117.088303687134626, 36.693493851955338 ], [ 117.089714687120988, 36.69387285274378 ], [ 117.089788686740931, 36.693555851744641 ], [ 117.09071968722661, 36.693608851966275 ], [ 117.090671687546021, 36.694314854220622 ], [ 117.091122686734508, 36.694579855228781 ], [ 117.091214686795851, 36.694097854000518 ], [ 117.092222687274585, 36.694205853937596 ], [ 117.092340687275282, 36.693349851392128 ], [ 117.092612687261905, 36.693355851571063 ], [ 117.092619686934569, 36.693362851539135 ], [ 117.092944687522888, 36.693381851140494 ], [ 117.092955687393584, 36.693385851017986 ], [ 117.093459687183753, 36.693355851571063 ], [ 117.093468687404496, 36.693351850971744 ], [ 117.093460687008687, 36.693871852960768 ], [ 117.093795686744372, 36.693953853127958 ], [ 117.093802687315517, 36.693956853193932 ], [ 117.093966687346935, 36.694091853879492 ], [ 117.09418168743197, 36.694220854217107 ], [ 117.094192687302751, 36.694220854217107 ], [ 117.094521687190706, 36.694185854040747 ], [ 117.094496687076372, 36.694682855627036 ], [ 117.094432687502291, 36.696213860751399 ], [ 117.094501687099168, 36.697454864848041 ], [ 117.094517686992674, 36.697840866558195 ], [ 117.094829687162289, 36.699947873787238 ], [ 117.095111687194589, 36.702293881710098 ], [ 117.095134686760844, 36.702482882417449 ], [ 117.094699687466033, 36.704774889979774 ], [ 117.094430686954126, 36.706314895234115 ], [ 117.095841686940574, 36.706672896324129 ], [ 117.098240687314131, 36.707331898587022 ], [ 117.099377686765877, 36.70767589977234 ], [ 117.102245686769493, 36.708367902382662 ], [ 117.103919687420031, 36.709218904696968 ], [ 117.107100687418111, 36.709799906730566 ], [ 117.107107687090775, 36.709505905573721 ]
]
二、数据处理:
将xy坐标值放在一个excel表中,放在resource目录下。如图所示:
三、写程序
python版本:python3.11
1、引入:xlrd、xlsxwriter、shapely
import xlrd as xlrd
import math
import xlsxwriter as xlsxwriter
from shapely.geometry import Point
from shapely.geometry.polygon import Polygon
2、定义点函数:
# 定义点函数
class Point1:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
# 定义横纵坐标的get方法
def getX(self):
return self.x
def getY(self):
return self.y
def __str__(self):
return '(%s,%s)' %(self.x,self.y)
3、获取excel表中的数据个数
def getData():
# 声明全局变量 abscissa --横坐标 ordinate --纵坐标
global abscissa
global ordinate
worksheet = xlrd.open_workbook("./resource/data.xls")
sheet_names = worksheet.sheet_names()
for sheet_name in sheet_names:
sheet1 = worksheet.sheet_by_name(sheet_name)
# 横坐标
abscissa = sheet1.col_values(0)
# 纵坐标
ordinate = sheet1.col_values(1)
# 移除表头 第二列,第三列的列头
del abscissa[0]
del ordinate[0]
# 打印第二列第三列数据
#print(abscissa,ordinate)
#打印点数据的数量
print(len(abscissa))
4、将判断结果写入表中,这里将建立一个新表
def createWrite():
workbook = xlsxwriter.Workbook('./resource/dataResult.xlsx') # 创建一个Excel文件,也放入到resource目录下
worksheet = workbook.add_worksheet()
title = [U'X坐标', U'Y坐标',U'是否在面内'] # 表格title
worksheet.write_row('A1', title)
polygon_data= [放入面状数据的坐标串]
num0 = 1
for i in range(0,len(abscissa)):
data = ([abscissa[i],ordinate[i]])
point5 = Point(data)
polygon = Polygon(polygon_data)
a = str ((polygon.contains(point5)))
data1 = ([abscissa[i],ordinate[i],a])
num = num0 + 1
row = 'A' + str(num)
worksheet.write_row(row, data1)
num0=num
workbook.close()
5、执行结果:打开dataResult表
``