PREV NEXT

Generic Logic, Inc. www.genlogic.com


GLG Map Server Reference Manual

Chapter 1 Introduction 21

Using the Map Server inside the GLG Drawing 21
Using the Stand-Alone Map Server 21

1.1 Overview 22

Map Server Executable 23

Tools and Utilities 23

Library Programming Interface 23

1.2 Using the Map Server: Logical Steps 24

Map Server Input: Managing Data 24

Requesting Maps 24

Map Server Output: Displaying a Map 25

GLG GIS Object 25

File Output 26

CGI Output 26

Map Server API 26

Chapter 2 Structure of Data and File Layout 27

2.1 Types of Data 27

Layers 27

Image Data 28

Vector Data 28

Attributes 29

Layer Attributes 29
Object Attributes 29

Fonts 30

2.2 Datasets, Layers, Tiles and Data 31

2.3 Configuration File Format 31

Datasets 32

GLM ROOT DIR=<dir> 33
LAYER DIR=<dir> 33
FONT DIR=<dir> 33
LAYER=<name> <lif> 33
ALIAS=<name> <value> 33
ZOOM FACTOR TYPE= <EXTENT or "EXTENT AND WIDTH"> 34
BASE WIDTH= <value> 34
VECTOR FONT=<font_name> <font_file> 34
IMAGE FONT=<font_name> <font_file> 34
FONT ALIAS=<font_alias_name> "<font_name>,<font_name>,..." 34
DEFAULT FONT=<font_name> 35
ERROR FONT=<font_name> 35
ENCODING=<UTF8 or LATIN> 35
ALLOW OVERRIDE=<0, 1 or 2> 35
MAX IMAGE TILES 35
MAX VECTOR TILES 35
GLYPH CACHE TYPE=<type> 36
MAX ITERATIONS=<number> 36

A Simple Example of an SDF file 36

Layers and Tiles 36

The Zoom Factor 37

Tiling 37

Configuration Variables 38

TYPE=<type> 38
DEFAULT ON=<0 or 1> 38
RELATIVE ZOOM=<0 or 1> 38
TRANS TYPE=<type> 39
TRANS COLOR=<r,g,b> 39
TRANS COLOR PRECISION=<value> 39
ELEVATION MODE=<mode> 40
ALPHA=<value> 40
ATTR COND=<value> 40
FILENAME=<file> 41
VECTOR FORMAT=<type> 41
FILTER=<file> 41
IMAGE FORMAT=<format> 42
IMAGE ANTIALISING=<0 or 1> 42
FALLBACK LAYER=<layer name> 42
FALLBACK=<file>        (deprecated: use FALLBACK LAYER) 43
MAX TILES=<number> 43
MAX CACHE SIZE=<number> 43
NUM TILES X=<number> 43
NUM TILES Y=<number> 43
MIN PIXEL SIZE=<number> 43
CLIP=<0 or 1> 44
VOLATILE=<0 or 1> 44
LOCK FILE=<file> 44
LOCK TIMEOUT=<number> 44
REDIRECT FILE=<file> 44
REDIRECT PREFIX=<directory or prefix> 44
VOLATILE ERRORS=<0 or 1> 45
ALLOW MISSING TILES=<0 or 1> 45
TILES OVERLAP=<0 or 1> 45
BACKGROUND COLOR=<r,g,b> 45
BACKGROUND LAYER=<layer name> 46
WIDTH=<number> 46
HEIGHT=<number> 46
MIN LON=<number> 46
MIN LAT=<number> 46
MAX LON=<number> 46
MAX LAT=<number> 46
MIN ZOOM=<number> 46
MAX ZOOM=<number> 46
CLIP TYPE=<type> 47
CLIP MIN LON=<number> 47
CLIP MIN LAT=<number> 47
CLIP MAX LON=<number> 47
CLIP MAX LAT=<number> 47
GRID LAT INTERVAL=<number> 47
GRID LON INTERVAL=<number> 47
GRID MIN LON=<number> 48
GRID MIN LAT=<number> 48
GRID MAX LON=<number> 48
GRID MAX LAT=<number> 48
ADAPTIVE GRID=<number> 48
GRID LABELS=<0, 1, 2, 3 or 4> 48
DECIMAL GRID LABELS=<0 or 1> 48
GRID LABEL FORMAT=<format> 48
GRID LABEL FORMAT LON=<format> 48
GRID LABEL CHAR=<0, 1 or 2> 49
ROTATE LON LABELS=<0 or 1> 49
LON LABEL ANGLE=<value> 49
FONT=<name> 49
FONT SCALE=<number> 49
TEXT TYPE=<type> 49
TEXT ANGLE=<number> 50
TEXT ANCHOR=<type> <type> 50
LABEL FORMAT=<format> 50
LABEL FORMAT2=<format> 51
LABEL STYLE=<style> 51
LABEL OUTLINE COLOR=<r g b> 51
WRAP LABEL LENGTH=<number> 51
TEXT BOX OFFSET HORIZ=<number> 52
TEXT BOX OFFSET VERT=<number> 52
TBOX LINE WIDTH=<number> 52
LABEL MIN ZOOM=<value> 52
LABEL MAX ZOOM=<value> 52
LAYOUT TYPE=<value> 52
LABEL PRIORITY=<number> 52
LABEL REPEAT DISTANCE=<number> 53
LAYOUT MARGIN=<number> 53
LAYOUT MARKERS=<0 or 1> 53
MARKER ICON FILE=<file> 53
MARKER ICON TYPE=<type, type, ...> 53
MARKER ICON SIZE=<number> 54
TEXT OFFSET HORIZ=<number> 54
TEXT OFFSET VERT=<number> 54
FILL COLOR=<r,g,b> 54
EDGE COLOR=<r,g,b> 54
MARKER EDGE COLOR=<r,g,b> 54
MARKER FILL COLOR=<r,g,b> 54
LABEL COLOR=<r,g,b> 54
BOX EDGE COLOR=<r,g,b> 55
BOX FILL COLOR=<r,g,b> 55
GRADIENT COLOR=<r,g,b> 55
GRADIENT TYPE=<type> 55
GRADIENT LENGTH=<length> 55
FILL TYPE=<type> 55
LINE WIDTH=<number> 55
DRAW CENTER MARKER=<0 or 1> 56
POS RANGE=<0 or 1> 56
POLY LABEL FORMAT=<format> 56
POLY LABEL FORMAT2=<format> 56
POLY LABEL TYPE=<type> 56
POLY LABEL CENTER=<number> 57
LABEL SELECTION MODE=<mode> 57
ALLOW OVERRIDE=<0 or 1> 57
ATTR MAP=<number resource threshold_table REL/ABS> 57
CUSTOM ATTR=<number resource data_type> 59
PIXEL MAP=<number resource threshold_table REL/ABS> 60
INCLUDE=<file> 60
TILES SUBLIF=<top-level sublif file> [<bbox>]
SUBLIF DIR=<directory> [<bbox>]
SUBLIF FILE=<sublif file> [<bbox>]
60

