Warning, /education/gcompris/src/activities/geo-country/MapSources/sources is written in an unsupported language. File is not indexed.

0001 maps reference sources
0002 
0003 All the maps (except romania-historical and lithuania-cultural) were created based on data from OpenStreetMap (downloaded with https://osm-boundaries.com/ in EPSG:4326 coordinates), converted to country-specific projections using reproject (https://www.npmjs.com/package/reproject), converted to svg with geojson-to-svg (https://www.npmjs.com/package/geojson-to-svg), and then heavily edited in Inkscape.
0004 
0005 romania-historical map was based on https://commons.wikimedia.org/wiki/File:Romania_historic_regions.svg (CC-BY-SA 3.0 Unported license, by Andein), with heavy editing in Inkscape.
0006 
0007 lithuania-cultural map was based on https://commons.wikimedia.org/wiki/File:Liet-etno-regionai.png (public domain license), with heavy editing in Inkscape.
0008 
0009 
0010 ***
0011 
0012 Steps to create country regions map:
0013 
0014 -Get the map coordinates from https://osm-boundaries.com/
0015 (select country, admin level min and max 4, file format GeoJSON, SRID: 4326, Land only, Simplify: Even less (0.01))
0016 
0017 -extract the *.geojson.gz file to *.geojson
0018 
0019 -find the best projection available for your country in https://epsg.io or https://spatialreference.org/
0020 
0021 -convert the .geojson file to the selected projection with reproject from https://www.npmjs.com/package/reproject (replace EPSG:3857 by the code of the projection you selected; check the manual of reproject for more details)
0022 example:
0023 cat OSMB-myFile.geojson | reproject --use-epsg-io --from=EPSG:4326 --to=EPSG:3857 > countryName.geojson
0024 
0025 -convert the resulting .geojson file to svg with geojson2svg from https://www.npmjs.com/package/geojson-to-svg
0026 example:
0027 ./geojson2svg --input countryName.geojson > countryName.svg
0028 
0029 -open the svg file in inkscape
0030 
0031 -first step is to change the document Width and Height to 500 px, the Scale X and X to 1.0, the Viewbox X and Y to 0.0 and the Viewbox Width and Height to 500px
0032 
0033 -select everything (ctrl + a) , lock the size ratio in the top bar and set the biggest side (width or height) to 480px
0034 
0035 -use the menu View - Zoom - Zoom Selection
0036 
0037 -as the converted svg appears to be upside down, press v key to mirror everything vertically
0038 
0039 -set the document size again to adjust the width or height (example: if the content is 480px width and 203px height, set the document height to 230px, that is at least 20px more than the content height and rounded to the next tens.)
0040 
0041 -with everything selected, center the content vertically and horizontally inside the document page
0042 
0043 -if needed, use again the menu View - Zoom - Zoom Selection
0044 
0045 -create a new layer named [back]country_name
0046 
0047 -cut all the content, and paste it in place in the new layer
0048 
0049 -set the contents style: fill color pure white (#ffffffff), and the outline size 0.5px and color #505050ff
0050 
0051 -ungroup (shift+g) the content to get separate regions as single items
0052 
0053 -for each region: create a new layer, name it with the region's name, cut the region from the back layer (ctrl+x) and paste it in place in the new layer (ctrl+alt+v)
0054 
0055 -select all the objects, and remove their outline
0056 
0057 -hide all the layers, and then for each layer, make it visible, and at zoom level between 200% and 300% (adapt to get the level of detail you want, but most importantly use the same zoom level for all the regions, and don't use a zoom level higher than 300% to keep the result small enough) use the fill tool on the region's shape to create a new shape for it, more simplified (this is needed as the imported shapes are often too heavy and not very optimized; the fill tool helps here to create a new shape more optimized while keeping the shape similar enough). NOTE: if a region is made of several shapes, fill them all, then select them all and join the shapes (with ctrl++). Fill Tool tips: first in the document settings, set the background color to a dark grey; then when using the fill tool, set its settings to Fill by: Alpha, Threshold: 50, Grow/shrink by:0, Close gaps: None
0058 
0059 -delete all the original imported shapes (tip: select the newly created shape, move it down with the button "Lower selection to bottom (End)", select the original shape that is now on top and delete it.)
0060 
0061 -select all the shapes, and set their fill color to #e77936ff, and their outline size to 0.5px and color to #505050ff.
0062 
0063 -select one shape after the other, and change their color by just shifting their hue (in Fill Flat color, with HSL selected, move the H slider) to get different colors for each region. You can also at some point increase a bit the L slider to get more variations with lighter colors.
0064 
0065 -on the [back] layer, create a rectangle of the same size as the document, without outline, and position it at 0,0 coordinates, and set its fill color to mid grey (#808080ff)
0066 
0067 -copy all the shapes, select the [back] layer and paste them all in place, and set their fill color to #ffffffff
0068 
0069 -Save the file as inkscape compressed svgz
0070 
0071 -install the inkscape extension "Export Layers GCompris", and use it to export all the layers to separated svg files and a text file with the coordinates for each region (they will be found after export in ~/.config/inkscape/extension/layers/ )
0072 
0073 -optimize all the exported .svg files using svgo from https://www.npmjs.com/package/svgo
0074 example: svgo -f /path/to/svg/folder output/folder/
0075 
0076 -copy the script convertSvgToSvgz.sh inside the output folder and run it to convert all optimized svg to svgz, then do rm -f *.svg to delete the svg and keep only the svgz files
0077 
0078 -copy the source svgz file (with all the map and regions) in MapSources in geo-country, and copy the exported separated layer svgz files to a folder with the country name in resources
0079 
0080 -create a board file for the country (look at other board files to copy the structure), and use the coordinates from the text file for each region
0081 
0082 
0083