'\" -*- coding: UTF-8 -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH shp2img 1 "20 August 2021" "" "" .SH NAME shp2img \- create a map image from a mapfile .SH SYNOPSIS 'nh .fi .ad l \fBshp2img\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \fB-m\fR \fImapfile\fR [\fB-o\fR \fIimage\fR] [\fB-e\fR \fIminx\fR \fIminy\fR \fImaxx\fR \fImaxy\fR] [\fB-s\fR \fIsizex\fR \fIsizey\fR] [\fB-l\fR " \fIlayer1\fR [\fIlayer2\fR...]"] [\fB-i\fR \fIformat\fR] [\fB-all_debug\fR \fIn\fR] [\fB-map_debug\fR \fIn\fR] [\fB-layer_debug\fR \fIlayername\fR \fIn\fR] [\fB-p\fR \fIn\fR] [\fB-c\fR \fIn\fR] [\fB-d\fR \fIlayername\fR \fIdatavalue\fR] 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBshp2img\fR creates a map image from a mapfile. Output is either PNG or GIF depending on what version of the GD library is used. This is a useful utility to test your mapfile. You can simply provide the path to your mapfile and the name of an output image, and an image should be returned. If an image cannot be created an error will be displayed at the command line that should refer to a line number in the mapfile. .SH OPTIONS .TP \*(T<\fB\-m\fR\*(T> \fImapfile\fR Map file to operate on - required .TP \*(T<\fB\-i\fR\*(T> \fIformat\fR Override the IMAGETYPE value to pick output format .TP \*(T<\fB\-o\fR\*(T> \fIimage\fR Output filename (STDOUT if not provided) .TP \*(T<\fB\-e\fR\*(T> \fIminx\fR \fIminy\fR \fImaxx\fR \fImaxy\fR Extents to render .TP \*(T<\fB\-s\fR\*(T> \fIsizex\fR \fIsizey\fR Output image size .TP \*(T<\fB\-l\fR\*(T> \fIlayers\fR Layers to enable - make sure they are quoted and space separated if more than one listed .TP \*(T<\fB\-all_debug\fR\*(T> \fIn\fR Set debug level for map and all layers .TP \*(T<\fB\-map_debug\fR\*(T> \fIn\fR Set map debug level .TP \*(T<\fB\-layer_debug\fR\*(T> \fIlayername\fR \fIn\fR Set layer debug level .TP \*(T<\fB\-c\fR\*(T> \fIn\fR Draw map \fIn\fR number of times .TP \*(T<\fB\-p\fR\*(T> \fIn\fR Pause for \fIn\fR seconds after reading the map .TP \*(T<\fB\-d\fR\*(T> \fIlayername\fR \fIdatavalue\fR Change DATA value for layer .SH EXAMPLE \fBExample #1\fR .PP .nf \*(T< shp2img \-m vector_blank.map \-o test.png \*(T> .fi Result: .RS A file named 'test.png' is created, that you can drag into your browser to view. .RE .PP \fBExample #2\fR .PP .nf \*(T< shp2img \-m gmap75.map \-o test2.png \-map_debug 3 \*(T> .fi Result: .RS A file named 'test2.png' is created, and layer draw speeds are returned such as: .RE .PP .nf \*(T< msDrawRasterLayerLow(bathymetry): entering msDrawMap(): Layer 0 (bathymetry), 0.601s msDrawMap(): Layer 3 (drain_fn), 0.200s msDrawMap(): Layer 4 (drainage), 0.300s msDrawMap(): Layer 5 (prov_bound), 0.191s msDrawMap(): Layer 6 (fedlimit), 0.030s msDrawMap(): Layer 9 (popplace), 0.080s msDrawMap(): Drawing Label Cache, 0.300s msDrawMap() total time: 1.702s msSaveImage() total time: 0.040s \*(T> .fi .PP \fBExample #3\fR .PP .nf \*(T< shp2img \-m gmap75.map \-o test3.png \-all_debug 3 \*(T> .fi Result: .RS A file named 'test3.png' is created, layer draw speeds are returned, and some warnings that index qix files are not found, such as: .RE .PP .nf \*(T< msLoadMap(): 0.671s msDrawRasterLayerLow(bathymetry): entering. msDrawGDAL(): src=72,417,3077,2308, dst=0,0,400,300 msDrawGDAL(): red,green,blue,alpha bands = 1,0,0,0 msDrawMap(): Layer 0 (bathymetry), 0.090s msSearchDiskTree(): Search returned no results. Unable to open spatial index for D:\ems4w\eapps\egmap\ehtdocs/.\e../data/drain_fn.qix. In most cases you can safely ignore this message, otherwise check file names and permissions. msDrawMap(): Layer 3 (drain_fn), 0.010s msDrawMap(): Layer 4 (drainage), 0.050s msSearchDiskTree(): Search returned no results. Unable to open spatial index for D:\ems4w\eapps\egmap\ehtdocs/.\e../data/province.qix. In most cases you can safely ignore this message, otherwise check file names and permissions. msDrawMap(): Layer 5 (prov_bound), 0.030s msSearchDiskTree(): Search returned no results. Unable to open spatial index for D:\ems4w\eapps\egmap\ehtdocs/.\e../data/fedlimit.qix. In most cases you can safely ignore this message, otherwise check file names and permissions. msDrawMap(): Layer 6 (fedlimit), 0.010s msDrawMap(): Layer 9 (popplace), 0.010s msDrawMap(): Drawing Label Cache, 0.201s msDrawMap() total time: 0.401s msSaveImage() total time: 0.010s shp2img total time: 1.082s \*(T> .fi