Chapter 3 Using the Map Server and Utilities 63

3.1 Map Server Executable 63

Error handling 63

Synopsis 64

Description 64

Command Line Options 64

-help 64
-version 64
-arg-file <file> 64
-verbosity <number> 64
-progress <number> 65

Map Generation and Queries 65

Synopsis 65

Description 65

Options 65

-dataset <file> 65
-cgi 65
-fcgi 66
-oGISreq <string> 66
-output <file> 66
-max-iterations <N> 66

Map Query String 66

VERSION=<version> 67
REQUEST=<request type> 67
SRS=<value> 67
WIDTH=<number> 68
HEIGHT=<number> 68
BBOX=<min,min,max,max> 68
ANGLE=<number> 68
BGCOLOR=<color> 68
STYLES=<value> 68
FORMAT=<image format> 68
LAYERS=<list> 69
CENTER=<lon,lat> 70
EXTENT=<x,y> 70
STRETCH=<0 or 1> 70
IERRORS=<0 or 1> 70
IMAGE_ANTIALIASING=<0 or 1> 70
QUERY_LAYERS=<layer name> 70
INFO_TYPE=<info type> 70
INFO_FORMAT=<info format> 71
I=<number> 71
J=<number> 71
LON_LAT=<lon,lat> 71
SELECT_LABELS=<value> 71
PICK_RESOLUTION=<number> 71

Attribute Condition Syntax 71

Examples of Attribute Conditions 72

Examples of OpenGIS map query strings 72

Examples of coordinate conversion and elevation queries 74

Coordinate Conversion Query 74
Elevation Query for a Lat/Lon location 75
Elevation Query for an X/Y image point 76

GIS Selection Query Example 76

3.2 Tools and Utilities 77

Converting GVF ASCII and BINARY Files 78

Synopsis 78

Description 78

Options 78

-convert 78
-a 78
-b 78
-path <directory> 78
-pattern <file_name_pattern> 78

Examples 78

Merging Vector Data Files 79

Synopsis 79

Description 79

Options 79

-merge 79
-output <file> 79
-filter <file> 79
-a 79
-b 79

Examples 79

Bounding Box Extraction Utility 80

Synopsis 80

Description 80

Examples 80

