collapse

M4OPS

For our prototype mapping system try the Demo at mapping4ops.org/M4OPS.

You can also see an overview of M4OPS on YouTube.

* Forum Staff

PeterC admin PeterC
Administrator
admin webmasterOPS
Administrator

Author Topic: Using The Journal by DavidRM as input to M4OPS  (Read 775 times)

PeterC

  • Administrator
  • Member
  • *****
  • Posts: 480
  • Passionate about my one-place study
    • View Profile
    • Holywell-cum-Needingworth History
Using The Journal by DavidRM as input to M4OPS
« on: 19 December 2017, 10:27:31 »
The Journal by DavidRM (TJ) is a fairly free format journalling system. Entries can either be linked to dates, or loose-leaf.

The following assumes that you have created a loose-leaf category (eg Directory) in The Journal (TJ) v7, with entries that are Roads, under which are subentries that are dwellings along that road. Each entry and subentry must be given a name and a reference (which should be a unique set of alphanumerics). The fact it is a reference (or id) is indicated by it either being enclosed in parentheses, or being preceded by #.

For example you could have (although consistent referencing would be better):
  • Albany Road #R1
    • 1 (24)
    • Owl House (21)
  • Beach Road #R3
    • 24a (SE2)
    • 24b (SE3)

Within M4OPS the dwellings will be called Entry (ref) - subentry (ref), or subentry, entry. The reason for the reference is just to make (sub)entries unique and clearly identified. Thus eg Owl House will be called "Albany Road #R1 - Owl House (21)", or "Owl House, Albany Road".

Within The Journal (TJ) each entry has a page where you can enter text, tables, images etc. The purpose of the process below is to make these pages available to M4OPS so you can see them when you hover over, or click on, a feature in M4OPS. It is best if you do not format your TJ pages too much as at the moment this can confuse M4OPS.

[Note that when we talk about HTML files below we include their associated image (jpeg) files.]

Broadly speaking the stages of the process are:
  • Create HTML files from The Journal (TJ)
  • Upload the HTML files to M4OPS
  • Create the list of features for M4OPS
  • Add the All Features layer
  • Upload and compile
  • Georeference the Features

Create HTML files from The Journal (TJ):
  • Create a folder for the HTML export to go into
  • Open The Journal (TJ)
  • File/Export/Export Entries to Document
  • Either:
    • Select the relevant category (eg Directory), and deselect the entries not wanted (eg templates), or
    • Select just the entries wanted from within the relevant category (eg Directory)
    • [Note that, if partially selected, to deselect the whole category you need to fully select it first]
  • Under Export Type
    • Select HTML
    • Make sure that "Export as a Web page with category & entry index" is not selected
    • Make sure that "Save CSS information in .html file" is not selected
    • [Note that these options, and those following, should carry over from the previous export]
  • Under Export Options
    • Select Create a File for each exported Entry
    • Make sure that "Include Category Name Header in export" is selected
    • Make sure that "Include Entry Date/Name Header in export" is selected
  • Under File Names
    • Enter the Category File Name as %c (eg “Directory”)
    • Enter the Entry File Name as %e (eg “Albany Road (R1)”)
    • Make sure that Include "Full Path" in Loose-Leaf Entry Names is selected (eg Albany Road (R1) - Owl House (21)
    • Enter the Export Path separator as  ‑  (ie blank, hyphen, blank)
  • Click on Export
  • When asked, browse to open the folder in which to put all the files (html and related images)
  • Click on Save
  • When it says Entries Exported, click on OK
  • You can now close The Journal (TJ)
[Note that at this point you can check individual exported HTML files by just opening them, but if their reference includes an # their associated image (jpeg) files will not appear. This is solved online by the processes below.]

Upload the HTML files to M4OPS
  • Use an FTP program (eg FileZilla)
  • On the server open the relevant OPS/HTML folder, and delete any files no longer needed
  • On your PC select all the files in the folder to which you exported from The Journal (TJ)
  • Upload all these (HTML and jpeg) files to the relevant OPS/HTML folder
  • [You can check individual uploaded HTML files within a browser, but again if their reference includes an # their associated image (jpeg) files will not appear.]

Create the list of features for M4OPS:
  • Open Karen’s Directory printer (can be downloaded free from here), and list files:
    • Select the Save to Disk tab
    • Select the folder specified above
    • Save Options: File info only
    • Ensure all other options (Search Sub-Folders etc) are not ticked
    • File info: ensure just File Name is ticked
    • File Filter: select Common HTML/Web files
    • Ensure the two Formatting options are ticked (Omit COMMENT lines, Omit FILE FOLDER and TOTAL Line ids)
    • Click on Save to Disk
    • When asked, browse to choose the folder in which to put the Directory Print (DirPrnInfo.txt)
    • You can now close Karen’s Directory printer
  • Open https://regexr.com/ - an online tool to learn, build, & test Regular Expressions
    • Copy the contents of DirPrnInfo.txt, and paste them into the Text area
    • Copy the following string and paste into the Expression area
      • (.+) - {0,}(.+)( [\(\#])(\w+)(\)*)(?:\.html)
      • [making sure the (default) /g flag is set]
      • [The groups are thus 1)Road 2)Dwelling 3)Prefix 4)Ref 5)Postfix]
    • In the Tools area, click on List
    • Copy the following string and paste into the List expression area
      • $4;$2, $1$3$4$5;;;;$&;$1 - $2;$2, $1;;;;\n
    • Copy the resulting list and paste it into a blank Features.csv text file
    • Insert at the top of this file:
      • featureid;shorttext;datestart;dateend;image;html;textforsort;fl_col1;Lon(X);Lat(Y);GeomType;GeomCoords (with a new line)
    • Open DirPrnInfo.txt in Notepad++ and replace the following:
      • (.+) - {0,}(.+)( [\(\#])(\w+)(\)*)(?:\.html)\r\n
      • by null
      • [making sure the Search Mode is set to Regular Expression]
      • [This removes all the lines we have just processed and leaves others]
    • The lines that remain are either Roads with valid references, or entries with invalid references
    • Copy any lines in DirPrnInfo.txt that are Roads with valid references into the RegExr Text area
    • Copy the following string and paste into the Expression area
      • (.+)( [\(\#])(\w+)(\)*)(?:\.html)
      • [again making sure the (default) /g flag is set]
      • [The groups are thus 1)Road 2)Prefix 3)Ref 4)Postfix]
    • In the Tools area, click on List
    • Copy the following string and paste into the List expression area
      • $3;$1$2$3$4;;;;$&;$1;$1;;;;\n
    • Copy the resulting list and paste append it to the Features.csv text file
    • Save Features.csv

See Compiling Features for the next stage.
« Last Edit: 12 April 2018, 12:38:42 by PeterC »

 

mapping4ops.org is a Society for One-Place Studies project supported by Grassroots Giving from Skipton Building Society
Glossary | BBCodes | Feedback