Wiki source code of Gestion des cartes géographiques - Ajout d'un niveau IRIS
Last modified by Aurelie Bertrand on 2020/10/01 17:27
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = Convert the files .shp and .shx in svg = | ||
2 | |||
3 | 1. Stop tomcat server | ||
4 | 1. Recover a background map for each city sliced in IRIS | ||
5 | 1. For each background map (= 1 file .shp and 1 file .shx), place them in the folder install_dd/addons/importfromgis | ||
6 | Rename the files input.shp and input.shx | ||
7 | Use the command : | ||
8 | {{code}}java -jar importfromgis.jar -i input.shp input.shx -o output.svg{{/code}} | ||
9 | 1. Open each svg file with InkScape. | ||
10 | Click on Edit then XML Editor | ||
11 | Press Ctrl+A (Select all), then in the Object menu, click on Ungroup. | ||
12 | Repet the previous step as often as necessary | ||
13 | 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”>) | ||
14 | [[image:https://lh5.googleusercontent.com/2bf-1C6idaEhNibbleArk1eF994tg6Mq7DiiCiRYRTEoeddw9iTVibOFGdtVJ22ymT4HCi6WDL_ApF1EEw9ohceab1nkbhiHj-uSxLZcurxHL7CPP3c1EgFKetX5QqQ8ypDQoo7FEkI||height="583" width="259"]] | ||
15 | 1. Once ungrouped, for every output.svg, place the files in the folder : install_dd/addons/custommap | ||
16 | Rename the file output.svg in input.svg | ||
17 | Run convert_maps.bat | ||
18 | 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** | ||
19 | 1. Open every** fr-xxxxx-iris.svg**, with InkScape. | ||
20 | Click on Edit then XML Editor. | ||
21 | Edit each id with the tag : **<svg:path id=”pathxx”>** with the IRIS id (that will be recognize in the data) | ||
22 | Ex : **<svg:path id=”fr-13000-iris-1”>** | ||
23 | 1. Once you've retrieved all city map, place them in a folder named IRIS. | ||
24 | Copy the IRIS folder in : | ||
25 | install_dd\apache-tomcat\webapps\ddenterpriseapi\staticwebcontent\charts\template\svg\map | ||
26 | install_dd\apache-tomcat\webapps\ddenterpriseapi\WEB-INF\classes\resources\charts\template\svg\map | ||
27 | install_dd\apache-tomcat\webapps\digdash_dashboard\staticwebcontent\charts\template\svg\map | ||
28 | 1. Edit maprepository.xml in the folder : install_dd\apache-tomcat\webapps\ddenterpriseapi\WEB-INF\classes\resources\config | ||
29 | Add a tag <groupmap></groupmap> like shown below : | ||
30 | {{code}}<groupmap id="mapworld-template-iris" name="$ui.Geographic-iris" xmldata="mapworld-data-city.xml"> | ||
31 | <map name="continent" displayName="$ui.continent" level="0" file="earth-l1"/> | ||
32 | <map name="country" displayName="$ui.country" level="1" file="earth/%continent%-l1"/> | ||
33 | <map name="state" displayName="$ui.state" level="2" file="earth/%continent%/%country%-l1" conflictSolver="parentISO"/> | ||
34 | <map name="county" displayName="$ui.county" level="3" file="earth/%continent%/%country%/%state%-l1"/> | ||
35 | <map name="city" displayName="$ui.city" level="4" file="commune/%county%-city"/> | ||
36 | <map name="iris" displayName="$ui.iris" level="5" file="IRIS/%city%-iris"/> | ||
37 | </groupmap>{{/code}} | ||
38 | 1. Edit mapworld-data-city.xml : | ||
39 | Look for the tag : <item id="fr-13"> (for the Bouches-du-Rhône in France for instance) | ||
40 | For every city tag, add a new level of incrementation matching all the IRIS for this city. | ||
41 | Example : | ||
42 | {{code}}<item id="fr-13"> | ||
43 | <item id="fr-13001" > | ||
44 | <item id="fr-13001-iris-1" map="no" /> | ||
45 | <item id="fr-13001-iris-2" map="no" /> | ||
46 | <item id="fr-13001" > | ||
47 | <item id="fr-13002" > | ||
48 | <item id="fr-13002-iris-1" map="no" /> | ||
49 | <item id="fr-13002-iris-2" map="no" /> | ||
50 | <item id="fr-13002" > | ||
51 | ...{{/code}} | ||
52 | 1. Restart Tomcat. | ||
53 | |||
54 | When creting a map graph, choose in parameters -> Additional configuration the map matching the new IRIS mapping : | ||
55 | [[image:https://lh3.googleusercontent.com/qkMf_ti9Y8vLn-7Xxqn0k0mXDjrW4Ku3DRQ-Vmw0tCYz7AUbs7hNos56-mD0vlrYTr6XPCp0C_Lav-p6Nx7UoWKzt9HoIppMyc01QAP71AS0B3x4TOPeJxdNMobwOCtyFFlS65IYGAw||height="258" width="309"]] |