Tiling Utility for Image and Vector Data 80

Synopsis 80

Description 80

Options 80

-tile 80
-image 81
-vector 81
-filename <file> 81
-template <string> 81
-num-x-tiles <number> 81
-num-y-tiles <number> 81

Image Tiling Options 81

-elevation 81

Vector Data Tiling Options 81

-filter <file> 81
-neg-range 82
-pos-range 82
-no-range 82
-custom-range 82
-min-wlon <number> 82
-max-wlon <number> 82
-gvf-extent 82
-world-extent 82
-min-lat <number> 83
-max-lat <number> 83
-min-lon <number> 83
-max-lon <number> 83
-a 83
-b 83

Examples 83

Splitting Vector Data 84

Synopsis 84

Description 84

Options 85

-split 85
-filename <file> 85
-output <file> 85
-filter <filter> 85
-attr <conditions> 85
-invert-attr <index> 86
-bbox 86
-min-lat <number> 86
-max-lat <number> 86
-min-lon <number> 86
-max-lon <number> 86
-num-x-tiles <number> 86
-num-y-tiles <number> 86
-num-points <number> 86
-neg-range 86
-pos-range 87
-no-range 87
-custom-range 87
-min-wlon <number> 87
-max-wlon <number> 87

Examples: 87

Slimming Utility for Vector Data 88

Synopsis 88

Description 88

Options 88

-slim 88
-filename <file> 88
-output <file> 88
-resolution <dir> 88
-a 88
-b 88

Examples 88

Shapefile Conversion Utility 89

Synopsis 89

Description 89

Options 89

-shp2gvf 89
-output <file> 89
-pattern <pattern> 89
-r 90
-a 90
-b 90
-show-attrs 90
-dump 90
-no-header 90
-m 90
-raw 90
-all-attrs 90
-no-attrs 90
-attr <index> 90
-marker-label-attr <index> 91
-close-polygons 91

Examples 91

Hierarchical Tile Parsing (Advanced) 92

Synopsis 92

Description 92

Options 92

-slf 92
-vector 93
-image 93
-single-layer 93
-multi-layer 93
-path <dir> 93
-suppress-bbox 93
-pattern <pattern> 93
-out-slf-name <filename> 94

Examples 95

Image and Elevation Data Import (Advanced) 95

Synopsis 95

Description 95

Options 96

-verbosity <level> 96
-progress <number> 96
-info-only 96
-write-image 97
-elevation 97
-shadow 97
-data-shift 97
-data-offset 97
-slf 98
-out-format <format> 98
-out-ext <extension> 98
-postfix <extension> 98
-pattern <pattern> 98
-r 98
-u 98
-k 98
-f 98
-dont-emboss 98

Examples 99

Chapter 4 Map Server API 101

4.1 Overview 101

Resources 101

4.2 Basic Structure of a Mapping Application 102

DatasetName D 102
Projection D 102
CenterLon D 102
CenterLat D 102
VExtent D 103
HExtent D 103
AngleD 103
Width D 103
Height D 103
Stretch D 103
Background G 103
ImageAntiAliasing D 103
ImageErrors D 103
Verbosity D 103

Code Example 104

4.3 Linking with the Map Server Library 105

X Windows 106

Microsoft Windows 106

Using Static Libraries 106

Using DLLs 107

Include Files 107

4.4 Advanced features of the GLG Map Server API 107

Overview 107

Hierarchy of GlmObjects 107

Modifying Layers 108

Creating Datasets 108

Dataset Resources 108

GlmRoot S 109
LayerPath S 109
FontPath S 109
Encoding D 109
AllowOverride D 109
ZoomFactorType D 109
BaseWidth D 109
MaxImageTiles D 109
MaxVectorTiles D 109
MaxIterations D 109
GlyphCacheType D 110
DefaultFont S 110
ErrorFont S 110

Layer Resources 110

