-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmcx_to_leaflet.py
45 lines (31 loc) · 1.16 KB
/
mcx_to_leaflet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
'''
Tämä tekee Arandan matkasuunnitelman mcx-tiedostosta Leaflet-kartan (html-tiedoston)
Pohjana käytetään MyCruise_Leaflet_Routemap_template_variable_size.html-tiedostoa,
josta tehdään kopio, johon laitetaan matkaa koskevat tiedot oikeille paikoilleen.
Tämän kanssa samassa hakemistossa tulee olla seuraavat tiedostot:
- mcxFile.py
'''
import mcxFile as mcx
import os
#if(len(sys.argv)>1):
# f_name=sys.argv[1]
#else:
# f_name = input('Anna matka: ')
#from mcxFile import *
# %%
#f_name = input('Anna matka: ')
#f_name = "C:\\Users\\siirias\\Documents\\Aranda2020\\VRT_2020_syksy_current.mkx"
#f_name = "C:\\Users\\siirias\\Documents\\Aranda2020\\VRT_2020_syksy_extrasyvanne_pitka.mkx"
input_dir = "C:\\Users\\siirias\\Documents\\Aranda2021\\CruisePlan\\plan\\"
files_to_handle = [i for i in os.listdir(input_dir) if i.endswith('.mkx')]
for f in files_to_handle:
f_name = input_dir + f
if '.MKX' in f_name.upper():
acruise = mcx.MKXfile(f_name)
else:
acruise = mcx.MCXfile(f_name)
olist = acruise.leaflethtml()