shp2img(1)
π shp2img(1) π
okay so bestie, pull up a chair πͺ because this is shp2img(1), and it's genuinely one of the most useful little utilities in the whole MapServer world. it's giving "quick lil command, big main character energy" β¨
β¨ NAME β¨
shp2img β create a map image from a mapfile πΊοΈ
πΈ SYNOPSIS πΈ
shp2img -m mapfile [-o image] [-e minx miny maxx maxy] [-s sizex sizey]
[-l " layer1 [layer2...]"] [-i format] [-all_debug n]
[-map_debug n] [-layer_debug layername n] [-p n] [-c n] [-d
layername datavalue]
π¦ DESCRIPTION π¦
so shp2img creates a map image from a mapfile. literally its whole job. π
the output is either PNG or GIF, and which one you get depends on what version of the GD library is being used. no cap, that's just how it is.
this is a super useful utility to test your mapfile β like, if your mapfile is acting up and you don't know why, this is your girl. you can simply provide the path to your mapfile and the name of an output image, and an image should be returned. iconic behavior. π
and 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 π which is honestly so helpful of it. periodt.
π OPTIONS π
-mmapfile β Map file to operate on β required π (you cannot skip this one, she is mandatory fr fr)-iformat β Override theIMAGETYPEvalue to pick output format β¨-oimage β Output filename (STDOUTif not provided) π€-eminx miny maxx maxy β Extents to render πΊοΈ-ssizex sizey β Output image size π-llayers β Layers to enable β make sure they are quoted and space separated if more than one is listed π (this is the part where everyone messes up, don't be that girl)-all_debugn β Set debug level for map and all layers π-map_debugn β Set map debug level π-layer_debuglayername n β Set layer debug level π-cn β Draw map n number of times π-pn β Pause for n seconds after reading the map βΈοΈ-dlayername datavalue β ChangeDATAvalue for layer π§
π EXAMPLE π
Example #1
shp2img -m vector_blank.map -o test.png
Result: a file named 'test.png' is created, that you can drag into your browser to view. πΌοΈ slay.
Example #2
shp2img -m gmap75.map -o test2.png -map_debug 3
Result: a file named 'test2.png' is created, and layer draw speeds are returned such as:
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
Example #3
shp2img -m gmap75.map -o test3.png -all_debug 3
Result: a file named 'test3.png' is created, layer draw speeds are returned, and some warnings that index qix files are not found, such as:
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:\ms4w\apps\gmap\htdocs/.\../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:\ms4w\apps\gmap\htdocs/.\../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:\ms4w\apps\gmap\htdocs/.\../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
bestie note π«Ά β those msSearchDiskTree(): Search returned no results. Unable to open spatial index lines are literally the tool telling you "In most cases you can safely ignore this message, otherwise check file names and permissions." so don't spiral, just double check your filenames and perms if it's acting up π
okay that's the whole page!! go forth and test your mapfiles, you've got this π
πΈ this manual page is shp2img(1) and the version we're vibing with here is dated 07 February 2022 β mwah, kiss, bye bestie πβ¨
π¦ where this page comes from
- ubuntu jammy: mapserver-bin 7.6.4-2build2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms