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
- Stop tomcat server
- Recover a background map for each city sliced in IRIS
- 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 - 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”>) - 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 - 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”> - 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 - 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> - 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" >
... - Restart Tomcat.
When creting a map graph, choose in parameters -> Additional configuration the map matching the new IRIS mapping :