1

嗨有下面的多边形数据(基本上是500米),比如

Location_N,latitude,longitude,geometry
Dohrighat (NP),26.262341,83.512787,"POLYGON ((83.51780100000001 26.262341, 83.517791 26.262059, 83.51776200000001 26.261777, 83.517712 26.261498, 83.517644 26.261223, 83.517556 26.260951, 83.517449 26.260686, 83.517324 26.260426, 83.51718099999999 26.260175, 83.517021 26.259932, 83.51684400000001 26.259698, 83.51665 26.259475, 83.516442 26.259263, 83.51621900000001 26.259063, 83.51598300000001 26.258876, 83.515734 26.258703, 83.515474 26.258544, 83.515203 26.258401, 83.514922 26.258272, 83.514633 26.25816, 83.514336 26.258064, 83.514034 26.257986, 83.513727 26.257924, 83.513415 26.25788, 83.513102 26.257853, 83.512787 26.257844, 83.512472 26.257853, 83.512159 26.25788, 83.511847 26.257924, 83.51154 26.257986, 83.51123800000001 26.258064, 83.510941 26.25816, 83.51065199999999 26.258272, 83.51037100000001 26.258401, 83.51009999999999 26.258544, 83.50984 26.258703, 83.509591 26.258876, 83.509355 26.259063, 83.50913199999999 26.259263, 83.50892399999999 26.259475, 83.50873 26.259698, 83.50855300000001 26.259932, 83.508393 26.260175, 83.50825 26.260426, 83.50812500000001 26.260686, 83.50801800000001 26.260951, 83.50793 26.261223, 83.507862 26.261498, 83.507812 26.261777, 83.507783 26.262059, 83.507773 26.262341, 83.507783 26.262623, 83.507812 26.262905, 83.507862 26.263184, 83.50793 26.263459, 83.50801800000001 26.263731, 83.50812500000001 26.263996, 83.50825 26.264256, 83.508393 26.264507, 83.50855300000001 26.26475, 83.50873 26.264984, 83.50892399999999 26.265207, 83.50913199999999 26.265419, 83.509355 26.265619, 83.509591 26.265806, 83.50984 26.265979, 83.51009999999999 26.266138, 83.51037100000001 26.266281, 83.51065199999999 26.26641, 83.510941 26.266522, 83.51123800000001 26.266618, 83.51154 26.266696, 83.511847 26.266758, 83.512159 26.266802, 83.512472 26.266829, 83.512787 26.266838, 83.513102 26.266829, 83.513415 26.266802, 83.513727 26.266758, 83.514034 26.266696, 83.514336 26.266618, 83.514633 26.266522, 83.514922 26.26641, 83.515203 26.266281, 83.515474 26.266138, 83.515734 26.265979, 83.51598300000001 26.265806, 83.51621900000001 26.265619, 83.516442 26.265419, 83.51665 26.265207, 83.51684400000001 26.264984, 83.517021 26.26475, 83.51718099999999 26.264507, 83.517324 26.264256, 83.517449 26.263996, 83.517556 26.263731, 83.517644 26.263459, 83.517712 26.263184, 83.51776200000001 26.262905, 83.517791 26.262623, 83.51780100000001 26.262341))"
Narpatpur,25.359165,82.649686,"POLYGON ((82.654662 25.359165, 82.654652 25.358883, 82.654623 25.358601, 82.654574 25.358322, 82.654506 25.358047, 82.654419 25.357775, 82.654313 25.35751, 82.654189 25.35725, 82.65404700000001 25.356999, 82.653887 25.356756, 82.653712 25.356522, 82.65352 25.356299, 82.653313 25.356087, 82.653092 25.355887, 82.652858 25.3557, 82.65261099999999 25.355527, 82.65235199999999 25.355368, 82.65208300000001 25.355225, 82.651805 25.355096, 82.651518 25.354984, 82.651224 25.354888, 82.650924 25.35481, 82.65061799999999 25.354748, 82.65031000000001 25.354704, 82.649998 25.354677, 82.649686 25.354668, 82.649374 25.354677, 82.649062 25.354704, 82.648754 25.354748, 82.648448 25.35481, 82.64814800000001 25.354888, 82.647854 25.354984, 82.647567 25.355096, 82.647289 25.355225, 82.64702 25.355368, 82.646761 25.355527, 82.646514 25.3557, 82.64628 25.355887, 82.64605899999999 25.356087, 82.64585200000001 25.356299, 82.64566000000001 25.356522, 82.64548499999999 25.356756, 82.645325 25.356999, 82.645183 25.35725, 82.645059 25.35751, 82.644953 25.357775, 82.64486599999999 25.358047, 82.64479799999999 25.358322, 82.644749 25.358601, 82.64472000000001 25.358883, 82.64471 25.359165, 82.64472000000001 25.359447, 82.644749 25.359729, 82.64479799999999 25.360008, 82.64486599999999 25.360283, 82.644953 25.360555, 82.645059 25.36082, 82.645183 25.36108, 82.645325 25.361331, 82.64548499999999 25.361574, 82.64566000000001 25.361808, 82.64585200000001 25.362031, 82.64605899999999 25.362243, 82.64628 25.362443, 82.646514 25.36263, 82.646761 25.362803, 82.64702 25.362962, 82.647289 25.363105, 82.647567 25.363234, 82.647854 25.363346, 82.64814800000001 25.363442, 82.648448 25.36352, 82.648754 25.363582, 82.649062 25.363626, 82.649374 25.363653, 82.649686 25.363662, 82.649998 25.363653, 82.65031000000001 25.363626, 82.65061799999999 25.363582, 82.650924 25.36352, 82.651224 25.363442, 82.651518 25.363346, 82.651805 25.363234, 82.65208300000001 25.363105, 82.65235199999999 25.362962, 82.65261099999999 25.362803, 82.652858 25.36263, 82.653092 25.362443, 82.653313 25.362243, 82.65352 25.362031, 82.653712 25.361808, 82.653887 25.361574, 82.65404700000001 25.361331, 82.654189 25.36108, 82.654313 25.36082, 82.654419 25.360555, 82.654506 25.360283, 82.654574 25.360008, 82.654623 25.359729, 82.654652 25.359447, 82.654662 25.359165))"
Jogiya Urph Mehdital,25.587608,83.202552,"POLYGON ((83.207538 25.587608, 83.207528 25.587326, 83.207498 25.587044, 83.207449 25.586765, 83.207381 25.58649, 83.20729400000001 25.586218, 83.20718700000001 25.585953, 83.20706300000001 25.585693, 83.20692099999999 25.585442, 83.206761 25.585199, 83.206585 25.584965, 83.20639300000001 25.584742, 83.206186 25.58453, 83.20596500000001 25.58433, 83.20573 25.584143, 83.205482 25.58397, 83.205223 25.583811, 83.204954 25.583668, 83.204675 25.583539, 83.204387 25.583427, 83.204093 25.583331, 83.20379200000001 25.583253, 83.203486 25.583191, 83.203177 25.583147, 83.202865 25.58312, 83.202552 25.583111, 83.20223900000001 25.58312, 83.201927 25.583147, 83.201618 25.583191, 83.201312 25.583253, 83.20101099999999 25.583331, 83.200717 25.583427, 83.200429 25.583539, 83.20014999999999 25.583668, 83.19988100000001 25.583811, 83.19962200000001 25.58397, 83.19937400000001 25.584143, 83.199139 25.58433, 83.19891800000001 25.58453, 83.198711 25.584742, 83.19851900000001 25.584965, 83.19834299999999 25.585199, 83.198183 25.585442, 83.198041 25.585693, 83.197917 25.585953, 83.19781 25.586218, 83.197723 25.58649, 83.197655 25.586765, 83.19760599999999 25.587044, 83.197576 25.587326, 83.197566 25.587608, 83.197576 25.58789, 83.19760599999999 25.588172, 83.197655 25.588451, 83.197723 25.588726, 83.19781 25.588998, 83.197917 25.589263, 83.198041 25.589523, 83.198183 25.589774, 83.19834299999999 25.590017, 83.19851900000001 25.590251, 83.198711 25.590474, 83.19891800000001 25.590686, 83.199139 25.590886, 83.19937400000001 25.591073, 83.19962200000001 25.591246, 83.19988100000001 25.591405, 83.20014999999999 25.591548, 83.200429 25.591677, 83.200717 25.591789, 83.20101099999999 25.591885, 83.201312 25.591963, 83.201618 25.592025, 83.201927 25.592069, 83.20223900000001 25.592096, 83.202552 25.592105, 83.202865 25.592096, 83.203177 25.592069, 83.203486 25.592025, 83.20379200000001 25.591963, 83.204093 25.591885, 83.204387 25.591789, 83.204675 25.591677, 83.204954 25.591548, 83.205223 25.591405, 83.205482 25.591246, 83.20573 25.591073, 83.20596500000001 25.590886, 83.206186 25.590686, 83.20639300000001 25.590474, 83.206585 25.590251, 83.206761 25.590017, 83.20692099999999 25.589774, 83.20706300000001 25.589523, 83.20718700000001 25.589263, 83.20729400000001 25.588998, 83.207381 25.588726, 83.207449 25.588451, 83.207498 25.588172, 83.207528 25.58789, 83.207538 25.587608))"
Sultanpur Nager,25.877389,83.321791,"POLYGON ((83.32678900000001 25.877389, 83.326779 25.877107, 83.32674900000001 25.876825, 83.3267 25.876546, 83.326632 25.876271, 83.326544 25.875999, 83.326438 25.875734, 83.326313 25.875474, 83.326171 25.875223, 83.32601099999999 25.87498, 83.325834 25.874746, 83.325642 25.874523, 83.325434 25.874311, 83.32521199999999 25.874111, 83.324977 25.873924, 83.32472900000001 25.873751, 83.32446899999999 25.873592, 83.32419899999999 25.873449, 83.323919 25.87332, 83.32363100000001 25.873208, 83.323335 25.873112, 83.32303400000001 25.873034, 83.322727 25.872972, 83.322417 25.872928, 83.32210499999999 25.872901, 83.32179100000001 25.872892, 83.321477 25.872901, 83.32116499999999 25.872928, 83.320855 25.872972, 83.320548 25.873034, 83.320247 25.873112, 83.319951 25.873208, 83.31966300000001 25.87332, 83.319383 25.873449, 83.319113 25.873592, 83.318853 25.873751, 83.31860500000001 25.873924, 83.31837 25.874111, 83.31814799999999 25.874311, 83.31793999999999 25.874523, 83.317748 25.874746, 83.317571 25.87498, 83.31741100000001 25.875223, 83.317269 25.875474, 83.317144 25.875734, 83.317038 25.875999, 83.31695000000001 25.876271, 83.31688200000001 25.876546, 83.316833 25.876825, 83.31680299999999 25.877107, 83.316793 25.877389, 83.31680299999999 25.877671, 83.316833 25.877953, 83.31688200000001 25.878232, 83.31695000000001 25.878507, 83.317038 25.878779, 83.317144 25.879044, 83.317269 25.879304, 83.31741100000001 25.879555, 83.317571 25.879798, 83.317748 25.880032, 83.31793999999999 25.880255, 83.31814799999999 25.880467, 83.31837 25.880667, 83.31860500000001 25.880854, 83.318853 25.881027, 83.319113 25.881186, 83.319383 25.881329, 83.31966300000001 25.881458, 83.319951 25.88157, 83.320247 25.881666, 83.320548 25.881744, 83.320855 25.881806, 83.32116499999999 25.88185, 83.321477 25.881877, 83.32179100000001 25.881886, 83.32210499999999 25.881877, 83.322417 25.88185, 83.322727 25.881806, 83.32303400000001 25.881744, 83.323335 25.881666, 83.32363100000001 25.88157, 83.323919 25.881458, 83.32419899999999 25.881329, 83.32446899999999 25.881186, 83.32472900000001 25.881027, 83.324977 25.880854, 83.32521199999999 25.880667, 83.325434 25.880467, 83.325642 25.880255, 83.325834 25.880032, 83.32601099999999 25.879798, 83.326171 25.879555, 83.326313 25.879304, 83.326438 25.879044, 83.326544 25.878779, 83.326632 25.878507, 83.3267 25.878232, 83.32674900000001 25.877953, 83.326779 25.877671, 83.32678900000001 25.877389))"
Tilakpur,25.76938,83.734733,"POLYGON ((83.73972600000001 25.76938, 83.739716 25.769098, 83.739687 25.768816, 83.739638 25.768537, 83.739569 25.768262, 83.739482 25.76799, 83.73937599999999 25.767725, 83.739251 25.767465, 83.739109 25.767214, 83.73894900000001 25.766971, 83.738773 25.766737, 83.73858 25.766514, 83.738373 25.766302, 83.738151 25.766102, 83.737916 25.765915, 83.737668 25.765742, 83.737408 25.765583, 83.737138 25.76544, 83.736859 25.765311, 83.736571 25.765199, 83.736276 25.765103, 83.735975 25.765025, 83.735669 25.764963, 83.735359 25.764919, 83.73504699999999 25.764892, 83.73473300000001 25.764883, 83.734419 25.764892, 83.734107 25.764919, 83.733797 25.764963, 83.733491 25.765025, 83.73318999999999 25.765103, 83.732895 25.765199, 83.732607 25.765311, 83.732328 25.76544, 83.732058 25.765583, 83.731798 25.765742, 83.73155 25.765915, 83.731315 25.766102, 83.731093 25.766302, 83.730886 25.766514, 83.730693 25.766737, 83.73051700000001 25.766971, 83.730357 25.767214, 83.730215 25.767465, 83.73009 25.767725, 83.729984 25.76799, 83.72989699999999 25.768262, 83.729828 25.768537, 83.72977899999999 25.768816, 83.72975 25.769098, 83.72974000000001 25.76938, 83.72975 25.769662, 83.72977899999999 25.769944, 83.729828 25.770223, 83.72989699999999 25.770498, 83.729984 25.77077, 83.73009 25.771035, 83.730215 25.771295, 83.730357 25.771546, 83.73051700000001 25.771789, 83.730693 25.772023, 83.730886 25.772246, 83.731093 25.772458, 83.731315 25.772658, 83.73155 25.772845, 83.731798 25.773018, 83.732058 25.773177, 83.732328 25.77332, 83.732607 25.773449, 83.732895 25.773561, 83.73318999999999 25.773657, 83.733491 25.773735, 83.733797 25.773797, 83.734107 25.773841, 83.734419 25.773868, 83.73473300000001 25.773877, 83.73504699999999 25.773868, 83.735359 25.773841, 83.735669 25.773797, 83.735975 25.773735, 83.736276 25.773657, 83.736571 25.773561, 83.736859 25.773449, 83.737138 25.77332, 83.737408 25.773177, 83.737668 25.773018, 83.737916 25.772845, 83.738151 25.772658, 83.738373 25.772458, 83.73858 25.772246, 83.738773 25.772023, 83.73894900000001 25.771789, 83.739109 25.771546, 83.739251 25.771295, 83.73937599999999 25.771035, 83.739482 25.77077, 83.739569 25.770498, 83.739638 25.770223, 83.739687 25.769944, 83.739716 25.769662, 83.73972600000001 25.76938))"
Dadra,25.57873,83.156649,"POLYGON ((83.16163400000001 25.57873, 83.161624 25.578448, 83.16159500000001 25.578166, 83.161546 25.577887, 83.161478 25.577612, 83.16139 25.57734, 83.161284 25.577075, 83.16116 25.576815, 83.161018 25.576564, 83.16085800000001 25.576321, 83.16068199999999 25.576087, 83.16049 25.575864, 83.16028300000001 25.575652, 83.160062 25.575452, 83.15982700000001 25.575265, 83.15957899999999 25.575092, 83.15931999999999 25.574933, 83.15905100000001 25.57479, 83.158772 25.574661, 83.158484 25.574549, 83.15819000000001 25.574453, 83.157889 25.574375, 83.157583 25.574313, 83.157274 25.574269, 83.15696199999999 25.574242, 83.156649 25.574233, 83.156336 25.574242, 83.156024 25.574269, 83.155715 25.574313, 83.15540900000001 25.574375, 83.155108 25.574453, 83.154814 25.574549, 83.154526 25.574661, 83.154247 25.57479, 83.153978 25.574933, 83.153719 25.575092, 83.153471 25.575265, 83.15323600000001 25.575452, 83.153015 25.575652, 83.15280799999999 25.575864, 83.152616 25.576087, 83.15244 25.576321, 83.15228000000001 25.576564, 83.15213799999999 25.576815, 83.15201399999999 25.577075, 83.15190800000001 25.57734, 83.15182 25.577612, 83.151752 25.577887, 83.151703 25.578166, 83.151674 25.578448, 83.151664 25.57873, 83.151674 25.579012, 83.151703 25.579294, 83.151752 25.579573, 83.15182 25.579848, 83.15190800000001 25.58012, 83.15201399999999 25.580385, 83.15213799999999 25.580645, 83.15228000000001 25.580896, 83.15244 25.581139, 83.152616 25.581373, 83.15280799999999 25.581596, 83.153015 25.581808, 83.15323600000001 25.582008, 83.153471 25.582195, 83.153719 25.582368, 83.153978 25.582527, 83.154247 25.58267, 83.154526 25.582799, 83.154814 25.582911, 83.155108 25.583007, 83.15540900000001 25.583085, 83.155715 25.583147, 83.156024 25.583191, 83.156336 25.583218, 83.156649 25.583227, 83.15696199999999 25.583218, 83.157274 25.583191, 83.157583 25.583147, 83.157889 25.583085, 83.15819000000001 25.583007, 83.158484 25.582911, 83.158772 25.582799, 83.15905100000001 25.58267, 83.15931999999999 25.582527, 83.15957899999999 25.582368, 83.15982700000001 25.582195, 83.160062 25.582008, 83.16028300000001 25.581808, 83.16049 25.581596, 83.16068199999999 25.581373, 83.16085800000001 25.581139, 83.161018 25.580896, 83.16116 25.580645, 83.161284 25.580385, 83.16139 25.58012, 83.161478 25.579848, 83.161546 25.579573, 83.16159500000001 25.579294, 83.161624 25.579012, 83.16163400000001 25.57873))"
Birbhanpur,25.364732,83.434695,"POLYGON ((83.439671 25.364732, 83.439662 25.36445, 83.439632 25.364168, 83.439583 25.363889, 83.439515 25.363614, 83.43942800000001 25.363342, 83.439322 25.363077, 83.43919800000001 25.362817, 83.43905599999999 25.362566, 83.438897 25.362323, 83.438721 25.362089, 83.438529 25.361866, 83.438323 25.361654, 83.438102 25.361454, 83.437867 25.361267, 83.43762 25.361094, 83.437361 25.360935, 83.43709200000001 25.360792, 83.436814 25.360663, 83.436527 25.360551, 83.436233 25.360455, 83.43593300000001 25.360377, 83.435627 25.360315, 83.43531900000001 25.360271, 83.435007 25.360244, 83.43469500000001 25.360235, 83.434383 25.360244, 83.434071 25.360271, 83.433763 25.360315, 83.433457 25.360377, 83.43315699999999 25.360455, 83.432863 25.360551, 83.432576 25.360663, 83.432298 25.360792, 83.432029 25.360935, 83.43177 25.361094, 83.431523 25.361267, 83.431288 25.361454, 83.431067 25.361654, 83.43086099999999 25.361866, 83.430669 25.362089, 83.430493 25.362323, 83.430334 25.362566, 83.43019200000001 25.362817, 83.43006800000001 25.363077, 83.429962 25.363342, 83.429875 25.363614, 83.429807 25.363889, 83.42975800000001 25.364168, 83.429728 25.36445, 83.42971900000001 25.364732, 83.429728 25.365014, 83.42975800000001 25.365296, 83.429807 25.365575, 83.429875 25.36585, 83.429962 25.366122, 83.43006800000001 25.366387, 83.43019200000001 25.366647, 83.430334 25.366898, 83.430493 25.367141, 83.430669 25.367375, 83.43086099999999 25.367598, 83.431067 25.36781, 83.431288 25.36801, 83.431523 25.368197, 83.43177 25.36837, 83.432029 25.368529, 83.432298 25.368672, 83.432576 25.368801, 83.432863 25.368913, 83.43315699999999 25.369009, 83.433457 25.369087, 83.433763 25.369149, 83.434071 25.369193, 83.434383 25.36922, 83.43469500000001 25.369229, 83.435007 25.36922, 83.43531900000001 25.369193, 83.435627 25.369149, 83.43593300000001 25.369087, 83.436233 25.369009, 83.436527 25.368913, 83.436814 25.368801, 83.43709200000001 25.368672, 83.437361 25.368529, 83.43762 25.36837, 83.437867 25.368197, 83.438102 25.36801, 83.438323 25.36781, 83.438529 25.367598, 83.438721 25.367375, 83.438897 25.367141, 83.43905599999999 25.366898, 83.43919800000001 25.366647, 83.439322 25.366387, 83.43942800000001 25.366122, 83.439515 25.36585, 83.439583 25.365575, 83.439632 25.365296, 83.439662 25.365014, 83.439671 25.364732))"
Kharela (NP),25.543635,79.810773,"POLYGON ((79.81575700000001 25.543635, 79.815747 25.543353, 79.81571700000001 25.543071, 79.815668 25.542792, 79.8156 25.542517, 79.815513 25.542245, 79.81540699999999 25.54198, 79.815282 25.54172, 79.81514 25.541469, 79.814981 25.541226, 79.81480500000001 25.540992, 79.81461299999999 25.540769, 79.81440600000001 25.540557, 79.814185 25.540357, 79.81395000000001 25.54017, 79.81370200000001 25.539997, 79.81344300000001 25.539838, 79.813174 25.539695, 79.812895 25.539566, 79.812608 25.539454, 79.812313 25.539358, 79.812012 25.53928, 79.811707 25.539218, 79.811398 25.539174, 79.811086 25.539147, 79.810773 25.539138, 79.81046000000001 25.539147, 79.810148 25.539174, 79.809839 25.539218, 79.809534 25.53928, 79.80923300000001 25.539358, 79.808938 25.539454, 79.808651 25.539566, 79.80837200000001 25.539695, 79.808103 25.539838, 79.807844 25.539997, 79.807596 25.54017, 79.807361 25.540357, 79.80714 25.540557, 79.806933 25.540769, 79.806741 25.540992, 79.80656500000001 25.541226, 79.806406 25.541469, 79.806264 25.54172, 79.806139 25.54198, 79.806033 25.542245, 79.80594600000001 25.542517, 79.80587800000001 25.542792, 79.805829 25.543071, 79.80579899999999 25.543353, 79.805789 25.543635, 79.80579899999999 25.543917, 79.805829 25.544199, 79.80587800000001 25.544478, 79.80594600000001 25.544753, 79.806033 25.545025, 79.806139 25.54529, 79.806264 25.54555, 79.806406 25.545801, 79.80656500000001 25.546044, 79.806741 25.546278, 79.806933 25.546501, 79.80714 25.546713, 79.807361 25.546913, 79.807596 25.5471, 79.807844 25.547273, 79.808103 25.547432, 79.80837200000001 25.547575, 79.808651 25.547704, 79.808938 25.547816, 79.80923300000001 25.547912, 79.809534 25.54799, 79.809839 25.548052, 79.810148 25.548096, 79.81046000000001 25.548123, 79.810773 25.548132, 79.811086 25.548123, 79.811398 25.548096, 79.811707 25.548052, 79.812012 25.54799, 79.812313 25.547912, 79.812608 25.547816, 79.812895 25.547704, 79.813174 25.547575, 79.81344300000001 25.547432, 79.81370200000001 25.547273, 79.81395000000001 25.5471, 79.814185 25.546913, 79.81440600000001 25.546713, 79.81461299999999 25.546501, 79.81480500000001 25.546278, 79.814981 25.546044, 79.81514 25.545801, 79.815282 25.54555, 79.81540699999999 25.54529, 79.815513 25.545025, 79.8156 25.544753, 79.815668 25.544478, 79.81571700000001 25.544199, 79.815747 25.543917, 79.81575700000001 25.543635))"
Jamin Durga,25.886041,83.332003,"POLYGON ((83.337001 25.886041, 83.336991 25.885759, 83.336962 25.885477, 83.336913 25.885198, 83.336844 25.884923, 83.33675599999999 25.884651, 83.33665000000001 25.884386, 83.336525 25.884126, 83.336383 25.883875, 83.336223 25.883632, 83.33604699999999 25.883398, 83.335854 25.883175, 83.335646 25.882963, 83.335424 25.882763, 83.335189 25.882576, 83.334941 25.882403, 83.334681 25.882244, 83.334411 25.882101, 83.334131 25.881972, 83.333843 25.88186, 83.333547 25.881764, 83.333246 25.881686, 83.33293999999999 25.881624, 83.332629 25.88158, 83.332317 25.881553, 83.332003 25.881544, 83.331689 25.881553, 83.331377 25.88158, 83.33106600000001 25.881624, 83.33076 25.881686, 83.33045900000001 25.881764, 83.330163 25.88186, 83.329875 25.881972, 83.329595 25.882101, 83.329325 25.882244, 83.329065 25.882403, 83.328817 25.882576, 83.328582 25.882763, 83.32836 25.882963, 83.328152 25.883175, 83.32795900000001 25.883398, 83.327783 25.883632, 83.327623 25.883875, 83.32748100000001 25.884126, 83.327356 25.884386, 83.32725000000001 25.884651, 83.327162 25.884923, 83.32709300000001 25.885198, 83.327044 25.885477, 83.327015 25.885759, 83.327005 25.886041, 83.327015 25.886323, 83.327044 25.886605, 83.32709300000001 25.886884, 83.327162 25.887159, 83.32725000000001 25.887431, 83.327356 25.887696, 83.32748100000001 25.887956, 83.327623 25.888207, 83.327783 25.88845, 83.32795900000001 25.888684, 83.328152 25.888907, 83.32836 25.889119, 83.328582 25.889319, 83.328817 25.889506, 83.329065 25.889679, 83.329325 25.889838, 83.329595 25.889981, 83.329875 25.89011, 83.330163 25.890222, 83.33045900000001 25.890318, 83.33076 25.890396, 83.33106600000001 25.890458, 83.331377 25.890502, 83.331689 25.890529, 83.332003 25.890538, 83.332317 25.890529, 83.332629 25.890502, 83.33293999999999 25.890458, 83.333246 25.890396, 83.333547 25.890318, 83.333843 25.890222, 83.334131 25.89011, 83.334411 25.889981, 83.334681 25.889838, 83.334941 25.889679, 83.335189 25.889506, 83.335424 25.889319, 83.335646 25.889119, 83.335854 25.888907, 83.33604699999999 25.888684, 83.336223 25.88845, 83.336383 25.888207, 83.336525 25.887956, 83.33665000000001 25.887696, 83.33675599999999 25.887431, 83.336844 25.887159, 83.336913 25.886884, 83.336962 25.886605, 83.336991 25.886323, 83.337001 25.886041))"

