Creation of geographic maps

Last modified by jhurst on 2021/04/21 10:01

This document provides the information necessary to create additional maps in DigDash Enterprise.

A set of files is provided by DigDash to allow the creation of these cards:

  • map_name_helper_v6.xlsm
  • mapchart1-template-dashboard_canvas.html
  • mapchart1-template-dashboard_svg.svg
  • mapchart1-template-dashboard_vml.html
  • vectortool.jar
  • convert_maps_dbf.bat
  • convert_maps.bat

These files are located in the add-ons / custommap directory.

If you wish to import your maps from GIS, an importfromgis.jar file can also be provided to you (contact us by email at support@digdash.com ).

  •  

Importing Maps from GIS

You can import your existing maps (shp files) using the command

java -jar importfromgis.jar -i inputfile.shp -o output.svg

Replace inputfile.shp with the name of your shp file and output.svg with the name of your output svg file.

Warning: you must place your inputfile.shx file in the same directory as inputfile.shp

card configuration

We recommend using the map_name_helper_v6.xlsm file .

Insert the different elements of your card in the src sheet (one element per line, overwrite the 1st line of the file)

The 1st column must contain the element's id (the id must be prefixed with the country code like FR for France.)

The second column should contain the name of the element from your dbf file.

Modifying the card definition file

Edit the apache-tomcat \ webapps \ ddenterpriseapi \ WEB-INF \ classes \ resources \ config \ mapworld-data.xml file

Add the contents of the sheet maplist.xml  file  map_name_helper_v6.xlsm  in  MapWorld-data.xml .

Attention: Attach your <item ...> sections to the correct parent.

Format of the “item” section:

  • id: (required) id used in the SVG card.
  • names: (optional) name of the file (.properties) containing the translations or variants for this id.
  • map: (optional) "no" when the element cannot be explored.

Create your ID mapping files

This optional file will allow you to find the different correspondences between the id used in the maps and your root members in the geographic dimension.

Copy the content of the -names.js sheet obtained in the map_name_helper_v6.xlsm  file into a file called <id_carte> -l1-names, js  .

This file must be copied in 3 different folders:

  • apache-tomcat\webapps\ddenterpriseapi\staticwebcontent\charts\template\
     scripts\mapnames\
  • apache-tomcat\webapps\digdash_dashboard\staticwebcontent\charts\template\
     scripts\mapnames\
  • apache-tomcat\webapps\ddenterpriseapi\WEB-INF\classes\resources
     \charts\template\scripts\mapnames

For each of these 3 folders, place the card in the sub-directory corresponding to the parent card.

Create your translation files

This optional file will allow you to find the different translations for the areas displayed on the map.

Copy the content of the .properties sheet obtained in the map_name_helper_v6.xlsm  file to the following location:

apache-tomcat\webapps\ddenterpriseapi\WEB-INF\classes\messages\<parentmap_or_specific>.properties

Warning :

  • Check the name of the parent .properties file     in mapworld-data.xml .
  • Add your own .properties files or the parent may be overwritten during the next product update.

Generation of map graphics files

Program required:

  • vectortool.jar   (provided by DigDash, requires a jre)

Required files:

  • mapchart1-template-dashboard_canvas.html
  • mapchart1-template-dashboard_svg.svg
  • mapchart1-template-dashboard_vml.html

Scripts required:

  • convert_maps_dbf.bat: .dbf files, including the com of card components are often provided with Shapefiles. Using the convert_maps_dbf.bat script allows you to associate the Ids of dbf to SVG forms in order.
  • Or convert_map.bat: if you are not using dbf files

Change the variables in the script file according to your settings.

Run the convert_maps_dbf.bat or convert_maps.bat script.

Deployment of CARDS

Copy the content of the output folder generated in step III in:

  • apache-tomcat\webapps\ddenterpriseapi\staticwebcontent\charts\template\
  • apache-tomcat\webapps\digdash_dashboard\staticwebcontent\charts\template\
  • apache-tomcat\webapps\ddenterpriseapi\WEB-INF\classes\resources\charts\template\