Skip to content

Instantly share code, notes, and snippets.

MAP
#
# Lars Schylberg - 2016-11-13
# Tests for hatch patterns and other area patterns in Mapserver
#
# Run tests with: shp2img -m polygon-examples-hatch.map -o polygon-examples-hatch.png -map_debug 5
#
NAME Polygon-examples-hatch
STATUS ON
@LarsSchy
LarsSchy / polygon_border_with_marker.map
Created October 12, 2017 07:36
Test with polygon border decorations with native symbol in Mapserver
MAP
#
# Lars Schylberg - 2017-10-12
# Test with polygon border decorations with native symbol in Mapserver
#
# Run tests with: shp2img -m polygon_border_with_marker.map -o polygon_border_with_marker.png
#
SIZE 800 500
IMAGETYPE png24
EXTENT -10 0 60 30
@LarsSchy
LarsSchy / polygon-fill-rgb.map
Last active March 29, 2018 10:39
Mapserver Easter Egg
MAP
#
# Some examples with color specified with negative values
# Lars Schylberg - 2016-11-03
#
# shp2img -m polygon-fill-rgb.map -o polygon-fill-rgb.png
#
NAME "polygon-fill-rgb"
STATUS ON
SIZE 800 600
@LarsSchy
LarsSchy / import_raster_retile_v3.sh
Created June 27, 2019 14:25
Example script to cut away nodata and create new tile index
#!/bin/bash
#
# import_raster_retile_v3.sh
#
# Convert and rewrite tif files with specified compression
# remove nodata parts.
# Create tile index for the new data set
#
# Lars Schylberg, Saab AB
# Date: 2019-01-30
@LarsSchy
LarsSchy / roadsigns_proc_fk.sh
Created August 23, 2019 08:35
Preprocess road data with extra attributes for road shields plancement
#!/bin/bash
#
# roadsigns_proc_fk.sh
#
# Preprocess road data with extra attributes for road shields plancement
#
# Author: Lars Schylberg, Saab AB
# Date: 2019-06-03
# MIT License
@LarsSchy
LarsSchy / road_shields_13_long_version_MS_Syntax.map
Created August 23, 2019 08:38
Road Shield placement MS long version
LAYER
MAXSCALEDENOM 131072
MINSCALEDENOM 65536
NAME 'Roads_shields_13'
TYPE LINE
# CONNECTIONTYPE: ogr
# CONNECTION: "fk/fk_vl_riks.sqlite"
# PROCESSING: "CLOSE_CONNECTION=DEFER"
DATA "fk/fk_vl_riks3"
GROUP "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
@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_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
#!/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"