Skip to content

Instantly share code, notes, and snippets.

@4DA
Created January 14, 2023 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4DA/ebd351a4633bba154f449c802dd1990e to your computer and use it in GitHub Desktop.
Save 4DA/ebd351a4633bba154f449c802dd1990e to your computer and use it in GitHub Desktop.
Montenegro land plots cadastre -> GPX
# installing:
# pip install pyproj
# pip install gpxpy
import gpxpy
import gpxpy.gpx
from pyproj import Transformer
TRAN_3857_TO_GPS = Transformer.from_crs("EPSG:3857", "EPSG:4326")
def to_gps(lon, lat):
return TRAN_3857_TO_GPS.transform(lon, lat)
reg1369_1 = [[2133539.189651306, 5166021.502250131], [2133543.4812738076, 5166020.728283168], [2133558.4706719425, 5166015.719054884], [2133574.527098537, 5166007.119234078], [2133577.0585293197, 5165996.532124516], [2133598.1893133223, 5165970.576789915], [2133614.214064759, 5165959.656391312], [2133620.042715586, 5165952.289709568], [2133615.5430337815, 5165941.718033857], [2133610.000150019, 5165929.568363179], [2133612.548083365, 5165919.210502199], [2133593.5749143595, 5165888.299277658], [2133573.3314177324, 5165874.69128845], [2133566.365134867, 5165858.701902078], [2133555.8316810946, 5165847.322346844], [2133546.4183961237, 5165841.203578493], [2133544.166517806, 5165847.630545415], [2133531.4441590332, 5165879.947398356], [2133517.895602649, 5165910.831794437], [2133539.455228685, 5165942.13963259], [2133525.9380206508, 5165954.5638747085], [2133528.96645637, 5165960.756676686], [2133526.5379332243, 5165980.896163699], [2133533.9888001736, 5165994.949482559], [2133539.189651306, 5166021.502250131]]
reg1369_2 = [[2133578.7071600277, 5165869.611382438], [2133595.078950575, 5165883.231917055], [2133616.2507272335, 5165856.358698059], [2133637.0162638463, 5165852.997505823], [2133654.272890667, 5165852.59905883], [2133662.2351274253, 5165849.885585994], [2133669.441477554, 5165847.938130096], [2133647.5746554816, 5165830.628287559], [2133636.5327597177, 5165823.384959012], [2133621.117375848, 5165813.853617579], [2133606.05159205, 5165802.34736384], [2133591.57279362, 5165780.618209558], [2133585.4349001804, 5165784.021785117], [2133577.067768884, 5165783.650628646], [2133560.464040579, 5165779.654488036], [2133552.7298111776, 5165785.292898816], [2133546.2786858687, 5165792.357577468], [2133538.090216625, 5165811.064282493], [2133535.8833455252, 5165822.780221241], [2133537.9013070185, 5165827.826296793], [2133551.469155603, 5165835.952735364], [2133567.431287056, 5165847.136477406], [2133578.7071600277, 5165869.611382438]]
reg1363_3 = [[2133401.997779429, 5165826.920217452], [2133442.2737513236, 5165870.318919745], [2133448.246736906, 5165861.69549789], [2133455.4369022837, 5165848.656395041], [2133462.7490001484, 5165831.729385765], [2133460.7831933466, 5165826.561133022], [2133451.7639866704, 5165832.621893665], [2133442.6699986653, 5165833.1781509975], [2133401.997779429, 5165826.920217452]]
reg1385 = [[2133836.818369035, 5166029.471838777], [2133841.434150507, 5166023.875860617], [2133835.845024746, 5166014.277252726], [2133828.648034204, 5166006.06363044], [2133821.7035454144, 5166003.554571883], [2133799.5602725428, 5166006.462832159], [2133784.0869501103, 5166004.556568869], [2133769.496337633, 5165997.375450198], [2133749.5951950233, 5165990.186196692], [2133742.471371694, 5165988.327262758], [2133736.266174567, 5165986.793077577], [2133731.3576403577, 5165968.913215994], [2133719.7486262224, 5165944.715588816], [2133715.636616426, 5165929.051392435], [2133702.258590554, 5165924.026138781], [2133690.26760193, 5165910.278198628], [2133679.185959788, 5165885.304280179], [2133670.007260249, 5165871.733717305], [2133667.6169732935, 5165856.1269796295], [2133669.441477554, 5165847.938130096], [2133662.2351274253, 5165849.885585994], [2133654.272890667, 5165852.59905883], [2133637.0162638463, 5165852.997505823], [2133616.2507272335, 5165856.358698059], [2133595.078950575, 5165883.231917055], [2133578.7071600277, 5165869.611382438], [2133567.431287056, 5165847.136477406], [2133551.469155603, 5165835.952735364], [2133537.9013070185, 5165827.826296793], [2133535.8833455252, 5165822.780221241], [2133538.090216625, 5165811.064282493], [2133531.4009913, 5165794.679859381], [2133525.6408746047, 5165785.326526646], [2133508.298596277, 5165775.4570904905], [2133496.729596746, 5165767.00641221], [2133497.2430504165, 5165765.2181976065], [2133491.0160950925, 5165761.079876977], [2133478.7865964, 5165741.613795233], [2133469.7404724956, 5165731.8331765095], [2133460.59392524, 5165720.596606772], [2133455.6722805174, 5165719.516994556], [2133435.960811099, 5165707.426460939], [2133418.0162909646, 5165697.740598195], [2133407.478352465, 5165697.884769779], [2133401.350703033, 5165702.043706248], [2133393.65172548, 5165711.270797086], [2133397.690380739, 5165713.657920012], [2133403.415370946, 5165706.576346173], [2133409.527382593, 5165702.255695481], [2133417.3633842394, 5165703.120038233], [2133431.4774005706, 5165711.8867716715], [2133443.2767224517, 5165724.436434958], [2133453.828130286, 5165724.292038782], [2133466.2227021335, 5165735.133326129], [2133474.549837345, 5165744.438016209], [2133490.126348876, 5165764.856834025], [2133497.3225591383, 5165772.0584818255], [2133509.340390698, 5165781.879391241], [2133518.1388302, 5165787.277909377], [2133526.308634252, 5165799.83678176], [2133531.061151309, 5165810.229461714], [2133529.930006454, 5165820.972599861], [2133531.3261404866, 5165829.724523631], [2133535.065780587, 5165836.811597347], [2133546.4183961237, 5165841.203578493], [2133555.8316810946, 5165847.322346844], [2133566.365134867, 5165858.701902078], [2133573.3314177324, 5165874.69128845], [2133593.5749143595, 5165888.299277658], [2133604.742108496, 5165879.0513230655], [2133611.1998993875, 5165871.487172569], [2133617.0889630704, 5165862.635396417], [2133640.07661925, 5165858.569047365], [2133661.728838712, 5165857.138777189], [2133663.8043330815, 5165875.300195166], [2133675.0056788595, 5165889.315330482], [2133683.4102451676, 5165914.164039187], [2133695.0510887215, 5165925.892686645], [2133717.412152033, 5165950.846955898], [2133727.7020041146, 5165970.97397609], [2133733.7585826237, 5165989.242921614], [2133744.1355864396, 5165993.054373386], [2133768.5377899893, 5166002.017095708], [2133784.0972836018, 5166010.250964731], [2133798.293682869, 5166011.189677138], [2133821.0332034854, 5166007.6390092205], [2133825.9638579153, 5166009.366059929], [2133831.3305976694, 5166016.457803893], [2133836.818369035, 5166029.471838777]]
reg1386 = [[2133611.1998993875, 5165871.487172569], [2133634.0738076726, 5165866.963597906], [2133640.07661925, 5165858.569047365], [2133617.0889630704, 5165862.635396417], [2133611.1998993875, 5165871.487172569]]
reg1387 = [[2133615.5430337815, 5165941.718033857], [2133638.636318001, 5165926.625559633], [2133633.378806636, 5165914.701409186], [2133675.0056788595, 5165889.315330482], [2133663.8043330815, 5165875.300195166], [2133661.728838712, 5165857.138777189], [2133640.07661925, 5165858.569047365], [2133634.0738076726, 5165866.963597906], [2133611.1998993875, 5165871.487172569], [2133604.742108496, 5165879.0513230655], [2133593.5749143595, 5165888.299277658], [2133612.548083365, 5165919.210502199], [2133610.000150019, 5165929.568363179], [2133615.5430337815, 5165941.718033857]]
reg1388 = [[2133627.467635111, 5165964.427105268], [2133662.8483621264, 5165941.393548757], [2133695.0510887215, 5165925.892686645], [2133683.4102451676, 5165914.164039187], [2133675.0056788595, 5165889.315330482], [2133633.378806636, 5165914.701409186], [2133638.636318001, 5165926.625559633], [2133615.5430337815, 5165941.718033857], [2133620.042715586, 5165952.289709568], [2133627.467635111, 5165964.427105268]]
reg1389 = [[2133675.948940302, 5166014.945853163], [2133694.7435332416, 5166014.917571119], [2133715.9977792306, 5165999.040360128], [2133733.7585826237, 5165989.242921614], [2133727.7020041146, 5165970.97397609], [2133717.412152033, 5165950.846955898], [2133695.0510887215, 5165925.892686645], [2133662.8483621264, 5165941.393548757], [2133627.467635111, 5165964.427105268], [2133634.63935123, 5165981.668760246], [2133653.96533376, 5165997.974681279], [2133665.6095676855, 5166005.007450664], [2133675.948940302, 5166014.945853163]]
reg1384 = [[2133841.434150507, 5166023.875860617], [2133850.7228723685, 5166016.879811142], [2133856.3183283843, 5166015.102729239], [2133844.6378176343, 5166001.472040287], [2133795.1918559936, 5165941.386668668], [2133758.504436448, 5165960.255471507], [2133740.300530659, 5165958.238168631], [2133730.0210646507, 5165951.713076652], [2133719.7486262224, 5165944.715588816], [2133731.3576403577, 5165968.913215994], [2133736.266174567, 5165986.793077577], [2133742.471371694, 5165988.327262758], [2133749.5951950233, 5165990.186196692], [2133769.496337633, 5165997.375450198], [2133784.0869501103, 5166004.556568869], [2133799.5602725428, 5166006.462832159], [2133821.7035454144, 5166003.554571883], [2133828.648034204, 5166006.06363044], [2133835.845024746, 5166014.277252726], [2133841.434150507, 5166023.875860617]]
reg1379 = [[2133856.3183283843, 5166015.102729239], [2133868.668507907, 5166012.760609687], [2133864.0476533077, 5166006.144439052], [2133852.997671302, 5165998.33458825], [2133851.645727449, 5165991.862462868], [2133851.9268414928, 5165985.853712], [2133859.1965794708, 5165984.606908941], [2133851.0733431852, 5165953.803418487], [2133850.663069, 5165929.614178361], [2133851.8691460704, 5165911.569580026], [2133858.802342342, 5165887.60348963], [2133861.4801389766, 5165870.024547214], [2133864.8813942345, 5165851.27522433], [2133851.503009753, 5165830.435343157], [2133846.062992698, 5165818.94574058], [2133829.2312409338, 5165811.05345146], [2133823.211304035, 5165834.952819922], [2133787.477763383, 5165873.482631803], [2133754.7258761753, 5165907.869378813], [2133715.636616426, 5165929.051392435], [2133719.7486262224, 5165944.715588816], [2133730.0210646507, 5165951.713076652], [2133740.300530659, 5165958.238168631], [2133758.504436448, 5165960.255471507], [2133795.1918559936, 5165941.386668668], [2133844.6378176343, 5166001.472040287], [2133856.3183283843, 5166015.102729239]]
reg1377 = [[2133702.258590554, 5165924.026138781], [2133715.636616426, 5165929.051392435], [2133720.1607885184, 5165921.662079671], [2133725.7220876967, 5165916.390604485], [2133734.737854996, 5165911.071749783], [2133742.2975189006, 5165905.449005405], [2133754.008644669, 5165897.650751437], [2133760.300161496, 5165892.693108542], [2133766.9646331323, 5165884.518776687], [2133771.404053788, 5165876.8337689405], [2133774.566343681, 5165869.15279316], [2133776.6885590306, 5165865.0619924], [2133763.736402823, 5165862.675832025], [2133738.5352518833, 5165886.838394068], [2133699.788249822, 5165900.5669020265], [2133690.26760193, 5165910.278198628], [2133702.258590554, 5165924.026138781]]
reg1375_1 = [[2133690.26760193, 5165910.278198628], [2133699.788249822, 5165900.5669020265], [2133738.5352518833, 5165886.838394068], [2133763.736402823, 5165862.675832025], [2133751.294907989, 5165858.299037956], [2133746.6600568215, 5165856.567917793], [2133738.542688257, 5165862.697562969], [2133730.7770253513, 5165867.999249284], [2133721.196753781, 5165873.325817942], [2133713.678084208, 5165876.033264148], [2133706.5965885236, 5165877.277360163], [2133697.843976411, 5165877.235448383], [2133690.0230120136, 5165878.476177452], [2133684.047897777, 5165881.000510389], [2133679.185959788, 5165885.304280179], [2133690.26760193, 5165910.278198628]]
reg1375_2 = [[2133679.185959788, 5165885.304280179], [2133684.047897777, 5165881.000510389], [2133690.0230120136, 5165878.476177452], [2133697.843976411, 5165877.235448383], [2133706.5965885236, 5165877.277360163], [2133713.678084208, 5165876.033264148], [2133721.196753781, 5165873.325817942], [2133730.7770253513, 5165867.999249284], [2133738.542688257, 5165862.697562969], [2133746.6600568215, 5165856.567917793], [2133740.1213292424, 5165854.2286937], [2133731.195192275, 5165835.513583295], [2133720.391178328, 5165831.923937823], [2133751.9014645126, 5165794.235120553], [2133735.5878665433, 5165783.906683889], [2133740.9967613914, 5165802.008733038], [2133722.5000962955, 5165818.9543562], [2133707.2547586584, 5165834.76238227], [2133690.799101286, 5165840.668959466], [2133669.441477554, 5165847.938130096], [2133667.6169732935, 5165856.1269796295], [2133670.007260249, 5165871.733717305], [2133679.185959788, 5165885.304280179]]
reg1368 = [[2133515.9947731104, 5165953.971347177], [2133525.9380206508, 5165954.5638747085], [2133539.455228685, 5165942.13963259], [2133517.895602649, 5165910.831794437], [2133531.4441590332, 5165879.947398356], [2133544.166517806, 5165847.630545415], [2133546.4183961237, 5165841.203578493], [2133535.065780587, 5165836.811597347], [2133531.3261404866, 5165829.724523631], [2133529.930006454, 5165820.972599861], [2133531.061151309, 5165810.229461714], [2133526.308634252, 5165799.83678176], [2133518.1388302, 5165787.277909377], [2133509.340390698, 5165781.879391241], [2133509.322108245, 5165792.404850523], [2133511.814277582, 5165795.744195394], [2133514.6023573945, 5165802.061635816], [2133515.3165891627, 5165815.046470222], [2133515.0369061967, 5165831.067568447], [2133511.494038303, 5165841.425437308], [2133502.8921319153, 5165859.395700598], [2133500.560865459, 5165868.886887533], [2133495.6024710666, 5165883.906103366], [2133491.04142459, 5165892.550727811], [2133485.6961716847, 5165897.900059325], [2133482.594123126, 5165904.095795408], [2133478.110780027, 5165918.46084018], [2133481.2602118235, 5165926.635603669], [2133485.497821157, 5165941.67745218], [2133495.6540935044, 5165939.14996374], [2133502.371585017, 5165938.815103225], [2133512.1007534983, 5165944.4303710805], [2133515.9947731104, 5165953.971347177]]
reg1367 = [[2133460.72480472, 5165906.378759039], [2133478.110780027, 5165918.46084018], [2133482.594123126, 5165904.095795408], [2133485.6961716847, 5165897.900059325], [2133491.04142459, 5165892.550727811], [2133495.6024710666, 5165883.906103366], [2133500.560865459, 5165868.886887533], [2133502.8921319153, 5165859.395700598], [2133511.494038303, 5165841.425437308], [2133515.0369061967, 5165831.067568447], [2133515.3165891627, 5165815.046470222], [2133514.6023573945, 5165802.061635816], [2133511.814277582, 5165795.744195394], [2133509.322108245, 5165792.404850523], [2133506.856285777, 5165791.993313572], [2133495.217734248, 5165822.945701671], [2133494.421859129, 5165836.598947812], [2133493.4156014626, 5165842.68499256], [2133490.291334108, 5165848.233290435], [2133487.1594225042, 5165852.229890869], [2133476.7094907067, 5165861.832200526], [2133470.3652381524, 5165865.886265788], [2133463.3322863723, 5165873.674092194], [2133460.917334052, 5165883.935586599], [2133461.520732144, 5165892.725415888], [2133463.0979097025, 5165899.963607288], [2133460.72480472, 5165906.378759039]]
reg1366 = [[2133444.8771849796, 5165898.674656525], [2133460.72480472, 5165906.378759039], [2133463.0979097025, 5165899.963607288], [2133461.520732144, 5165892.725415888], [2133460.917334052, 5165883.935586599], [2133463.3322863723, 5165873.674092194], [2133470.3652381524, 5165865.886265788], [2133476.7094907067, 5165861.832200526], [2133487.1594225042, 5165852.229890869], [2133490.291334108, 5165848.233290435], [2133493.4156014626, 5165842.68499256], [2133494.421859129, 5165836.598947812], [2133495.217734248, 5165822.945701671], [2133506.856285777, 5165791.993313572], [2133509.322108245, 5165792.404850523], [2133509.340390698, 5165781.879391241], [2133497.3225591383, 5165772.0584818255], [2133488.6230410337, 5165784.821309683], [2133467.994089993, 5165819.998856326], [2133462.7490001484, 5165831.729385765], [2133455.4369022837, 5165848.656395041], [2133448.246736906, 5165861.69549789], [2133442.2737513236, 5165870.318919745], [2133436.632028005, 5165878.5869689565], [2133433.3096394693, 5165883.409304349], [2133444.8771849796, 5165898.674656525]]
reg1360 = [[2133452.078990823, 5165801.379204722], [2133467.994089993, 5165819.998856326], [2133488.6230410337, 5165784.821309683], [2133497.3225591383, 5165772.0584818255], [2133490.126348876, 5165764.856834025], [2133474.549837345, 5165744.438016209], [2133466.2227021335, 5165735.133326129], [2133453.828130286, 5165724.292038782], [2133443.2767224517, 5165724.436434958], [2133439.87245037, 5165732.133990695], [2133436.0417160103, 5165740.107262819], [2133429.8363013305, 5165753.389111816], [2133422.79148742, 5165760.299880958], [2133416.199287679, 5165763.911963364], [2133443.59309569, 5165792.265526666], [2133452.078990823, 5165801.379204722]]
reg2435 = [[2133615.8955899077, 5165752.163814253], [2133630.9404148906, 5165753.239559384], [2133649.0156103093, 5165758.672729775], [2133657.5862774607, 5165761.159561601], [2133664.3555864003, 5165764.642634568], [2133668.1085153343, 5165772.700981734], [2133670.3686458403, 5165782.695924874], [2133679.6165215517, 5165781.5975887], [2133706.386594041, 5165784.806417916], [2133712.0892232014, 5165789.92335498], [2133723.908018044, 5165780.167147658], [2133735.5878665433, 5165783.906683889], [2133751.9014645126, 5165794.235120553], [2133763.6501081046, 5165789.202671357], [2133777.4125246, 5165784.952213135], [2133786.8047952508, 5165788.534158874], [2133796.603771973, 5165800.260812757], [2133802.8487337683, 5165804.7225551605], [2133814.5129191596, 5165811.255453319], [2133829.2312409338, 5165811.05345146], [2133846.062992698, 5165818.94574058], [2133851.503009753, 5165830.435343157], [2133864.8813942345, 5165851.27522433], [2133869.5660620607, 5165848.768502928], [2133926.1684169765, 5165854.927093967], [2133936.4896618337, 5165879.3038591705], [2133942.9436849765, 5165887.257618087], [2133977.9128673295, 5165914.9526705155], [2133997.7431271607, 5165951.437978301], [2134012.217140239, 5165988.4962880155], [2134004.7490460305, 5166001.809703078], [2134001.8886795095, 5166011.902167548], [2134026.825479441, 5166032.434910406], [2134030.972859025, 5166042.768436249], [2134038.4955855208, 5166057.103837615], [2134040.90790988, 5166060.484714851], [2134070.1354038697, 5166071.296566821], [2134080.043092555, 5166078.136850904], [2134088.1293323333, 5166081.5476470245], [2134089.2516288306, 5166082.018005595], [2134093.443655517, 5166091.676228885], [2134096.586794052, 5166085.560573957], [2134098.3953312603, 5166080.164980046], [2134099.400658822, 5166071.08301042], [2134095.5003388273, 5166069.989644088], [2134089.1302353954, 5166068.201554425], [2134046.039156496, 5166056.217461714], [2134041.2145081116, 5166049.455713406], [2134031.246895785, 5166024.426050462], [2134025.7214757204, 5166014.583783628], [2134021.5814493783, 5166012.670543823], [2134024.440529582, 5165995.588119486], [2134017.5649285875, 5165977.438560182], [2134009.653009811, 5165970.044580691], [2134003.449144685, 5165955.799112203], [2134004.688650421, 5165934.313000551], [2133998.177661444, 5165924.160497971], [2133994.6545312833, 5165920.160703362], [2133992.0697278865, 5165916.944162226], [2133985.043179437, 5165909.403100805], [2133967.9673060197, 5165888.5600928385], [2133956.963937824, 5165883.178735775], [2133943.2118560052, 5165865.5151312165], [2133933.6980828587, 5165850.0737971775], [2133924.3548660334, 5165846.1539521115], [2133903.9108588924, 5165843.506552028], [2133887.724828034, 5165831.705735831], [2133855.9668350327, 5165813.695597664], [2133842.7488389313, 5165803.6351868715], [2133833.0002333405, 5165800.543961448], [2133824.9120566812, 5165806.835170437], [2133817.0781441377, 5165806.133053317], [2133805.3473339994, 5165798.656504933], [2133800.950036944, 5165796.598309186], [2133790.7885374622, 5165783.918574986], [2133778.6380955772, 5165778.20196804], [2133762.9065772095, 5165783.963761472], [2133749.967208991, 5165782.508502199], [2133740.2767093014, 5165777.756648186], [2133731.766268241, 5165773.771244783], [2133724.68268137, 5165773.868393206], [2133716.658638387, 5165772.035320695], [2133705.9678895716, 5165774.786231395], [2133699.8091091844, 5165776.651867035], [2133691.999686713, 5165776.758943426], [2133671.71865864, 5165760.385602679], [2133641.864188366, 5165743.900570777], [2133625.9141281447, 5165740.516316653], [2133611.815859614, 5165732.923590261], [2133598.673704712, 5165715.561758116], [2133584.97862098, 5165713.887243825], [2133564.3519585724, 5165707.665806039], [2133511.115530108, 5165692.890543096], [2133468.693576948, 5165692.37827894], [2133442.6140119573, 5165699.401099029], [2133418.3711234615, 5165689.2212018315], [2133407.6274968884, 5165687.087749004], [2133394.1059128665, 5165696.205568858], [2133371.882966949, 5165718.949636824], [2133354.847629513, 5165722.758460452], [2133335.9411466494, 5165707.566637696], [2133327.6892444203, 5165703.79326493], [2133319.955119459, 5165697.556947997], [2133294.23228571, 5165681.338290026], [2133288.409956931, 5165682.240988133], [2133277.3623244353, 5165687.425137286], [2133261.059051593, 5165691.68256153], [2133254.456305596, 5165693.526971481], [2133249.528009721, 5165690.963036358], [2133249.931382887, 5165685.020287908], [2133239.290148324, 5165674.573122654], [2133227.341200907, 5165662.861922107], [2133211.9886084353, 5165642.048511983], [2133177.6467539556, 5165616.758201525], [2133171.396990831, 5165608.936289518], [2133157.8383193174, 5165582.593031251], [2133156.4792082873, 5165585.472226452], [2133150.377104739, 5165595.486820197], [2133152.7087233104, 5165596.912293393], [2133160.444574181, 5165606.265680987], [2133170.971531739, 5165622.179339434], [2133174.3494655783, 5165640.29565158], [2133185.401039411, 5165640.360623683], [2133203.4625350204, 5165649.775398713], [2133213.2379067563, 5165664.781776914], [2133219.17849673, 5165671.609396396], [2133227.3983577606, 5165680.956189581], [2133239.8267373084, 5165693.322054155], [2133257.107594453, 5165701.667944959], [2133265.2275164207, 5165704.633557352], [2133267.3946322235, 5165700.866175926], [2133271.073063359, 5165701.47709939], [2133273.1546078157, 5165699.330135478], [2133285.1559789483, 5165697.061088848], [2133292.9897703063, 5165697.763639324], [2133300.9888329487, 5165701.729408485], [2133315.148028424, 5165705.907822203], [2133329.401454058, 5165718.019256765], [2133342.7892181706, 5165726.769077979], [2133349.575971488, 5165731.54752788], [2133360.178047511, 5165736.125367093], [2133368.201996959, 5165737.95873588], [2133376.693337995, 5165733.619044572], [2133386.248984199, 5165728.455163062], [2133397.690380739, 5165713.657920012], [2133393.65172548, 5165711.270797086], [2133401.350703033, 5165702.043706248], [2133407.478352465, 5165697.884769779], [2133418.0162909646, 5165697.740598195], [2133435.960811099, 5165707.426460939], [2133455.6722805174, 5165719.516994556], [2133460.59392524, 5165720.596606772], [2133466.3102577734, 5165712.880902065], [2133477.1095754104, 5165705.257550543], [2133488.3785922113, 5165700.542409669], [2133505.1988761458, 5165707.625746702], [2133525.2742268723, 5165713.841368618], [2133535.0555420844, 5165711.440476704], [2133576.2443515006, 5165718.149477485], [2133590.4719330366, 5165727.346232578], [2133601.3481612806, 5165738.235135068], [2133615.8955899077, 5165752.163814253]]
reg1370 = [[2133538.090216625, 5165811.064282493], [2133546.2786858687, 5165792.357577468], [2133552.7298111776, 5165785.292898816], [2133560.464040579, 5165779.654488036], [2133577.067768884, 5165783.650628646], [2133585.4349001804, 5165784.021785117], [2133591.57279362, 5165780.618209558], [2133611.51403574, 5165769.05064595], [2133616.4645759915, 5165759.402195275], [2133615.8955899077, 5165752.163814253], [2133601.3481612806, 5165738.235135068], [2133590.4719330366, 5165727.346232578], [2133576.2443515006, 5165718.149477485], [2133535.0555420844, 5165711.440476704], [2133525.2742268723, 5165713.841368618], [2133505.1988761458, 5165707.625746702], [2133488.3785922113, 5165700.542409669], [2133477.1095754104, 5165705.257550543], [2133466.3102577734, 5165712.880902065], [2133460.59392524, 5165720.596606772], [2133469.7404724956, 5165731.8331765095], [2133478.7865964, 5165741.613795233], [2133491.0160950925, 5165761.079876977], [2133497.2430504165, 5165765.2181976065], [2133496.729596746, 5165767.00641221], [2133508.298596277, 5165775.4570904905], [2133525.6408746047, 5165785.326526646], [2133531.4009913, 5165794.679859381], [2133538.090216625, 5165811.064282493]]
reg929 = [[2152477.4956845464, 5164324.268190471], [2152498.3490674747, 5164365.171782403], [2152580.31854626, 5164333.353482236], [2152634.7325940793, 5164288.637593867], [2152641.618058968, 5164258.672456144], [2152621.951669084, 5164237.0304569155], [2152567.315693826, 5164176.90644834], [2152512.675547295, 5164138.908521583], [2152495.62620829, 5164127.330543643], [2152483.5903702504, 5164112.287551232], [2152467.3378732847, 5164076.776830361], [2152465.961294387, 5164072.1034293985], [2152433.3193517714, 5164066.517310031], [2152428.052467964, 5164064.063534148], [2152425.931148617, 5164058.1741005415], [2152422.792126269, 5164040.44175535], [2152402.931664063, 5164065.860552066], [2152401.4622019203, 5164091.4902121555], [2152417.520910308, 5164115.428493582], [2152417.0208258373, 5164193.835302434], [2152427.1648033834, 5164216.868194834], [2152448.3356621056, 5164276.465867254], [2152477.4956845464, 5164324.268190471]]
reg930 = [[2152433.3193517714, 5164066.517310031], [2152465.961294387, 5164072.1034293985], [2152457.3975975947, 5164040.924361498], [2152457.539922458, 5164025.029371422], [2152427.6989069344, 5164033.578678211], [2152422.792126269, 5164040.44175535], [2152425.931148617, 5164058.1741005415], [2152428.052467964, 5164064.063534148], [2152433.3193517714, 5164066.517310031]]
def convert_points(points):
result = []
for x in points:
result.append(to_gps(x[0], x[1]))
return result
def create_gpx(gps_points, name, description):
gpx = gpxpy.gpx.GPX()
gpx.name = name
gpx.description = description
# Create first track in our GPX:
gpx_track = gpxpy.gpx.GPXTrack()
gpx.tracks.append(gpx_track)
# Create first segment in our GPX track:
gpx_segment = gpxpy.gpx.GPXTrackSegment()
gpx_track.segments.append(gpx_segment)
for point in gps_points:
gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(point[0], point[1]))
return gpx
def write_to_file(gps_points, plot_name, description):
converted = convert_points(gps_points)
gpx_data = create_gpx(converted, plot_name, description)
filename = "".join((plot_name, ".gpx"))
fd = open(filename, "w")
fd.write(gpx_data.to_xml())
fd.close()
write_to_file(reg1369_1, "1369_1", "Montelibero plot of land 1369/1")
write_to_file(reg1369_2, "1369_2", "Montelibero plot of land 1369/2")
write_to_file(reg1363_3, "1363_3", "Montelibero plot of land 1363/3")
write_to_file(reg1385, "1385", "Montenegro Bar plot of land 1385")
write_to_file(reg1386, "1386", "Montenegro Bar plot of land 1386")
write_to_file(reg1387, "1387", "Montenegro Bar plot of land 1387")
write_to_file(reg1388, "1388", "Montenegro Bar plot of land 1388")
write_to_file(reg1389, "1389", "Montenegro Bar plot of land 1389")
write_to_file(reg1384, "1384", "Montenegro Bar plot of land 1384")
write_to_file(reg1379, "1379", "Montenegro Bar plot of land 1379")
write_to_file(reg1377, "1377", "Montenegro Bar plot of land 1377")
write_to_file(reg1375_1, "1375_1", "Montenegro Bar plot of land 1375/1")
write_to_file(reg1375_2, "1375_2", "Montenegro Bar plot of land 1375/2")
write_to_file(reg1368, "1368", "Montenegro Bar plot of land 1368")
write_to_file(reg1367, "1367", "Montenegro Bar plot of land 1367")
write_to_file(reg1366, "1366", "Montenegro Bar plot of land 1366")
write_to_file(reg1360, "1360", "Montenegro Bar plot of land 1360")
write_to_file(reg2435, "2435", "Montenegro Bar plot of land 2435")
write_to_file(reg1370, "1370", "Montenegro Bar plot of land 1370")
write_to_file(reg929, "929", "Montenegro Brajsa plot of land 929")
write_to_file(reg930, "930", "Montenegro Brajsa plot of land 930")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment