Import Controls/Courses from KML, GPX or IOFXML V3/V2.0.2 files into PurplePen
This is a Beta (26 Jan 2024). Added more flexibility on what Special-Objects to keep when using a PPEN template.
Use at your own risk (although not much can go wrong other than it doesn't work)!
Known issues: I have some issues with dealing with special characters (such as ampersands in course names) but I think I have it fixed.
If you run into an issue either reported through this interface or when you
try to open a resulting PPEN file, please let me know. In most cases it can be patched by editing either to control list file or the
resulting PPEN file using a good text editor (remove/replace special characters).
Depending on the scale of the underlying map and the (unknown to the app) scale of the course, you may see some courses have very large or small
circles etc. Just go to the Course properties menu and select the correct scale for the course.
Note: KML output from the other apps (that produce KMLs) can be used with this app to produce a draft PPEN file!
If you are using this app I'd love some feedback on how it works, issues, requests etc. contact email is on the main index page. Thanks!
Instructions:
Select the file that contains the list of controls (KML, IOFXML V3 or 2.03, GPX file such as from PPEN).
If using an IOFXML V3 or V2.0.3 file, generally leave the default 'Use Embedded X,Y' as Use
(note that this is the forced setting for IOF/XML V2.03 files as they may use UTM coordinates and I have not played with handling these).
Select Course options - whether or not to also import any courses contained in the XML. Applicable only to IOFXML files.
In general the app should be able to tell if it is a Pt to Pt or Score course and set it accordingly. if it is incorrect, just edit the course type in PPEN.
Optional - select a current PPEN file as a template (the original WILL NOT be overwritten). This uses this selected PPEN file as a template and
imports the Controls (and courses if applicable), stripping out the original controls and courses but
retaining the Event Map selection and any special items (depending on option selected). Note - this DOES NOT overwrite the original!
PPEN Special-Objects are added items such as text, images, out-of-bound areas etc. Within PPEN these can be applied against all courses (including the 'All Controls' window),
only the 'All Controls' window, or specific individual courses. Normally the default will be fine but if a PPEN event had a large number of Special-Objects issues to
specific courses, it could be messy importing them all, especially as the final courses may be different than the original template contained.
Special-Objects Options:
- Marked for All Courses or the 'All Controls' window (default): This will import any Special-Objects originally assigned to the All or the single 'All Controls' course.
- Marked for All Course: This will import any Special-Object that was marked to show on all the courses including the All Controls 'course'.
- Marked for All or any individual course: This will import those marked for All and take any originally assigned to a specific course and re-assign it to the All Controls 'course'.
- None: This will remove all Special-Objects.
- All: This will import all the Special-Objects. Warning as this might cause issues with objects assigned to courses that do not exist.
Hit 'Upload and Prepare' and wait for the 'Download' page to appear. This will show the basic settings, display the list of controls and show the Download Button.
Select Download to download the new PPEN file. The file name for the download will be the same as the original file name you uploaded with '_Temp.ppen'
added. This should open in PPEN as per normal. The new
controls will be shown in the PPEN window ready to be aligned to the map using the new PPEN built in function.
If you did not use a
template, add a map file (image, OCAD etc) as per normal.
Default location of the controls within the window will place the first control in the list at 0,0 (bottom left of the map coordinates).
be offset a bit from the map image - if so scroll out a bit.
Use Move/Scale/Rotate function if needed (under the Event menu) to adjust the controls to the corresponding map correctly.
Likely you will need to use the Move/scale option (which needs you to know the location of two controls) although I generally just select to do all three (still need two controls).
In some cases, if you use the same map file (OOM, OCAD) as the original controls came from (using a IOFXML file), the controls will end up properly placed!
If you don't have a separate map of control locations to assist with the re-alignment, one trick is to use the 'Convert IOFXML to KML' app on the main page.
This will produce a KML that can be loaded into Google Earth that can be used to select two easily located controls.
Backgound:
With the latest Purple Pen 3.5.0 Course setting application (PP), there is a function,
allowing you to Move, Scale and Rotate all the controls. This app will import a set of controls from a KML, IOFXML or GPX file and use the contained Map coordinates (lon, lat or mapY, MapY)
to build a starting PPEN file where the imported controls are correctly spaced and can easily be moved, scaled and/or rotated to fit a underlying map file. Examples:
- From a previous event you have a KML list of controls and a map image that you want to use to make new courses in PP.
- You have a OCAD or OOM map file and a previously produced IOFXML V3 course file but you need to set new or edit courses/Controls in PP.
- You have made a course or set up a bunch of controls in OpenOrienteeringMap (a great tool!!) but realize you
want to make more complex courses by producing a PDF map from OOMap (or producing a geo-referenced OCAD - I have fairly easy instructions on how to do this) and then using
these and the original control locations in PP without manually redoing them all.
Limitations:
The app will read a list of controls from a number 0f formats and file types that are commonly used for control lists,
but I cannot test for everything.
- KML file designed to be used with MapRun. This includes those produced by PurplePen, OpenOrienteeringMap and from my other apps.
If it works with MapRun it should work here.
- IOFXML course files from either the older V2.0.3 or the current V3 format. I have tried to capture a bunch of variations that I have seen produced
through Condes, PPEN etc but suspect there are others that may fail. The V3 format generally includes Lon/Lat and the MapXY coordinates - if available the default is to use the MapXY values as they are already
available directly.
- A GPX file produced by some applications contains a list of waypoints that can be converted to PPEN Map coordinates.
If this also includes one or more course tracks, these are ignored
- Currently only courses from within an IOFXML V3 or V2.0.3 will be pulled out.
- If not selecting a PPEN Template file, the PPEN file produced (the original IS NOT overwritten) will open within PPEN and show all the controls
but does not contain a map - this needs to be added at this stage through the Event-Map File menu.
If you use a PPEN Template, the copy will be stripped of controls, courses and special items that applied only to a specific course. The new controls will be added
and any map file related to the template will remain.
- As the control files do not contain any description data, unfortunetly you will need to add all this! In addition, some things that you might find in the course file
(especially an IOFXML) may not get mapped back into a template PPEN due to complexity
- There is often more information in a PPEN file that is contained in the imported course file so do not expect a perfect set of courses
- I currently provide only a fixed scale for the controls starting at 0,0 on the map. There will be some occasions where this will spread the controls over an area on
the map that is more difficult to deal with initially. I will provide a bit more flexibility in the future. Note that you can do a 'Move' function in PPEN first to adjust the start point, then do
anothe Move/Scale/Rotate.
This tool is offered as is with no guarantees so use at your own risk.