Skip to content

Commit

Permalink
renamed files and fixed issue with Publish funtion
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeggiCH committed Oct 29, 2023
1 parent 763f4ab commit 8cd2aad
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ImportSchweizmobil.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def Import_Schweizmobil():

if (latmin>float(Filter["MaxLat"]) or latmax<float(Filter["MinLat"])):
if debug>1:
print (f"skipping track {iid} because of latitude filter");
print (f"skipping track {iid} because of latitude filter")
continue

# prepare feature structure
Expand All @@ -317,8 +317,8 @@ def Import_Schweizmobil():
},
'properties': newprops
}
if (opo==1):

if opo==1:
feature={
'type':'Feature',
'geometry': {
Expand Down
18 changes: 16 additions & 2 deletions main.py → TrackMapper.pyw
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
"""
schweizmobil.ch is a service to discover and plan (mostly) hiking/biking tracks in Switzerland. Viewing tracks does not require a paid subscription, drawing own tracks does. The schweizmobil.ch UI is great but unfortunately can only show one of the user-created tracks at a time. I have 300+ tracks and struggle to keep the overview of what I planned/did in a given region.
So, this project ..
- uses the schweizmobil.ch API described at https://github.com/JoeggiCH/schweizmobil.ch-API to download all tracks of a given user (with a paid subscription)
- allows users to filter tracks based on a number of criteria, such as the hike/bike length in kilometers, duration, meters uphill etc
- converts tracks into WGS84 coordinates and a GeoJSON FeatureCollection
- renders the FeatureCollection in a browser-viewable map (using python folium and leaflet.js)
"""
import PySimpleGUI as sg
from datetime import datetime
import ImportSchweizmobil as IS
Expand Down Expand Up @@ -253,8 +264,11 @@ def showMain():
if event=="Publish":
os.chdir(IS.outfp)
script_dir = os.path.abspath( os.path.dirname( __file__ ) )
os.system(f"{script_dir}\\update_web.bat {IS.outfp} >>{IS.outfp}update_web.log")
#os.system(IS.outfp+"update_web.bat >>update_web.log")
winpath=IS.outfp.replace("/","\\")
cmd=f"\"\"{script_dir}\\update web.bat\" \"{winpath}\" >>\"{winpath}update web.log\"\""
if debug>0: print (cmd)
os.system(cmd)

continue

if event=="OpenLocal":
Expand Down
6 changes: 6 additions & 0 deletions encryption.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""
encryption.py uses the fernet module to encrypt the configuration file - including
the API passwords - in TrackMapper
"""

# https://cryptography.io/en/latest/
# https://www.pythoninformer.com/python-libraries/cryptography/fernet/

Expand Down
2 changes: 2 additions & 0 deletions update_web.bat → update web.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
REM this is an example of a batch to publish html\map.html on a webpage
REM please adjust it to your needs!

echo ===========================================================
echo new pub request
date /t
time /t
cd %1
Expand Down

0 comments on commit 8cd2aad

Please sign in to comment.