Management of geographical map - Add an IRIS level

Last modified by Aurelie Bertrand on 2020/10/01 17:27

Convert the files .shp and .shx in svg

  1. Stop tomcat server
  2. Recover a background map for each city sliced in IRIS
  3. For each background map (= 1 file .shp and 1 file .shx), place them in the folder install_dd/addons/importfromgis
     Rename the files input.shp and input.shx
     Use the command :
    java -jar importfromgis.jar -i input.shp input.shx -o output.svg
  4. Open each svg file with InkScape.
    Click on Edit then XML Editor
    Press Ctrl+A (Select all), then in the Object menu, click on Ungroup.
    Repet the previous step as often as necessary
    Goal is to unravel, like in the screenshot below, all the <svg:path id=”pathxx”> at the 2nd incrementation level (under the tag <svg:svg id=”svgxxxx”>)
    https://lh5.googleusercontent.com/2bf-1C6idaEhNibbleArk1eF994tg6Mq7DiiCiRYRTEoeddw9iTVibOFGdtVJ22ymT4HCi6WDL_ApF1EEw9ohceab1nkbhiHj-uSxLZcurxHL7CPP3c1EgFKetX5QqQ8ypDQoo7FEkI
  5. Once ungrouped, for every output.svg, place the files in the folder : install_dd/addons/custommap
    Rename the file output.svg in input.svg
    Run convert_maps.bat
    A folder output is created. Retrieve every file in output/svg and rename it with the INSEE code of the city. Ex : fr-13000-iris.svg
  6. Open every fr-xxxxx-iris.svg, with InkScape.
    Click on Edit then XML Editor.
    Edit each id with the tag : <svg:path id=”pathxx”>  with the IRIS id (that will be recognize in the data)
    Ex : <svg:path id=”fr-13000-iris-1”>
  7. Once you've retrieved all city map, place them in a folder named IRIS.
    Copy the IRIS folder in :
    install_dd\apache-tomcat\webapps\ddenterpriseapi\staticwebcontent\charts\template\svg\map
    install_dd\apache-tomcat\webapps\ddenterpriseapi\WEB-INF\classes\resources\charts\template\svg\map
    install_dd\apache-tomcat\webapps\digdash_dashboard\staticwebcontent\charts\template\svg\map
  8. Edit maprepository.xml in the folder : install_dd\apache-tomcat\webapps\ddenterpriseapi\WEB-INF\classes\resources\config
    Add a tag <groupmap></groupmap> like shown below :
    <groupmap id="mapworld-template-iris" name="$ui.Geographic-iris" xmldata="mapworld-data-city.xml">
      <map name="continent" displayName="$ui.continent" level="0" file="earth-l1"/>
      <map name="country" displayName="$ui.country" level="1" file="earth/%continent%-l1"/>
      <map name="state" displayName="$ui.state" level="2" file="earth/%continent%/%country%-l1" conflictSolver="parentISO"/>
      <map name="county" displayName="$ui.county" level="3" file="earth/%continent%/%country%/%state%-l1"/>
      <map name="city" displayName="$ui.city" level="4" file="commune/%county%-city"/>
      <map name="iris" displayName="$ui.iris" level="5" file="IRIS/%city%-iris"/>
    </groupmap>
  9. Edit mapworld-data-city.xml :
    Look for the tag : <item id="fr-13"> (for the Bouches-du-Rhône in France for instance)
    For every city tag, add a new level of incrementation matching all the IRIS for this city.
    Example :
    <item id="fr-13">
    <item id="fr-13001" >
     <item id="fr-13001-iris-1" map="no" />
    <item id="fr-13001-iris-2" map="no" />
    <item id="fr-13001" >
    <item id="fr-13002" >
     <item id="fr-13002-iris-1" map="no" />
    <item id="fr-13002-iris-2" map="no" />
    <item id="fr-13002" >
     ...
  10. Restart Tomcat.

When creting a map graph, choose in parameters -> Additional configuration the map matching the new IRIS mapping :
https://lh3.googleusercontent.com/qkMf_ti9Y8vLn-7Xxqn0k0mXDjrW4Ku3DRQ-Vmw0tCYz7AUbs7hNos56-mD0vlrYTr6XPCp0C_Lav-p6Nx7UoWKzt9HoIppMyc01QAP71AS0B3x4TOPeJxdNMobwOCtyFFlS65IYGAw