LayerType D 110
IsDefault D 110
TransType D 111
TransColor G 111
TransColorPrecision D 111
TilesOverlap D 111
BGColorRed D 111
BGColorGreen D 111
BGColorBlue D 111
Background Layer S 111
ElevationMode D 111
Alpha D 112
RelativeZoom D 112
ImageAntiAliasing D 112
MaxTiles D 112
MaxCacheSize D 112
MinPixelSize D 112
Clip D 112
LockTimeout D 112
Width D 112
Height D 112
MinLon D 112
MinLat D 112
MaxLon D 112
MaxLat D 113
MinZoom D 113
MaxZoom D 113
ClipType D 113
ClipMinLon D 113
ClipMinLat D 113
ClipMaxLon D 113
ClipMaxLat D 113
GridLatInterval D 113
GridLonInterval D 113
GridMinLon D 113
GridMinLat D 113
GridMaxLon D 113
GridMaxLat D 113
AdaptiveGrid D 114
GridLabels D 114
DecimalGridLabels D 114
GridLabelFormat S 114
GridLabelFormatLon S 114
GridLabelChar D 114
RotateLonLabels D 114
LonLabelAngle D 114
TextFont S 115
TextType D 115
FontScale D 115
TextAngle D 115
TextAnchor D 115
LabelFormat S 115
LabelFormat2 S 115
LabelStyle D 116
LabelOutlineColor G 116
TextBoxLineWidth D 116
TextBoxOffsetH D 116
TextBoxOffsetV D 116
WrapLabelLength 116
LabelMinZoom D 116
LabelMaxZoom D 116
LayoutType D 116
LabelPriority D 116
LabelRepeatDistance D 117
LayoutMargin D 117
LayoutMarkers D 117
MarkerIconFile S 117
MarkerType D 117
MarkerSize D 117
TextOffsetH D 117
TextOffsetV D 117
FillType D 117
LineWidth D 118
FillColor G 118
EdgeColor G 118
DrawCenterMarker D 118
MarkerFillColor G 118
MarkerEdgeColor G 118
LabelColor G 118
BoxEdgeColor G 118
BoxFillColor G 118
GradientColor G 118
GradientType D 118
GradientLength D 118
PolyLabelFormat S 119
PolyLabelFormat2 S 119
PolyLabelType D 119
PolyLabelCenter D 119
LabelSelectionMode D 119
Volatile D 119
VolatileErrors D 119
LockFile S 119
LockTimeout D 119
RedirectFile S 120
RedirectPrefix S 120
FallbackLayer S 120
AllowMissingTiles D 120
AllowOverride D 120

4.5 Function Descriptions 120

GlmInit 120

Parameters 120

GlmCreateDataset 120

Parameters 121

GlmAddLayer 121

Parameters 121

GlmCreateMap 121

GlmSetupMap 121

Parameters 122

GlmSetLayers 122

Parameters 122

GlmResetLayers 122

Parameters 122

GlmEnableLayer 123

Parameters 123

GlmDisableLayer 123

Parameters 123

GlmGetDResource 123

Parameters 124

GlmGetGResource 124

Parameters 124

GlmGetSResource 125

Parameters 125

GlmSetDResource 125

Parameters 125

GlmSetGResource 126

Parameters 126

GlmSetSResource 126

Parameters 126

GlmGetProjection 127

Parameters 127

GlmGetMapData 127

Parameters 127

GlmWriteImage 127

Parameters 128

GlmGetElevation 128

Parameters 128

GlmGetSelection 129

Parameters 129
GIS Selection Message 129
Programming Example 130

GlmGetLatLon 133

Parameters 133

GlmGetXYZ 133

Parameters 134

GlmConvert 134

Parameters 134

GlmLatLonToUtm 135

Parameters 135

GlmUtmToLatLon 136

Parameters 136

GlmUtmToMgrs 136

Parameters 136

GlmMgrsToUtm 137

Parameters 137

GlmUpdateMap 137

Parameters 137

GlmResetImageErrors 138

GlmRemoveLayer 138

Parameters 138

GlmDestroyMap 138

Parameters 138

GlmDestroyDataset 138

Parameters 138

GlmTerminate 139

Chapter 5 GVF Filters and Data Converters 141

5.1 GVF API Reference 141

Overview 141

GVF Functions 141

Headers 141

Writing a Filter or Data Convertor 142

Polygons 142

Markers 142

Attributes 143

Points 143

Examples 144

Function Descriptions 144

GvfWriteHeader 144

Parameters 144

GvfWritePolygon 145

Parameters 145

GvfWriteMarker 145

Parameters 146

GvfWriteAttribute 146

Parameters 147

GvfWritePoint 147

Parameters 147

5.2 GVF Format RFC 148

File Extension 148

Definitions 148

ASCII Format 149

Header 149

Body 149

Objects 150

Polygons 150

Ring 150
Number of Points 150
Number of Attributes 150

Markers 150

Marker Type 150
Scale 151
Angle 151
Anchoring 151
Text String 151
Number of Attributes 151

Attributes 151

Data Points 152

Appendix A: Web Server Installation Notes 153

Introduction 153

Unix Notes 153

Windows Notes 153

Perl Notes 154

Map Server Setup on a Web Server 155

Map Server Run-Time Components 155

GlmScript setup 156

FastCGI setup 156

Testing Map Server Setup on a Web Server 157


Generic Logic, Inc.
www.genlogic.com
PREV NEXT