Package: tourmapper
TourmapperWhat is this?This is a script for generating interactive maps from GPS tracking data and geo-tagged images (see an examplehere).Installationpip install tourmapperIf you get an installation error along the lines ofproj executable not found. Please set the PROJ_DIR variable. For more information see: https://pyproj4.github.io/pyproj/stable/installation.htmlthen there is an issue installing thepyprojpackage via pip. Installation via conda-forge may help correct this (conda install -c conda-forge pyproj), then re-attempt the originalpip install tourmapper. Alternatively,build pyproj from source.UsageThe script wrapsFolium/Leaflet, a very sophisticated library for producing interactive maps. Map generation is done using thetourmapper.make_map()function using the following arguments. There is some customisation that is possible, but for full control you may want to use those libraries directly (or edit this script).Required argumentsgps_dirstring path to directory containing.gpxfiles, all of which will be loaded in ascending date order. Each file will be a separate trace on the map.Optional argumentsoutpathstring path to save map as single.htmlfile, defaulttourmap.htmlmap_paramsdict containing map-specific arguments passed tofolium.Map()(see theFoliumorLeafletdocumentation)image_dirstring path to directory containing.jpeg/.jpgimages with GPS EXIF tags, all of which will added to the mapline_coloursstring, or list of strings which will be cycled, of colours to use when plotting each.gpxfile. These can either be simple names egredor hex colour code#3388ffride_textlist of strings, same length as number of.gpxfiles, of text to insert on the marker at the end of each file's trace on the map. HTML formatting will be respected.remote_image_urlstring URL stub for remote loading of images (see below section)image_widthdefault 500, popup size for landscape imagesimage_heightdefault 400, popup size for portrait imagesExample usageAn example with images and text descriptions can be foundhere.Map customisationSome useful arguments to customise the map (these must be wrapped up in themap_paramsdict):api_key,style,tiles: customising the basemap. Many options require a paid subscription (see the demoshere)attrthe text attribution shown in the bottom corner of the maplocation(latitude, longitude) coordinates to center the mapzoom_startinitial zoom level between 1 and 20 (far -> near)Local vs. remote imagesBy default, images are embedded directly within the HTML file containing the map. This means the map and images are completely self-contained within that single file, which makes it very easy to share, but the file size will be large if there are lots of images. If the file is hosted online the load time could be slow.The alternative to this is to add the images as remote objects. This keeps the file size down, because they are not embedded into HTML, but means you need somewhere to store the images remotely (a website, hosting service etc) from which they will be loaded on-demand. Remote images can be added using theremote_image_urlargument.ExampleTheimage_dircontains the imagesA.jpg,B.jpgandC.jpg. To insert them as remote images instead of local, first place them on a remote host (for example,yourwebsite.com/assets/images). Pass this URL as theremote_image_urlargument, and the images A,B,C will be inserted into the map with the following URLs:yourwebsite.com/assets/images/A.jpg,yourwebsite.com/assets/images/B.jpgetc.Note that the resultant mapcannot be viewed using Jupyter notebook(it must be viewed through a web browser for the associated JS to work).If you encounter problems with this functionality, the place to start is by ensuring you can actually access the remote image URLs that have been generated. For example, can you accessyourwebsite.com/assets/images/A.jpgfrom a web browser?Feedback and bug reportsPlease feel free to provide any feedback or bug reports on this repo.