我有以下点数据,其中包含经纬度

item,lat,long,rr,count,rr_count_mul
x1,30.682949999999998,74.321308,-116.6,5.0,-583.0
x2,27.183035,82.303905,-109.32753484100978,1169.0,-127803.88822914043
x3,27.190365,82.175159,-101.48756393861892,559.0,-56731.548241687975
x5,25.34263,80.599651,-109.13350776207919,267.0,-29138.646572475143
x6,26.053544,79.735851,-105.13363728470112,162.0,-17031.649240121584
x7,25.274659,81.7103,-102.88,52.0,-5349.76
x8,25.206028,80.878429,-104.22453511210745,222.0,-23137.846794887853
x9,26.828513,81.378994,-106.91369047619048,20.0,-2138.2738095238096
x10,25.737282,79.655514,-113.0,2.0,-226.0
x11,24.7052,83.136806,-101.37167177638992,249.0,-25241.546272321088
x12,27.47736,79.482136,-107.55249382892076,238.0,-25597.49353128314
x13,26.468883,81.826344,-110.8042328042328,57.0,-6315.841269841269
x14,27.68368,81.450405,-107.41746031746032,18.0,-1933.514285714286
x15,27.982729,81.258488,-109.85000000000001,10.0,-1098.5

我试图找到多边形边界内的所有点。我用过

