Author Topic: The input CSV files-2  (Read 2716 times)

PeterC

  • Administrator
  • Member
  • *****
  • Posts: 483
  • Passionate about my one-place study
    • View Profile
    • Holywell-cum-Needingworth History
The input CSV files-2
« on: 21 January 2018, 15:21:05 »
Note that this is mostly for technical information.
It is the second part of the document about the input csv files.


For each OPS in M4OPS

Input files
All files are in csv format using semi-colon ";", rather than comma, as the separator. No fields can have semi-colons within them, but they can have commas. (On Peter's PC all csv files are within eg \OPS\HcN Holywell-cum-Needingworth\FLG\.)

Every file has field names in its first row, and these field names must be as specified (in the correct case). No quotes are needed for field names or values. Any null or blank values should be left null, ie represented as ;;.

Any blank lines, any starting with the word “Comment”, and any starting with the first field name (thereby allowing a repeat of the first row of field names), are ignored. If you use Excel for accuracy then ensure that the delimiter is set to ";".

These csv files are used to generate geojson and json files, which are what M4OPS to use directly as its input.

Further optional files are:
  • Features.csv - a list of all the features known to the OPS (which can then be referred to by Feature Layers)
    • It must have the following fields
      • featureid - string value by which this feature is referred
      • shorttext - name of the feature, displays on the map when resolution is OK, and in the display panel
    • It must also have one of the following geometries
      • a pair of coordinates corresponding to a point
        • Lat(Y) - numeric (eg 52.32)
        • Lon(X) - numeric (eg -0.03)
      • a geometry specification, comprising:
        • GeomType - Point, LineString, or Polygon
        • GeomCoords - a CoordinateString, eg:
          • for a Point: [-0.03, 52.32]
          • for a LineString: [[30, 10], [10, 30], [40, 40]]
          • for a Polygon: [[30, 10], [10, 30], [40, 40], [30, 10]]
        • always Lon/Lat in decimal degrees - known as EPSG:4326
        • see https://en.wikipedia.org/wiki/GeoJSON for other examples
      • Note that the following are the same point:
        • Lat(Y)=3 and Lon(X)=5
        • GeomType=Point and GeomCoords=[5,3]
      • Note also that we use the field name Lat(Y) for latitude to remind ourselves that in mathematics this is the Y-axis, and similarly Lon(X) as longitude is the X-axis
    • It can have any of the following fields (these correspond to those listed under the PROPERTIES for the GeoJSON file, and become the defaults for all Feature Layers)
      • description - html that displays in the display panel, (default is shorttext)
      • datestart - date from which this feature is to be shown in ISO Format - YYYY-MM-DD, eg 1888-03-25, or 1910 (default 0000-01-01)
      • dateend - date after which this feature is not to be shown (ditto) (default 9999-12-31)
      • internalnote - for internal use eg as a reminder – not displayed anywhere
      • fl_col1 - used as the value in the first column in the feature list, if undefined shorttext is used
      • fl_col2 - used as the value in the second column in the feature list
      • fl_col3 - used as the value in the third column in the feature list
      • textforsort - used for sorting the feature list, if undefined then the value of fl_col1 is used
      • image - the relative filename of an image associated with the Feature (in the Images subfolder)
      • html - the relative filename of a web page associated with the Feature (in the HTML subfolder)
      • pin - pin number - see the available pin styles
      • symbol - name of the icon to use - see the available A-M and N-Z icons
      • color - colour of the circle - see the full range of colours available (default is red)
      • radius - size in pixels of the (filled) circle (default is 5)
  • People.csv - a list of all the people known to the OPS (which can then be referred to by Feature Layers)
    • It must have the following fields
      • personid - string value by which this person is referred (becomes xrefid in the JSON file)
      • shorttext - name of the person (becomes xl_col1 in the JSON file)
    • It can have any of the following fields
      • textforsort - if undefined xl_col1 (shorttext ) is used
      • xlhint -  the hint on hover over the person in the list (eg Birth)
      • datestart - date (eg Birth) from which this person is to be shown in ISO Format - YYYY-MM-DD, eg 1888-03-25, or 1910 (default 0000-01-01)
      • dateend - date (eg Death) after which this person is not to be shown (ditto) (default 9999-12-31)
      • image - the relative filename of an image associated with the Person (in the Images subfolder)
  • Abbreviations.csv - a list of all the abbreviations specific to this OPS (in addition to the standard abbreviations specified in M4OPS.json)
    • It must have the following fields
      • abbcode - the text to be replaced (by convention usually starts and ends with '#')
      • abbhtml - the text by which it is to be replaced
  • Exclusions.csv - a list of all the layers from the Area of the OPS that should be excluded
    • It must have the following fields
      • category - of the layer to be excluded
      • title - name of the layer to be excluded
For more input csv files see The input CSV files and The input CSV files-3
« Last Edit: 8 July 2018, 09:55:08 by PeterC »