Created
January 28, 2021 19:43
-
-
Save LarsSchy/27916c896d35a524a123b69e4dbdcb54 to your computer and use it in GitHub Desktop.
Test case for mappyfile validate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# test_swedish_text.sh | |
# Lars Schylberg, 2021-01-28 | |
# | |
# test Swedish 250K texts with attributes for FONT [FONTNAME], POSITION [MSPOS], | |
# also COLOR [TXTCLR] AND OUTLINECOLOR [OLNCLR] with transparent outline in second feature | |
# | |
# TEST: place the fonts DejaVuSansCondensed.ttf and DejaVuSerif-Italic.ttf into current dir. | |
# run: ./test_swedish_text.sh | |
# run: shp2img -m text_test.map -o text_test2.png -all_debug 5 - Gives correct image !!! | |
# | |
# mappyfile validate text_test.map -- Gives error about FONT and POSITION attribute | |
# | |
# | |
cat << EOF > test.geojson | |
{ | |
"type": "FeatureCollection", | |
"name": "tx_riks_ms", | |
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::3006" } }, | |
"features": [ | |
{ "type": "Feature", "properties": { "TEXT": "Hallen", "KKOD": 1, "KATEGORI": "Enstaka hus eller gård", "TJUST": 1, "TSPARR": 0, "TRIKT": 0.0, "MSPOS": "LR", "FONTNAME": "Sans-normal", "FONTSIZE": 16, "TXTCLR": "0 0 0", "OLNCLR": "#f5f5f5FF" }, | |
"geometry": { "type": "Point", "coordinates": [ 487343.79975, 7071752.2562499996275 ] } }, | |
{ "type": "Feature", "properties": { "TEXT": "Hällingsån", "KKOD": 92, "KATEGORI": "Vattendrag, litet", "TJUST": 1, "TSPARR": 0, "TRIKT": 285.47, "MSPOS": "CC", "FONTNAME": "serif-italic", "FONTSIZE": 14, "TXTCLR": "#0080e6", "OLNCLR": "#f5f5f580" }, | |
"geometry": { "type": "Point", "coordinates": [ 469361.4255, 7131312.858625 ] } } | |
] | |
} | |
EOF | |
cat <<EOFILE > epsg | |
# SWEREF99 TM | |
<3006> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> | |
EOFILE | |
cat <<EOFI > fonts.lst | |
Sans-normal DejaVuSansCondensed.ttf | |
serif-italic DejaVuSerif-Italic.ttf | |
EOFI | |
cat << EOF > text_test.map | |
MAP | |
NAME "TXT" | |
CONFIG 'PROJ_LIB' '.' | |
FONTSET 'fonts.lst' | |
IMAGETYPE png | |
MAXSIZE 6000 | |
SIZE 500 500 | |
UNITS meters | |
EXTENT 459361.425500 6971752.256250 497343.799750 7231312.858625 | |
SHAPEPATH "." | |
IMAGECOLOR "#C2D1B2" | |
PROJECTION | |
"init=epsg:3006" | |
END | |
SYMBOL | |
NAME "DOT" | |
TYPE ELLIPSE | |
FILLED TRUE | |
POINTS 1 1 END | |
END | |
LAYER | |
NAME "Text_test" | |
TYPE POINT | |
PROJECTION | |
"init=epsg:3006" | |
END | |
# ENCODING "ISO-8859-1" | |
CONNECTIONTYPE OGR | |
CONNECTION "test.geojson" | |
DATA "tx_riks_ms" | |
STATUS ON | |
LABELITEM "TEXT" | |
CLASS | |
STYLE | |
SYMBOL "DOT" | |
COLOR 255 0 255 | |
SIZE 10 | |
END | |
LABEL | |
FONT [FONTNAME] | |
TYPE truetype | |
COLOR [TXTCLR] | |
SIZE [FONTSIZE] | |
ANGLE [TRIKT] | |
PRIORITY 5 | |
POSITION [MSPOS] | |
PARTIALS FALSE | |
OUTLINECOLOR [OLNCLR] | |
OUTLINEWIDTH 4 | |
END | |
END | |
END | |
END | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment