Skip to content

Instantly share code, notes, and snippets.

@LarsSchy
LarsSchy / point_examples.map
Created February 26, 2022 17:40
Examples for Mapserver point symbology
MAP
#
# Lars Schylberg, 2021-02-26
#
#
NAME "point_examples"
EXTENT 0 0 15 10
SIZE 400 300
UNITS DD
IMAGECOLOR 200 200 200
@LarsSchy
LarsSchy / layer_comp.map
Created February 23, 2022 15:00
Testing "Chainable Compositing Filters"
MAP
#
# layer_comp.map
#
# Lars Schylberg, 2022-02-23
#
# Testing "Chainable Compositing Filters" from RFC113
#
# Test command: map2img -m layer_comp.map -o layer_comp.png
# tested with: MapServer version 7.7-dev, but should work with 7.4 and 7.6
@LarsSchy
LarsSchy / Norway_label.png
Last active February 23, 2021 18:55
skeletonize MS ticket 5854
Norway_label.png
@LarsSchy
LarsSchy / test_swedish_text.sh
Created January 28, 2021 19:43
Test case for mappyfile validate
#!/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
@LarsSchy
LarsSchy / style_test.map
Created September 15, 2020 08:29
Example how to set up named styles in Mapserver
MAP
# Style test mapfile, how to set up named styles in mapserver
#
# Lars Schylberg, 2020-09-15
#
# example: root layers access: LAYERS=ST&styles=color&
# individual layers: LAYERS=square,circle&styles=green,grey&
# default: LAYERS=ST&styles=&
# or LAYERS=ST&styles=default&
# Gives correct GetCapabilities response
#!/bin/bash
#
# palette_reclass.sh
# Lars Schylberg, 2020-01-03
#
# example how to reclass a tif palette image with gdal_calc
# and some glue with awk and sed
#
# land 59,89,95,255 and / or 60,89,96,255 ---> 1
#!/bin/bash
#
## showing usage of shp2tile, to create smaller shape files and tile index files for usage in Mapserver
#
## .............
# Split large shapefiles with shp2tile into quad structure
# Select shape files greater than 20 MB
if [ ! -d ${FULL_DIR_FINAL}/tindex ] ; then
echo "mkdir ${FULL_DIR_FINAL}/tindex"
@LarsSchy
LarsSchy / road_shields_13_fast_MS_syntex.map
Created August 23, 2019 08:43
Road Shields placement fast MS syntax
LAYER
MAXSCALEDENOM 131072
MINSCALEDENOM 65536
NAME 'Roads_shields_13'
TYPE LINE
DATA "fk/vl_riks_rs_13-19"
GROUP "roads"
PROJECTION
"init=epsg:32633"
END
@LarsSchy
LarsSchy / road_shields_13_fast_scribe_syntax.map
Created August 23, 2019 08:41
Road Shields placement fast scribe syntax
LAYER {
13-19 {
NAME: 'Roads_shields'
TYPE: LINE
DATA: "fk/vl_riks_rs_13-19"
GROUP: "roads"
@SE_layerconfig
METADATA {{
"ows_group_title" "roads"
@LarsSchy
LarsSchy / road_shields_13_long_version_scribe_syntax.map
Created August 23, 2019 08:40
Road Shields placement long scribe syntax
LAYER {
13-19 {
NAME: 'Roads_shields'
TYPE: LINE
## CONNECTIONTYPE: ogr
## CONNECTION: "fk/fk_vl_riks.sqlite"
## PROCESSING: "CLOSE_CONNECTION=DEFER"
DATA: "fk/fk_vl_riks3"
GROUP: "roads"
@SE_layerconfig