https://sedona.apache.org/tutorial/sql/

我的代码就像

import org.apache.spark.serializer.KryoSerializer
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions._
import org.datasyslab.geosparksql.utils.{Adapter, GeoSparkSQLRegistrator}

val spark = SparkSession.builder().master("local[*]").getOrCreate()
    import spark.implicits._
    spark.conf.set("spark.serializer", classOf[KryoSerializer].getName) // org.apache.spark.serializer.KryoSerializer
    GeoSparkSQLRegistrator.registerAll(spark)

 val village_df = spark.read.option("header","true")
      .option("delimiter",",").csv("data/test/polygon.txt")


    val point_df = spark.read.option("header","true").option("delimiter",",")
      .csv("data/test/point.csv")
    .withColumn("geometry",expr("ST_POINT(CAST(long AS DECIMAL(16,12)),CAST(lat AS DECIMAL(16,12)))"))


village_df.createOrReplaceTempView("polygons")
    point_df.createOrReplaceTempView("points")

    val final_data = spark.sql(" SELECT * FROM" +
      " (SELECT *, ST_GeomFromWKT(polygons.geometry) as y FROM polygons) polygons" +
      "  inner JOIN" +
      "    (SELECT ST_GeomFromWKT (points.geometry) as x, * FROM points) points" +
      "  WHERE ST_Contains(polygons.y,points.x)  ").show(10)

我在 pom.xml 中使用了以下插件

<dependency>
            <groupId>org.datasyslab</groupId>
            <artifactId>geospark-sql_2.3</artifactId>
            <version>1.3.1</version>
 </dependency>

 <dependency>
      <groupId>org.datasyslab</groupId>
      <artifactId>geospark-viz</artifactId>
      <version>1.1.1</version>
</dependency>

但我收到以下错误。我无法解决该错误

由于阶段失败而中止作业:阶段 4.0 中的任务 0 失败 1 次,最近一次失败:阶段 4.0 中丢失任务 0.0(TID 4,本地主机,执行程序驱动程序):java.lang.ClassCastException:org.apache.spark.sql。在 org.apache.spark.sql.geosparksql.expressions.ST_GeomFromWKT.eval 中,catalyst.util.GenericArrayData 无法转换为 org.apache.spark.unsafe.types.UTF8String

4

0 回答 0