1
/******************************************************************************
2
* $Id: mapserver.h 10867 2011-01-14 14:56:21Z dmorissette $
5
* Purpose: Primary MapServer include file.
6
* Author: Steve Lime and the MapServer team.
8
******************************************************************************
9
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
11
* Permission is hereby granted, free of charge, to any person obtaining a
12
* copy of this software and associated documentation files (the "Software"),
13
* to deal in the Software without restriction, including without limitation
14
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
* and/or sell copies of the Software, and to permit persons to whom the
16
* Software is furnished to do so, subject to the following conditions:
18
* The above copyright notice and this permission notice shall be included in
19
* all copies of this Software or works derived from this Software.
21
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
* DEALINGS IN THE SOFTWARE.
28
*****************************************************************************/
34
** MapServer version - to be updated for every release
36
#define MS_VERSION "5.6.6"
38
#define MS_VERSION_MAJOR 5
39
#define MS_VERSION_MINOR 6
40
#define MS_VERSION_REV 6
42
#define MS_VERSION_NUM (MS_VERSION_MAJOR*10000+MS_VERSION_MINOR*100+MS_VERSION_REV)
46
** Main includes. If a particular header was needed by several .c files then
47
** I just put it here. What the hell, it works and it's all right here. -SDL-
54
#if defined(_WIN32) && !defined(__CYGWIN__)
65
# define MS_CVSID(string) static char ms_cvsid[] = string; \
66
static char *cvsid_aw(void) { return( cvsid_aw() ? ((char *) NULL) : ms_cvsid ); }
68
# define MS_CVSID(string)
71
#if defined(_WIN32) && !defined(__CYGWIN__)
72
# define MS_DLL_EXPORT __declspec(dllexport)
77
/* definition of ms_int32/ms_uint32 */
86
#define SIZE_MAX _UI64_MAX
88
#define SIZE_MAX UINT_MAX
93
#if ULONG_MAX == 0xffffffff
94
typedef long ms_int32;
95
typedef unsigned long ms_uint32;
96
#elif UINT_MAX == 0xffffffff
98
typedef unsigned int ms_uint32;
100
typedef int32_t ms_int32;
101
typedef uint32_t ms_uint32;
104
/*forward declaration of rendering object*/
105
struct rendererVTable;
107
typedef struct rendererVTable rendererVTableObj;
108
typedef struct tilecache tileCacheObj;
112
/* ms_bitarray is used by the bit mask in mapbit.c */
113
typedef ms_uint32 * ms_bitarray;
115
#include "maperror.h"
116
#include "mapprimitive.h"
117
#include "mapshape.h"
118
#include "mapsymbol.h"
119
#include "maptree.h" /* quadtree spatial index */
123
#include "mapproject.h"
134
#include <sys/types.h> /* regular expression support */
136
/* The regex lib from the system and the regex lib from PHP needs to
137
* be separated here. We separate here via its directory location.
139
#include "mapregex.h"
143
#define CPL_SUPRESS_CPLUSPLUS
148
#if defined(_WIN32) && !defined(__CYGWIN__)
149
#define snprintf _snprintf
156
/* General defines, wrapable */
158
#define MS_TRUE 1 /* logical control variables */
160
#define MS_UNKNOWN -1
169
/* For layer transparency, allows alpha transparent pixmaps to be used
170
with RGB map images */
171
#define MS_GD_ALPHA 1000
173
/* Number of layer, class and style ptrs to alloc at once in the
174
corresponding msGrow...() functions. Replaces former MS_MAXLAYERS,
175
MS_MAXCLASSES and MS_MAXSTYLES with dynamic allocation (see RFC-17). */
176
#define MS_LAYER_ALLOCSIZE 64
177
#define MS_CLASS_ALLOCSIZE 8
178
#define MS_STYLE_ALLOCSIZE 4
180
#define MS_MAX_LABEL_PRIORITY 10
181
#define MS_DEFAULT_LABEL_PRIORITY 1
183
/* General defines, not wrapable */
185
#define MS_DEFAULT_MAPFILE_PATTERN "\\.map$"
187
#define MS_TEMPLATE_MAGIC_STRING "MapServer Template"
188
#define MS_TEMPLATE_EXPR "\\.(xml|wml|html|htm|svg|kml|gml|js|tmpl)$"
190
#define MS_INDEX_EXTENSION ".qix"
192
#define MS_QUERY_MAGIC_STRING "MapServer Query"
193
#define MS_QUERY_EXTENSION ".qy"
195
#define MS_DEG_TO_RAD .0174532925199432958
196
#define MS_RAD_TO_DEG 57.29577951
202
#define MS_MAXCOLORS 256
204
#define MS_MISSING_DATA_IGNORE 0
205
#define MS_MISSING_DATA_FAIL 1
206
#define MS_MISSING_DATA_LOG 2
208
#define MS_BUFFER_LENGTH 2048 /* maximum input line length */
209
#define MS_URL_LENGTH 1024
210
#define MS_MAXPATHLEN 1024
212
#define MS_MAXIMAGESIZE_DEFAULT 2048
214
#define MS_MAXPROJARGS 20
215
#define MS_MAXJOINS 20
216
#define MS_ITEMNAMELEN 32
217
#define MS_NAMELEN 20
219
#define MS_MINSYMBOLSIZE 0 /* in pixels */
220
#define MS_MAXSYMBOLSIZE 500
222
#define MS_MINSYMBOLWIDTH 0 /* in pixels */
223
#define MS_MAXSYMBOLWIDTH 32
225
#define MS_URL 0 /* template types */
228
#define MS_MINFONTSIZE 4
229
#define MS_MAXFONTSIZE 256
231
#define MS_LABELCACHEINITSIZE 100
232
#define MS_LABELCACHEINCREMENT 10
234
#define MS_RESULTCACHEINITSIZE 10
235
#define MS_RESULTCACHEINCREMENT 10
237
#define MS_FEATUREINITSIZE 10 /* how many points initially can a feature have */
238
#define MS_FEATUREINCREMENT 10
240
#define MS_EXPRESSION 2000 /* todo: make this an enum */
241
#define MS_REGEX 2001
242
#define MS_STRING 2002
243
#define MS_NUMBER 2003
244
#define MS_COMMENT 2004
245
#define MS_IREGEX 2005
246
#define MS_ISTRING 2006
247
#define MS_BINDING 2007
249
/* boolean options for the expression object. */
250
#define MS_EXP_INSENSITIVE 1
252
/* General macro definitions */
253
#define MS_MIN(a,b) (((a)<(b))?(a):(b))
254
#define MS_MAX(a,b) (((a)>(b))?(a):(b))
255
#define MS_ABS(a) (((a)<0) ? -(a) : (a))
256
#define MS_SGN(a) (((a)<0) ? -1 : 1)
258
#define MS_NINT_GENERIC(x) ((x) >= 0.0 ? ((long) ((x)+.5)) : ((long) ((x)-.5)))
261
#define msIsNan(x) _isnan(x)
263
#define msIsNan(x) isnan(x)
266
/* see http://mega-nerd.com/FPcast/ for some discussion of fast
267
conversion to nearest int. We avoid lrint() for now because it
268
would be hard to include math.h "properly". */
270
#if defined(WE_HAVE_THE_C99_LRINT) && !defined(USE_GENERIC_MS_NINT)
271
# define MS_NINT(x) lrint(x)
272
/*# define MS_NINT(x) lround(x) */
273
#elif defined(_MSC_VER) && defined(_WIN32) && !defined(USE_GENERIC_MS_NINT)
274
static __inline long int MS_NINT (double flt)
284
#elif defined(i386) && defined(__GNUC_PREREQ) && !defined(USE_GENERIC_MS_NINT)
285
static __inline long int MS_NINT( double __x )
290
: "=m" (__lrintres) : "t" (__x) : "st");
294
# define MS_NINT(x) MS_NINT_GENERIC(x)
298
#define MS_PEN_TRANSPARENT -1
299
#define MS_PEN_UNSET -4
301
/* #define MS_VALID_EXTENT(minx, miny, maxx, maxy) (((minx<maxx) && (miny<maxy))?MS_TRUE:MS_FALSE) */
302
#define MS_VALID_EXTENT(rect) (((rect.minx < rect.maxx && rect.miny < rect.maxy))?MS_TRUE:MS_FALSE)
304
#define MS_INIT_COLOR(color,r,g,b) { (color).red = r; (color).green = g; (color).blue = b; (color).pen = MS_PEN_UNSET; }
305
#define MS_VALID_COLOR(color) (((color).red==-1 || (color).green==-1 || (color).blue==-1)?MS_FALSE:MS_TRUE)
306
#define MS_TRANSPARENT_COLOR(color) (((color).red==-255 || (color).green==-255 || (color).blue==-255)?MS_TRUE:MS_FALSE)
307
#define MS_COMPARE_COLORS(a,b) (((a).red!=(b).red || (a).green!=(b).green || (a).blue!=(b).blue)?MS_FALSE:MS_TRUE)
308
#define MS_COLOR_GETRGB(color) (MS_VALID_COLOR(color)?((color).red *0x10000 + (color).green *0x100 + (color).blue):-1)
310
#define MS_IMAGE_MIME_TYPE(format) (format->mimetype ? format->mimetype : "unknown")
311
#define MS_IMAGE_EXTENSION(format) (format->extension ? format->extension : "unknown")
313
#define MS_DRIVER_GD(format) (strncasecmp((format)->driver,"gd/",3)==0)
314
#define MS_DRIVER_SWF(format) (strncasecmp((format)->driver,"swf",3)==0)
315
#define MS_DRIVER_GDAL(format) (strncasecmp((format)->driver,"gdal/",5)==0)
316
#define MS_DRIVER_PDF(format) (strncasecmp((format)->driver,"pdf",3)==0)
317
#define MS_DRIVER_IMAGEMAP(format) (strncasecmp((format)->driver,"imagemap",8)==0)
318
#define MS_DRIVER_SVG(format) (strncasecmp((format)->driver,"svg",3)==0)
319
#define MS_DRIVER_AGG(format) (strncasecmp((format)->driver,"agg/",4)==0)
320
#define MS_DRIVER_CAIRO(format) (strncasecmp((format)->driver,"cairo/",6)==0)
321
#define MS_DRIVER_OGL(format) (strncasecmp((format)->driver,"ogl/",4)==0)
322
#define MS_DRIVER_TEMPLATE(format) (strncasecmp((format)->driver,"template",8)==0)
324
#define MS_RENDER_WITH_GD 1
325
#define MS_RENDER_WITH_SWF 2
326
#define MS_RENDER_WITH_RAWDATA 3
327
#define MS_RENDER_WITH_PDF 4
328
#define MS_RENDER_WITH_IMAGEMAP 5
329
#define MS_RENDER_WITH_SVG 6
330
#define MS_RENDER_WITH_AGG 7
331
#define MS_RENDER_WITH_TEMPLATE 8 /* query results only */
332
#define MS_RENDER_WITH_CAIRO_RASTER 9
333
#define MS_RENDER_WITH_CAIRO_PDF 10
334
#define MS_RENDER_WITH_CAIRO_SVG 11
335
#define MS_RENDER_WITH_OGL 12
337
#define MS_RENDERER_GD(format) ((format)->renderer == MS_RENDER_WITH_GD)
338
#define MS_RENDERER_SWF(format) ((format)->renderer == MS_RENDER_WITH_SWF)
339
#define MS_RENDERER_RAWDATA(format) ((format)->renderer == MS_RENDER_WITH_RAWDATA)
340
#define MS_RENDERER_PDF(format) ((format)->renderer == MS_RENDER_WITH_PDF)
341
#define MS_RENDERER_IMAGEMAP(format) ((format)->renderer == MS_RENDER_WITH_IMAGEMAP)
342
#define MS_RENDERER_SVG(format) ((format)->renderer == MS_RENDER_WITH_SVG)
343
#define MS_RENDERER_AGG(format) ((format)->renderer == MS_RENDER_WITH_AGG)
344
#define MS_RENDERER_PLUGIN(format) ((format)->renderer >= MS_RENDER_WITH_CAIRO_RASTER)
345
#define MS_RENDERER_TEMPLATE(format) ((format)->renderer == MS_RENDER_WITH_TEMPLATE)
347
#define MS_CELLSIZE(min,max,d) ((max - min)/(d-1)) /* where min/max are from an MapServer pixel center-to-pixel center extent */
348
#define MS_OWS_CELLSIZE(min,max,d) ((max - min)/d) /* where min/max are from an OGC pixel outside edge-to-pixel outside edge extent */
349
#define MS_MAP2IMAGE_X(x,minx,cx) (MS_NINT((x - minx)/cx))
350
#define MS_MAP2IMAGE_Y(y,maxy,cy) (MS_NINT((maxy - y)/cy))
351
#define MS_IMAGE2MAP_X(x,minx,cx) (minx + cx*x)
352
#define MS_IMAGE2MAP_Y(y,maxy,cy) (maxy - cy*y)
354
/* this version of MS_MAP2IMAGE takes 1/cellsize and is much faster */
355
#define MS_MAP2IMAGE_X_IC(x,minx,icx) (MS_NINT((x - minx)*icx))
356
#define MS_MAP2IMAGE_Y_IC(y,maxy,icy) (MS_NINT((maxy - y)*icy))
358
#define MS_MAP2IMAGE_X_IC_DBL(x,minx,icx) ((x - minx)*icx)
359
#define MS_MAP2IMAGE_Y_IC_DBL(y,maxy,icy) ((maxy - y)*icy)
361
/* For CARTO symbols */
362
#define MS_PI 3.14159265358979323846
363
#define MS_PI2 1.57079632679489661923 /* (MS_PI / 2) */
364
#define MS_3PI2 4.71238898038468985769 /* (3 * MS_PI2) */
365
#define MS_2PI 6.28318530717958647693 /* (2 * MS_PI) */
367
#define MS_ENCRYPTION_KEY_SIZE 16 /* Key size: 128 bits = 16 bytes */
369
#define GET_LAYER(map, pos) map->layers[pos]
370
#define MS_REFCNT_INCR(obj) obj->refcount++
371
#define MS_REFCNT_DECR(obj) (--(obj->refcount))
372
#define MS_REFCNT_INIT(obj) obj->refcount=1
373
#define MS_REFCNT_DECR_IS_NOT_ZERO(obj) (MS_REFCNT_DECR(obj))>0
374
#define MS_REFCNT_DECR_IS_ZERO(obj) (MS_REFCNT_DECR(obj))<=0
378
/* General enumerated types - needed by scripts */
379
enum MS_FILE_TYPE {MS_FILE_MAP, MS_FILE_SYMBOL};
380
enum MS_UNITS {MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD, MS_PIXELS, MS_PERCENTAGES, MS_NAUTICALMILES};
381
enum MS_SHAPE_TYPE {MS_SHAPE_POINT, MS_SHAPE_LINE, MS_SHAPE_POLYGON, MS_SHAPE_NULL};
382
enum MS_LAYER_TYPE {MS_LAYER_POINT, MS_LAYER_LINE, MS_LAYER_POLYGON, MS_LAYER_RASTER, MS_LAYER_ANNOTATION, MS_LAYER_QUERY, MS_LAYER_CIRCLE, MS_LAYER_TILEINDEX, MS_LAYER_CHART};
383
enum MS_FONT_TYPE {MS_TRUETYPE, MS_BITMAP};
385
#define MS_POSITIONS_LENGTH 12
386
enum MS_POSITIONS_ENUM {MS_UL=101, MS_LR, MS_UR, MS_LL, MS_CR, MS_CL, MS_UC, MS_LC, MS_CC, MS_AUTO, MS_XY, MS_FOLLOW}; /* Added MS_FOLLOW for bug #1620 implementation. */
388
enum MS_BITMAP_FONT_SIZES {MS_TINY , MS_SMALL, MS_MEDIUM, MS_LARGE, MS_GIANT};
389
enum MS_QUERYMAP_STYLES {MS_NORMAL, MS_HILITE, MS_SELECTED};
390
enum MS_CONNECTION_TYPE {MS_INLINE, MS_SHAPEFILE, MS_TILED_SHAPEFILE, MS_SDE, MS_OGR, MS_UNUSED_1, MS_POSTGIS, MS_WMS, MS_ORACLESPATIAL, MS_WFS, MS_GRATICULE, MS_MYGIS, MS_RASTER, MS_PLUGIN };
391
enum MS_JOIN_CONNECTION_TYPE {MS_DB_XBASE, MS_DB_CSV, MS_DB_MYSQL, MS_DB_ORACLE, MS_DB_POSTGRES};
392
enum MS_JOIN_TYPE {MS_JOIN_ONE_TO_ONE, MS_JOIN_ONE_TO_MANY};
394
#define MS_SINGLE 0 /* modes for searching (spatial/database) */
395
#define MS_MULTIPLE 1
397
enum MS_QUERY_MODE {MS_QUERY_SINGLE, MS_QUERY_MULTIPLE};
398
enum MS_QUERY_TYPE {MS_QUERY_IS_NULL, MS_QUERY_BY_POINT, MS_QUERY_BY_RECT, MS_QUERY_BY_SHAPE, MS_QUERY_BY_ATTRIBUTE, MS_QUERY_BY_INDEX, MS_QUERY_BY_OPERATOR};
400
enum MS_ALIGN_VALUE {MS_ALIGN_LEFT, MS_ALIGN_CENTER, MS_ALIGN_RIGHT};
402
enum MS_CAPS_JOINS_AND_CORNERS {MS_CJC_NONE, MS_CJC_BEVEL, MS_CJC_BUTT, MS_CJC_MITER, MS_CJC_ROUND, MS_CJC_SQUARE, MS_CJC_TRIANGLE};
403
enum MS_RETURN_VALUE {MS_SUCCESS, MS_FAILURE, MS_DONE};
404
enum MS_IMAGEMODE { MS_IMAGEMODE_PC256, MS_IMAGEMODE_RGB, MS_IMAGEMODE_RGBA, MS_IMAGEMODE_INT16, MS_IMAGEMODE_FLOAT32, MS_IMAGEMODE_BYTE, MS_IMAGEMODE_NULL };
406
enum MS_GEOS_OPERATOR {MS_GEOS_EQUALS, MS_GEOS_DISJOINT, MS_GEOS_TOUCHES, MS_GEOS_OVERLAPS, MS_GEOS_CROSSES, MS_GEOS_INTERSECTS, MS_GEOS_WITHIN, MS_GEOS_CONTAINS, MS_GEOS_BEYOND, MS_GEOS_DWITHIN};
407
#define MS_FILE_DEFAULT MS_FILE_MAP
413
FILTER_NODE_TYPE_UNDEFINED = -1,
414
FILTER_NODE_TYPE_LOGICAL = 0,
415
FILTER_NODE_TYPE_SPATIAL = 1,
416
FILTER_NODE_TYPE_COMPARISON = 2,
417
FILTER_NODE_TYPE_PROPERTYNAME = 3,
418
FILTER_NODE_TYPE_BBOX = 4,
419
FILTER_NODE_TYPE_LITERAL = 5,
420
FILTER_NODE_TYPE_BOUNDARY = 6,
421
FILTER_NODE_TYPE_GEOMETRY_POINT = 7,
422
FILTER_NODE_TYPE_GEOMETRY_LINE = 8,
423
FILTER_NODE_TYPE_GEOMETRY_POLYGON = 9,
424
FILTER_NODE_TYPE_FEATUREID = 10
428
/************************************************************************/
429
/* FilterEncodingNode */
430
/************************************************************************/
432
typedef struct _FilterNode
434
FilterNodeType eType;
438
struct _FilterNode *psLeftNode;
439
struct _FilterNode *psRightNode;
440
} FilterEncodingNode;
442
/************************************************************************/
445
/* Label path object - used to hold path and bounds of curved */
446
/* labels - Bug #1620 implementation. */
447
/************************************************************************/
456
/************************************************************************/
459
/* used to hold aliases for TRUETYPE fonts */
460
/************************************************************************/
478
/************************************************************************/
479
/* featttureListNodeObj */
481
/* for inline features, shape caches and queries */
482
/************************************************************************/
484
typedef struct listNode {
486
struct listNode *next;
487
struct listNode *tailifhead; /* this is the tail node in the list, if this is the head element, otherwise NULL */
488
} featureListNodeObj;
490
typedef featureListNodeObj * featureListNodeObjPtr;
493
/************************************************************************/
496
/* used to hold colors while a map file is read */
497
/************************************************************************/
500
colorObj colors[MS_MAXCOLORS-1];
501
int colorvalue[MS_MAXCOLORS-1];
506
/************************************************************************/
508
/************************************************************************/
514
/* container for expression options such as case-insensitiveness */
515
/* This is a boolean container. */
518
/* logical expression options */
523
/* regular expression options */
524
ms_regex_t regex; /* compiled regular expression to be matched */
529
/************************************************************************/
532
/* simple way to access other XBase files, one-to-one or */
533
/* one-to-many supported */
534
/************************************************************************/
539
char **items, **values; /* items/values (process 1 record at a time) */
543
char *from, *to; /* item names */
545
void *joininfo; /* vendor specific (i.e. XBase, MySQL, etc.) stuff to allow for persistant access */
547
char *header, *footer;
554
enum MS_JOIN_TYPE type;
556
enum MS_JOIN_CONNECTION_TYPE connectiontype;
560
/************************************************************************/
561
/* outputFormatObj */
563
/* see mapoutput.c for most related code. */
564
/************************************************************************/
571
int renderer; /* MS_RENDER_WITH_* */
572
int imagemode; /* MS_IMAGEMODE_* value. */
575
int numformatoptions;
576
char **formatoptions;
578
int inmapfile; /* boolean value for writing */
579
rendererVTableObj *vtable;
582
/* The following is used for "don't care" values in transparent, interlace and
583
imagequality values. */
584
#define MS_NOOVERRIDE -1111
586
/************************************************************************/
589
/* encapsulates the information necessary to perform a query */
590
/************************************************************************/
593
int type; /* MS_QUERY_TYPE */
594
int mode; /* MS_QUERY_MODE */
598
pointObj point; /* by point */
602
rectObj rect; /* by rect */
603
shapeObj *shape; /* by shape & operator (OGC filter) */
605
long shapeindex; /* by index */
607
int clear_resultcache;
609
char *item; /* by attribute */
612
int op; /* by GEOS operator */
614
int slayer; /* selection layer, used for msQueryByFeatures() (note this is not a query mode per se) */
618
/************************************************************************/
621
/* used to visualize query results */
622
/************************************************************************/
626
int style; /* HILITE, SELECTED or NORMAL */
630
/* Define supported bindings here (only covers existing bindings at first). Not accessible directly using MapScript. */
631
#define MS_STYLE_BINDING_LENGTH 8
632
enum MS_STYLE_BINDING_ENUM { MS_STYLE_BINDING_SIZE, MS_STYLE_BINDING_WIDTH, MS_STYLE_BINDING_ANGLE, MS_STYLE_BINDING_COLOR, MS_STYLE_BINDING_OUTLINECOLOR, MS_STYLE_BINDING_SYMBOL, MS_STYLE_BINDING_OUTLINEWIDTH, MS_STYLE_BINDING_OPACITY};
633
#define MS_LABEL_BINDING_LENGTH 6
634
enum MS_LABEL_BINDING_ENUM { MS_LABEL_BINDING_SIZE, MS_LABEL_BINDING_ANGLE, MS_LABEL_BINDING_COLOR, MS_LABEL_BINDING_OUTLINECOLOR, MS_LABEL_BINDING_FONT, MS_LABEL_BINDING_PRIORITY};
636
/************************************************************************/
637
/* attributeBindingObj */
638
/************************************************************************/
643
} attributeBindingObj;
647
/************************************************************************/
650
/* parameters needed to annotate a layer, legend or scalebar */
651
/************************************************************************/
655
enum MS_FONT_TYPE type;
658
colorObj outlinecolor;
661
colorObj shadowcolor;
662
int shadowsizex, shadowsizey;
664
colorObj backgroundcolor;
665
colorObj backgroundshadowcolor;
666
int backgroundshadowsizex, backgroundshadowsizey;
669
double minsize, maxsize;
672
int offsetx, offsety;
675
int autoangle; /* true or false */
676
int autofollow; /* true or false, bug #1620 implementation */
678
int buffer; /* space to reserve around a label */
686
double space_size_10; /*cached size of a single space character -
687
used for label text alignment of rfc40 */
689
int minfeaturesize; /* minimum feature size (in pixels) to label */
690
int autominfeaturesize; /* true or false */
692
double minscaledenom,maxscaledenom;
696
int partials; /* can labels run of an image */
698
int force; /* labels *must* be drawn */
702
int priority; /* Priority level 1 to MS_MAX_LABEL_PRIORITY, default=1 */
705
attributeBindingObj bindings[MS_LABEL_BINDING_LENGTH];
711
/************************************************************************/
714
/* holds parameters for a mapserver/mapscript interface */
715
/************************************************************************/
719
char *imagepath, *imageurl;
735
char *header, *footer;
736
char *empty, *error; /* error handling */
737
rectObj extent; /* clipping extent */
738
double minscaledenom, maxscaledenom;
739
char *mintemplate, *maxtemplate;
741
char *queryformat; /* what format is the query to be returned, given as a MIME type */
748
hashTableObj metadata;
749
hashTableObj validation;
756
/************************************************************************/
759
/* holds parameters for symbolization, multiple styles may be */
760
/* applied within a classObj */
761
/************************************************************************/
773
/*private vars for rfc48*/
774
char *_geomtransformexpression;
778
/*should an angle be automatically computed*/
782
colorObj backgroundcolor;
783
colorObj outlinecolor;
787
/* Stuff to handle Color Range Styles */
799
double minsize, maxsize;
801
int patternlength; /*moved from symbolObj in version 6.0*/
802
double pattern[MS_MAXPATTERNLENGTH]; /*moved from symbolObj in version 6.0*/
804
double gap; /*moved from symbolObj in version 6.0*/
805
int position; /*moved from symbolObj in version 6.0*/
807
int linecap, linejoin; /*moved from symbolObj in version 6.0*/
808
double linejoinmaxsize; /*moved from symbolObj in version 6.0*/
812
double minwidth, maxwidth;
814
double offsetx, offsety; /* for shadows, hollow symbols, etc... */
820
double minscaledenom, maxscaledenom;
823
attributeBindingObj bindings[MS_STYLE_BINDING_LENGTH];
828
/************************************************************************/
831
/* basic symbolization and classification information */
832
/************************************************************************/
834
typedef struct class_obj{
836
expressionObj expression; /* the expression to be matched */
856
char *name; /* should be unique within a layer */
857
char *title; /* used for legend labeling */
861
#endif /* not SWIG */
865
#else /* __cplusplus */
867
#endif /* __cplusplus */
874
hashTableObj metadata;
875
hashTableObj validation;
880
double minscaledenom, maxscaledenom;
885
struct layer_obj *layer;
896
/************************************************************************/
897
/* labelCacheMemberObj */
899
/* structures to implement label caching and collision */
902
/* Note: These are scriptable, but are read only. */
903
/************************************************************************/
912
styleObj *styles; /* copied from the classObj, only present if there is a marker to be drawn */
915
labelObj label; /* copied from the classObj */
917
int layerindex; /* indexes */
922
int shapetype; /* source geometry type */
924
pointObj point; /* label point */
925
shapeObj *poly; /* label bounding box */
927
int status; /* has this label been drawn or not */
930
labelPathObj *labelpath; /* Path & bounds of curved labels. Bug #1620 implementation */
933
} labelCacheMemberObj;
935
/************************************************************************/
936
/* markerCacheMemberObj */
937
/************************************************************************/
939
int id; /* corresponding label */
940
shapeObj *poly; /* marker bounding box (POINT layers only) */
941
} markerCacheMemberObj;
943
/************************************************************************/
944
/* labelCacheSlotObj */
945
/************************************************************************/
947
labelCacheMemberObj *labels;
950
markerCacheMemberObj *markers;
955
/************************************************************************/
957
/************************************************************************/
959
/* One labelCacheSlotObj for each priority level */
960
labelCacheSlotObj slots[MS_MAX_LABEL_PRIORITY];
961
/* numlabels is deprecated, maintained only for backwards compatibility
962
* between MS 4.10 and 5.0 and should be removed in a future release.
963
* The slots[].numlabels are the real values to rely on.
968
/************************************************************************/
969
/* resultCacheMemberObj */
970
/************************************************************************/
975
} resultCacheMemberObj;
981
/************************************************************************/
983
/************************************************************************/
987
resultCacheMemberObj *results;
989
#endif /* not SWIG */
1000
/*used to force the result retreiving to use getshape instead of msLayerResultGetShape #3305*/
1006
/************************************************************************/
1008
/************************************************************************/
1023
struct map_obj *map;
1024
fontSetObj *fontset; /* a pointer to the main mapObj version */
1025
struct imageCacheObj *imagecache;
1026
#endif /* not SWIG */
1029
/************************************************************************/
1030
/* referenceMapObj */
1031
/************************************************************************/
1036
colorObj outlinecolor;
1047
struct map_obj *map;
1053
/************************************************************************/
1055
/************************************************************************/
1057
colorObj imagecolor;
1063
colorObj backgroundcolor;
1064
colorObj outlinecolor;
1066
int status; /* ON, OFF or EMBED */
1067
int position; /* for embeded scalebars */
1071
#endif /* not SWIG */
1076
/************************************************************************/
1078
/************************************************************************/
1081
colorObj imagecolor;
1089
int keysizex, keysizey;
1090
int keyspacingx, keyspacingy;
1091
colorObj outlinecolor; /* Color of outline of box, -1 for no outline */
1092
int status; /* ON, OFF or EMBED */
1094
int position; /* for embeded legends */
1098
#endif /* not SWIG */
1102
#else /* __cplusplus */
1104
#endif /* __cplusplus */
1108
struct map_obj *map;
1114
/************************************************************************/
1116
/************************************************************************/
1120
double dwhichlatitude;
1121
double dwhichlongitude;
1122
double dstartlatitude;
1123
double dstartlongitude;
1124
double dendlatitude;
1125
double dendlongitude;
1126
double dincrementlatitude;
1127
double dincrementlongitude;
1130
double minincrement;
1131
double maxincrement;
1132
double minsubdivides;
1133
double maxsubdivides;
1139
lineObj *pboundinglines;
1140
pointObj *pboundingpoints;
1148
char **papszTopLabels;
1150
pointObj *pasBottom;
1151
char **papszBottomLabels;
1154
char **papszLeftLabels;
1157
char **papszRightLabels;
1159
}graticuleIntersectionObj;
1162
typedef struct layerVTable layerVTableObj;
1166
/************************************************************************/
1169
/* base unit of a map. */
1170
/************************************************************************/
1172
typedef struct layer_obj {
1174
char *classitem; /* .DBF item to be used for symbol lookup */
1178
resultCacheObj *resultcache; /* holds the results of a query against this layer */
1179
int annotate; /* boolean flag for annotation */
1180
double scalefactor; /* computed, not set */
1182
classObj **class; /* always at least 1 class */
1183
#else /* __cplusplus */
1185
#endif /* __cplusplus */
1186
#endif /* not SWIG */
1191
/* reference counting, RFC24 */
1196
struct map_obj *map;
1201
char *header, *footer; /* only used with multi result queries */
1204
char *template; /* global template, used across all classes */
1205
#else /* __cplusplus */
1207
#endif /* __cplusplus */
1209
char *name; /* should be unique */
1210
char *group; /* shouldn't be unique it's supposed to be a group right? */
1212
int status; /* on or off */
1213
char *data; /* filename, can be relative or full path */
1215
enum MS_LAYER_TYPE type;
1217
double tolerance; /* search buffer for point and line queries (in toleranceunits) */
1220
double symbolscaledenom; /* scale at which symbols are default size */
1221
double minscaledenom, maxscaledenom;
1222
double labelminscaledenom, labelmaxscaledenom;
1223
double mingeowidth, maxgeowidth; /* map width (in map units) at which the layer should be drawn */
1225
int sizeunits; /* applies to all classes */
1229
colorObj offsite; /* transparent pixel value for raster images */
1231
int transform; /* does this layer have to be transformed to file coordinates */
1233
int labelcache, postlabelcache; /* on or off */
1238
#endif /* not SWIG */
1241
char *tileindex; /* layer index file for tiling support */
1245
projectionObj projection; /* projection information for the layer */
1246
int project; /* boolean variable, do we need to project this layer or not */
1247
#endif /* not SWIG */
1249
int units; /* units of the projection */
1252
featureListNodeObjPtr features; /* linked list so we don't need a counter */
1253
featureListNodeObjPtr currentfeature; /* pointer to the current feature */
1257
char *plugin_library;
1258
char *plugin_library_original; /* this is needed for mapfile writing */
1259
enum MS_CONNECTION_TYPE connectiontype;
1262
layerVTableObj *vtable;
1264
/* SDL has converted OracleSpatial, SDE, Graticules, MyGIS */
1265
void *layerinfo; /* all connection types should use this generic pointer to a vendor specific structure */
1266
void *wfslayerinfo; /* For WFS layers, will contain a msWFSLayerInfo struct */
1267
#endif /* not SWIG */
1269
/* attribute/classification handling components */
1280
void *iteminfo; /* connection specific information necessary to retrieve values */
1281
expressionObj filter; /* connection specific attribute filter */
1283
int filteritemindex;
1285
#endif /* not SWIG */
1287
char *bandsitem; /* which item in a tile contains bands to use (tiled raster data only) */
1289
char *styleitem; /* item to be used for style lookup - can also be 'AUTO' */
1291
char *requires; /* context expressions, simple enough to not use expressionObj */
1292
char *labelrequires;
1297
hashTableObj metadata;
1298
hashTableObj validation;
1303
int opacity; /* opacity (was transparency) value 0-100 */
1310
#endif /* not SWIG */
1317
#endif /* not SWIGJAVA */
1328
/************************************************************************/
1331
/* encompasses everything used in an Internet mapping */
1333
/************************************************************************/
1336
typedef struct map_obj{ /* structure for a map */
1337
char *name; /* small identifier for naming etc. */
1338
int status; /* is map creation on or off */
1349
/* reference counting, RFC24 */
1351
int numlayers; /* number of layers in mapfile */
1352
int maxlayers; /* allocated size of layers[] array */
1354
symbolSetObj symbolset;
1357
labelCacheObj labelcache; /* we need this here so multiple feature processors can access it */
1362
int transparent; /* TODO - Deprecated */
1363
int interlace; /* TODO - Deprecated */
1364
int imagequality; /* TODO - Deprecated */
1366
rectObj extent; /* map extent array */
1367
double cellsize; /* in map units */
1371
geotransformObj gt; /* rotation / geotransform */
1372
rectObj saved_extent;
1375
enum MS_UNITS units; /* units of the projection */
1376
double scaledenom; /* scale of the output image */
1378
double defresolution; /* default resolution: used for calculate the scalefactor */
1380
char *shapepath; /* where are the shape files located */
1381
char *mappath; /* path of the mapfile, all path are relative to this path */
1384
paletteObj palette; /* holds a map palette */
1386
colorObj imagecolor; /* holds the initial image color value */
1391
int numoutputformats;
1392
outputFormatObj **outputformatlist;
1393
outputFormatObj *outputformat;
1395
char *imagetype; /* name of current outputformat */
1401
projectionObj projection; /* projection information for output map */
1402
projectionObj latlon; /* geographic projection definition */
1403
#endif /* not SWIG */
1408
referenceMapObj reference;
1409
scalebarObj scalebar;
1412
queryMapObj querymap;
1423
char *datapattern, *templatepattern; /* depricated, use VALIDATION ... END block instead */
1428
hashTableObj configoptions;
1434
/* Private encryption key information - see mapcrypto.c */
1435
int encryption_key_loaded; /* MS_TRUE once key has been loaded */
1436
unsigned char encryption_key[MS_ENCRYPTION_KEY_SIZE]; /* 128bits encryption key */
1443
/************************************************************************/
1445
/************************************************************************/
1451
void *imagetmp; /* used when the FORMATOPTION "OUTPUT_TYPE=RASTER" */
1455
/************************************************************************/
1457
/************************************************************************/
1463
int streamclosed; /* track if a save image is done */
1464
int compressed; /*track if output is set to be svgz */
1468
/************************************************************************/
1471
/* A wrapper for GD and other images. */
1472
/************************************************************************/
1479
double resolutionfactor;
1481
char *imagepath, *imageurl;
1483
outputFormatObj *format;
1485
void *imageextra; /* AGG specific */
1486
tileCacheObj *tilecache;
1489
int buffer_format; /* tells if the alpha channel is GD or AGG style */
1502
#ifdef USE_MING_FLASH
1514
unsigned char *raw_byte;
1520
/************************************************************************/
1523
/* contains function pointers to the layer operations. If you */
1524
/* add new functions to here, remember to update */
1525
/* populateVirtualTable in maplayer.c */
1526
/************************************************************************/
1528
struct layerVTable {
1529
int (*LayerInitItemInfo)(layerObj *layer);
1530
void (*LayerFreeItemInfo)(layerObj *layer);
1531
int (*LayerOpen)(layerObj *layer);
1532
int (*LayerIsOpen)(layerObj *layer);
1533
int (*LayerWhichShapes)(layerObj *layer, rectObj rect);
1534
int (*LayerNextShape)(layerObj *layer, shapeObj *shape);
1535
int (*LayerResultsGetShape)(layerObj *layer, shapeObj *shape,
1536
int tile, long record);
1537
int (*LayerGetShape)(layerObj *layer, shapeObj *shape,
1538
int tile, long record);
1539
int (*LayerClose)(layerObj *layer);
1540
int (*LayerGetItems)(layerObj *layer);
1541
int (*LayerGetExtent)(layerObj *layer, rectObj *extent);
1542
int (*LayerGetAutoStyle)(mapObj *map, layerObj *layer, classObj *c,
1543
int tile, long record);
1545
int (*LayerCloseConnection)(layerObj *layer);
1547
int (*LayerSetTimeFilter)(layerObj *layer,
1548
const char *timestring,
1549
const char *timefield);
1551
int (*LayerApplyFilterToLayer)(FilterEncodingNode *psNode, mapObj *map,
1553
int bOnlySpatialFilter);
1555
int (*LayerCreateItems)(layerObj *layer, int nt);
1556
int (*LayerGetNumFeatures)(layerObj *layer);
1560
/* Function prototypes, wrapable */
1561
MS_DLL_EXPORT int msSaveImage(mapObj *map, imageObj *img, char *filename);
1562
MS_DLL_EXPORT void msFreeImage(imageObj *img);
1563
MS_DLL_EXPORT int msSetup(void);
1564
MS_DLL_EXPORT void msCleanup(void);
1565
MS_DLL_EXPORT mapObj *msLoadMapFromString(char *buffer, char *new_mappath);
1567
/* Function prototypes, not wrapable */
1572
** helper functions not part of the general API but needed in
1573
** a few other places (like mapscript)... found in mapfile.c
1575
int getString(char **s);
1576
int getDouble(double *d);
1577
int getInteger(int *i);
1578
int getSymbol(int n, ...);
1579
int getCharacter(char *c);
1581
int msBuildPluginLibraryPath(char **dest, const char *lib_str, mapObj *map);
1583
MS_DLL_EXPORT int hex2int(char *hex);
1585
MS_DLL_EXPORT void initJoin(joinObj *join);
1586
MS_DLL_EXPORT void initSymbol(symbolObj *s);
1587
MS_DLL_EXPORT int initMap(mapObj *map);
1588
MS_DLL_EXPORT layerObj *msGrowMapLayers( mapObj *map );
1589
MS_DLL_EXPORT int initLayer(layerObj *layer, mapObj *map);
1590
MS_DLL_EXPORT int freeLayer( layerObj * );
1591
MS_DLL_EXPORT classObj *msGrowLayerClasses( layerObj *layer );
1592
MS_DLL_EXPORT int initClass(classObj *_class);
1593
MS_DLL_EXPORT int freeClass( classObj * );
1594
MS_DLL_EXPORT styleObj *msGrowClassStyles( classObj *_class );
1595
MS_DLL_EXPORT int msMaybeAllocateStyle(classObj* c, int idx);
1596
MS_DLL_EXPORT void initLabel(labelObj *label);
1597
MS_DLL_EXPORT void resetClassStyle(classObj *_class);
1598
MS_DLL_EXPORT int initStyle(styleObj *style);
1599
MS_DLL_EXPORT int freeStyle(styleObj *style);
1600
MS_DLL_EXPORT void initReferenceMap(referenceMapObj *ref);
1601
MS_DLL_EXPORT void initScalebar(scalebarObj *scalebar);
1602
MS_DLL_EXPORT void initGrid( graticuleObj *pGraticule );
1603
MS_DLL_EXPORT void initWeb(webObj *web);
1604
MS_DLL_EXPORT void freeWeb(webObj *web);
1605
MS_DLL_EXPORT void initResultCache(resultCacheObj *resultcache);
1607
MS_DLL_EXPORT featureListNodeObjPtr insertFeatureList(featureListNodeObjPtr *list, shapeObj *shape);
1608
MS_DLL_EXPORT void freeFeatureList(featureListNodeObjPtr list);
1610
/* To be used *only* within the mapfile loading phase */
1611
MS_DLL_EXPORT int loadExpressionString(expressionObj *exp, char *value);
1612
/* Use this next, thread safe wrapper, function everywhere else */
1613
MS_DLL_EXPORT int msLoadExpressionString(expressionObj *exp, char *value);
1614
MS_DLL_EXPORT char *msGetExpressionString(expressionObj *exp);
1615
MS_DLL_EXPORT void freeExpression(expressionObj *exp);
1616
MS_DLL_EXPORT char *msGetExpressionString(expressionObj *exp);
1618
MS_DLL_EXPORT void msLayerSubstituteString(layerObj *layer, const char *from, const char *to);
1619
MS_DLL_EXPORT void msApplyDefaultSubstitutions(mapObj *map);
1621
MS_DLL_EXPORT int getClassIndex(layerObj *layer, char *str);
1623
/* For maplabel and mappdf */
1624
int labelInImage(int width, int height, shapeObj *lpoly, int buffer);
1625
int intersectLabelPolygons(shapeObj *p1, shapeObj *p2);
1626
pointObj get_metrics_line(pointObj *p, int position, rectObj rect, int ox, int oy, double angle, int buffer, lineObj *poly);
1627
pointObj get_metrics(pointObj *p, int position, rectObj rect, int ox, int oy, double angle, int buffer, shapeObj *poly);
1628
double dist(pointObj a, pointObj b);
1631
** Main API Functions
1636
MS_DLL_EXPORT void msFreeMap(mapObj *map);
1637
MS_DLL_EXPORT mapObj *msNewMapObj(void);
1638
MS_DLL_EXPORT const char *msGetConfigOption( mapObj *map, const char *key);
1639
MS_DLL_EXPORT int msSetConfigOption( mapObj *map, const char *key, const char *value);
1640
MS_DLL_EXPORT int msTestConfigOption( mapObj *map, const char *key,
1641
int default_result );
1642
MS_DLL_EXPORT void msApplyMapConfigOptions( mapObj *map );
1643
MS_DLL_EXPORT int msMapComputeGeotransform( mapObj *map );
1645
MS_DLL_EXPORT void msMapPixelToGeoref( mapObj *map, double *x, double *y );
1646
MS_DLL_EXPORT void msMapGeorefToPixel( mapObj *map, double *x, double *y );
1648
MS_DLL_EXPORT int msMapSetExtent(mapObj *map, double minx, double miny,
1649
double maxx, double maxy);
1650
MS_DLL_EXPORT int msMapOffsetExtent( mapObj *map, double x, double y);
1651
MS_DLL_EXPORT int msMapScaleExtent( mapObj *map, double zoomfactor,
1652
double minscaledenom, double maxscaledenom);
1653
MS_DLL_EXPORT int msMapSetCenter( mapObj *map, pointObj *center);
1654
MS_DLL_EXPORT int msMapSetRotation( mapObj *map, double rotation_angle );
1655
MS_DLL_EXPORT int msMapSetSize( mapObj *map, int width, int height );
1656
MS_DLL_EXPORT int msMapSetSize( mapObj *map, int width, int height );
1657
MS_DLL_EXPORT int msMapSetFakedExtent( mapObj *map );
1658
MS_DLL_EXPORT int msMapRestoreRealExtent( mapObj *map );
1659
MS_DLL_EXPORT int msMapLoadOWSParameters( mapObj *map, cgiRequestObj *request,
1660
const char *wmtver_string );
1661
MS_DLL_EXPORT int msMapIgnoreMissingData( mapObj *map );
1665
MS_DLL_EXPORT int msValidateParameter(char *value, char *pattern1, char *pattern2, char *pattern3, char *pattern4);
1666
MS_DLL_EXPORT int msGetLayerIndex(mapObj *map, char *name);
1667
MS_DLL_EXPORT int msGetSymbolIndex(symbolSetObj *set, char *name, int try_addimage_if_notfound);
1668
MS_DLL_EXPORT mapObj *msLoadMap(char *filename, char *new_mappath);
1669
MS_DLL_EXPORT int msSaveMap(mapObj *map, char *filename);
1670
MS_DLL_EXPORT void msFreeCharArray(char **array, int num_items);
1671
MS_DLL_EXPORT int msUpdateScalebarFromString(scalebarObj *scalebar, char *string, int url_string);
1672
MS_DLL_EXPORT int msUpdateQueryMapFromString(queryMapObj *querymap, char *string, int url_string);
1673
MS_DLL_EXPORT int msUpdateLabelFromString(labelObj *label, char *string);
1674
MS_DLL_EXPORT int msUpdateReferenceMapFromString(referenceMapObj *ref, char *string, int url_string);
1675
MS_DLL_EXPORT int msUpdateLegendFromString(legendObj *legend, char *string, int url_string);
1676
MS_DLL_EXPORT int msUpdateWebFromString(webObj *web, char *string, int url_string);
1677
MS_DLL_EXPORT int msUpdateStyleFromString(styleObj *style, char *string, int url_string);
1678
MS_DLL_EXPORT int msUpdateClassFromString(classObj *_class, char *string, int url_string);
1679
MS_DLL_EXPORT int msUpdateLayerFromString(layerObj *layer, char *string, int url_string);
1680
MS_DLL_EXPORT int msUpdateMapFromURL(mapObj *map, char *variable, char *string);
1681
MS_DLL_EXPORT int msEvalRegex(char *e, char *s);
1682
MS_DLL_EXPORT void msFree(void *p);
1683
MS_DLL_EXPORT char **msTokenizeMap(char *filename, int *numtokens);
1684
MS_DLL_EXPORT int msInitLabelCache(labelCacheObj *cache);
1685
MS_DLL_EXPORT int msFreeLabelCache(labelCacheObj *cache);
1686
MS_DLL_EXPORT int msCheckConnection(layerObj * layer); /* connection pooling functions (mapfile.c) */
1687
MS_DLL_EXPORT void msCloseConnections(mapObj *map);
1690
MS_DLL_EXPORT PDF *msDrawMapPDF(mapObj *map, PDF *pdf, hashTableObj fontHash); /* mappdf.c */
1691
#endif /* USE_PDF */
1693
MS_DLL_EXPORT void msOGRCleanup(void);
1694
MS_DLL_EXPORT void msGDALCleanup(void);
1695
MS_DLL_EXPORT void msGDALInitialize(void);
1698
MS_DLL_EXPORT imageObj *msDrawScalebar(mapObj *map); /* in mapscale.c */
1699
MS_DLL_EXPORT int msCalculateScale(rectObj extent, int units, int width, int height, double resolution, double *scaledenom);
1700
MS_DLL_EXPORT double GetDeltaExtentsUsingScale(double scale, int units, double centerLat, int width, double resolution);
1701
MS_DLL_EXPORT double Pix2Georef(int nPixPos, int nPixMin, int nPixMax, double dfGeoMin, double dfGeoMax, int bULisYOrig);
1702
MS_DLL_EXPORT double msInchesPerUnit(int units, double center_lat);
1703
MS_DLL_EXPORT int msEmbedScalebar(mapObj *map, imageObj *img);
1705
MS_DLL_EXPORT int msPointInRect(pointObj *p, rectObj *rect); /* in mapsearch.c */
1706
MS_DLL_EXPORT int msRectOverlap(rectObj *a, rectObj *b);
1707
MS_DLL_EXPORT int msRectContained(rectObj *a, rectObj *b);
1709
MS_DLL_EXPORT void msRectToFormattedString(rectObj *rect, char *format,
1710
char *buffer, int buffer_length);
1711
MS_DLL_EXPORT void msPointToFormattedString(pointObj *point, const char*format,
1712
char *buffer, int buffer_length);
1714
MS_DLL_EXPORT void msMergeRect(rectObj *a, rectObj *b);
1715
MS_DLL_EXPORT double msDistancePointToPoint(pointObj *a, pointObj *b);
1716
MS_DLL_EXPORT double msSquareDistancePointToPoint(pointObj *a, pointObj *b);
1717
MS_DLL_EXPORT double msDistancePointToSegment(pointObj *p, pointObj *a, pointObj *b);
1718
MS_DLL_EXPORT double msSquareDistancePointToSegment(pointObj *p, pointObj *a, pointObj *b);
1719
MS_DLL_EXPORT double msDistancePointToShape(pointObj *p, shapeObj *shape);
1720
MS_DLL_EXPORT double msSquareDistancePointToShape(pointObj *p, shapeObj *shape);
1721
MS_DLL_EXPORT double msDistanceSegmentToSegment(pointObj *pa, pointObj *pb, pointObj *pc, pointObj *pd);
1722
MS_DLL_EXPORT double msDistanceShapeToShape(shapeObj *shape1, shapeObj *shape2);
1723
MS_DLL_EXPORT int msIntersectSegments(pointObj *a, pointObj *b, pointObj *c, pointObj *d);
1724
MS_DLL_EXPORT int msPointInPolygon(pointObj *p, lineObj *c);
1725
MS_DLL_EXPORT int msIntersectMultipointPolygon(shapeObj *multipoint, shapeObj *polygon);
1726
MS_DLL_EXPORT int msIntersectPointPolygon(pointObj *p, shapeObj *polygon);
1727
MS_DLL_EXPORT int msIntersectPolylinePolygon(shapeObj *line, shapeObj *poly);
1728
MS_DLL_EXPORT int msIntersectPolygons(shapeObj *p1, shapeObj *p2);
1729
MS_DLL_EXPORT int msIntersectPolylines(shapeObj *line1, shapeObj *line2);
1731
MS_DLL_EXPORT int msInitQuery(queryObj *query); /* in mapquery.c */
1732
MS_DLL_EXPORT void msFreeQuery(queryObj *query);
1733
MS_DLL_EXPORT int msSaveQuery(mapObj *map, char *filename);
1734
MS_DLL_EXPORT int msLoadQuery(mapObj *map, char *filename);
1735
MS_DLL_EXPORT int msExecuteQuery(mapObj *map);
1737
MS_DLL_EXPORT int msQueryByIndex(mapObj *map); /* various query methods, all rely on the queryObj hung off the mapObj */
1738
MS_DLL_EXPORT int msQueryByAttributes(mapObj *map);
1739
MS_DLL_EXPORT int msQueryByPoint(mapObj *map);
1740
MS_DLL_EXPORT int msQueryByRect(mapObj *map);
1741
MS_DLL_EXPORT int msQueryByFeatures(mapObj *map);
1742
MS_DLL_EXPORT int msQueryByShape(mapObj *map);
1743
MS_DLL_EXPORT int msQueryByOperator(mapObj *map);
1745
MS_DLL_EXPORT int msGetQueryResultBounds(mapObj *map, rectObj *bounds);
1746
MS_DLL_EXPORT int msIsLayerQueryable(layerObj *lp);
1747
MS_DLL_EXPORT void msQueryFree(mapObj *map, int qlayer); /* todo: rename */
1748
MS_DLL_EXPORT int msRasterQueryByShape(mapObj *map, layerObj *layer, shapeObj *selectshape);
1749
MS_DLL_EXPORT int msRasterQueryByRect(mapObj *map, layerObj *layer, rectObj queryRect);
1750
MS_DLL_EXPORT int msRasterQueryByPoint(mapObj *map, layerObj *layer, int mode, pointObj p, double buffer, int maxresults );
1752
/* in mapstring.c */
1753
MS_DLL_EXPORT void msStringTrim(char *str);
1754
MS_DLL_EXPORT void msStringTrimBlanks(char *string);
1755
MS_DLL_EXPORT char *msStringTrimLeft(char *string);
1756
MS_DLL_EXPORT char *msStringChop(char *string);
1757
MS_DLL_EXPORT void msStringTrimEOL(char *string);
1758
MS_DLL_EXPORT char *msReplaceSubstring(char *str, const char *old, const char *sznew);
1759
MS_DLL_EXPORT void msReplaceChar(char *str, char old, char sznew);
1760
MS_DLL_EXPORT char *msCaseReplaceSubstring(char *str, const char *old, const char *sznew);
1761
MS_DLL_EXPORT char *msStripPath(char *fn);
1762
MS_DLL_EXPORT char *msGetPath(char *fn);
1763
MS_DLL_EXPORT char *msBuildPath(char *pszReturnPath, const char *abs_path, const char *path);
1764
MS_DLL_EXPORT char *msBuildPath3(char *pszReturnPath, const char *abs_path, const char *path1, const char *path2);
1765
MS_DLL_EXPORT char *msTryBuildPath(char *szReturnPath, const char *abs_path, const char *path);
1766
MS_DLL_EXPORT char *msTryBuildPath3(char *szReturnPath, const char *abs_path, const char *path1, const char *path2);
1767
MS_DLL_EXPORT char **msStringSplit(const char *string, char cd, int *num_tokens);
1768
MS_DLL_EXPORT char **msStringTokenize( const char *pszLine, const char *pszDelim, int *num_tokens, int preserve_quote);
1769
MS_DLL_EXPORT int msCountChars(char *str, char ch);
1770
MS_DLL_EXPORT char *msLongToString(long value);
1771
MS_DLL_EXPORT char *msDoubleToString(double value, int force_f);
1772
MS_DLL_EXPORT char *msIntToString(int value);
1773
MS_DLL_EXPORT void msStringToUpper(char *string);
1774
MS_DLL_EXPORT void msStringToLower(char *string);
1775
MS_DLL_EXPORT int msEncodeChar(const char);
1776
MS_DLL_EXPORT char *msEncodeUrlExcept(const char*, const char);
1777
MS_DLL_EXPORT char *msEncodeUrl(const char*);
1778
MS_DLL_EXPORT char *msEncodeHTMLEntities(const char *string);
1779
MS_DLL_EXPORT void msDecodeHTMLEntities(const char *string);
1780
MS_DLL_EXPORT int msIsXMLTagValid(const char *string);
1781
MS_DLL_EXPORT char *msStringConcatenate(char *pszDest, char *pszSrc);
1782
MS_DLL_EXPORT char *msJoinStrings(char **array, int arrayLength, const char *delimeter);
1783
MS_DLL_EXPORT char *msHashString(const char *pszStr);
1784
MS_DLL_EXPORT char *msCommifyString(char *str);
1785
MS_DLL_EXPORT const char *msCaseFindSubstring(const char *haystack, const char *needle);
1786
MS_DLL_EXPORT int msHexToInt(char *hex);
1787
MS_DLL_EXPORT char *msGetEncodedString(const char *string, const char *encoding);
1788
MS_DLL_EXPORT char *msConvertWideStringToUTF8 (const wchar_t* string, const char* encoding);
1789
MS_DLL_EXPORT int msGetNextGlyph(const char **in_ptr, char *out_string);
1790
MS_DLL_EXPORT int msGetNumGlyphs(const char *in_ptr);
1791
MS_DLL_EXPORT int msGetUnicodeEntity(const char *inptr, int *unicode);
1792
MS_DLL_EXPORT int msStringIsInteger(const char *string);
1793
MS_DLL_EXPORT int msUTF8ToUniChar(const char *str, int *chPtr); /* maptclutf.c */
1794
MS_DLL_EXPORT char* msGetFirstLine(char* text);
1797
MS_DLL_EXPORT char *strdup(char *s);
1798
#endif /* NEED_STRDUP */
1801
MS_DLL_EXPORT char *strrstr(char *string, char *find);
1802
#endif /* NEED_STRRSTR */
1804
#ifdef NEED_STRCASESTR
1805
MS_DLL_EXPORT char *strcasestr(const char *s, const char *find);
1806
#endif /* NEED_STRCASESTR */
1808
#ifdef NEED_STRNCASECMP
1809
MS_DLL_EXPORT int strncasecmp(const char *s1, const char *s2, int len);
1810
#endif /* NEED_STRNCASECMP */
1812
#ifdef NEED_STRCASECMP
1813
MS_DLL_EXPORT int strcasecmp(const char *s1, const char *s2);
1814
#endif /* NEED_STRCASECMP */
1817
MS_DLL_EXPORT size_t strlcat(char *dst, const char *src, size_t siz);
1818
#endif /* NEED_STRLCAT */
1820
/* in mapsymbol.c */
1821
/* Use this function *only* with mapfile loading phase */
1822
MS_DLL_EXPORT int loadSymbolSet(symbolSetObj *symbolset, mapObj *map);
1823
/* Use this threadsafe wrapper everywhere else */
1824
MS_DLL_EXPORT int msLoadSymbolSet(symbolSetObj *symbolset, mapObj *map);
1825
MS_DLL_EXPORT int msCopySymbol(symbolObj *dst, symbolObj *src, mapObj *map);
1826
MS_DLL_EXPORT int msCopySymbolSet(symbolSetObj *dst, symbolSetObj *src, mapObj *map);
1827
MS_DLL_EXPORT void msInitSymbolSet(symbolSetObj *symbolset);
1828
MS_DLL_EXPORT symbolObj *msGrowSymbolSet( symbolSetObj *symbolset );
1829
MS_DLL_EXPORT int msAddImageSymbol(symbolSetObj *symbolset, char *filename);
1830
MS_DLL_EXPORT int msFreeSymbolSet(symbolSetObj *symbolset);
1831
MS_DLL_EXPORT int msFreeSymbol(symbolObj *symbol);
1832
MS_DLL_EXPORT int msAddNewSymbol(mapObj *map, char *name);
1833
MS_DLL_EXPORT int msAppendSymbol(symbolSetObj *symbolset, symbolObj *symbol);
1834
MS_DLL_EXPORT symbolObj *msRemoveSymbol(symbolSetObj *symbolset, int index);
1835
MS_DLL_EXPORT int msSaveSymbolSet(symbolSetObj *symbolset, const char *filename);
1836
MS_DLL_EXPORT int msLoadImageSymbol(symbolObj *symbol, const char *filename);
1837
MS_DLL_EXPORT symbolObj *msRotateSymbol(symbolObj *symbol, double angle);
1839
MS_DLL_EXPORT imageObj *msSymbolGetImageGD(symbolObj *symbol, outputFormatObj *format);
1840
MS_DLL_EXPORT int msSymbolSetImageGD(symbolObj *symbol, imageObj *image);
1842
MS_DLL_EXPORT int msGetMarkerSize(symbolSetObj *symbolset, styleObj *style, int *width, int *height, double scalefactor);
1843
MS_DLL_EXPORT int msGetCharacterSize(char *character, int size, char *font, rectObj *rect);
1844
MS_DLL_EXPORT double msSymbolGetDefaultSize(symbolObj *s);
1845
MS_DLL_EXPORT void freeImageCache(struct imageCacheObj *ic);
1847
MS_DLL_EXPORT imageObj *msDrawLegend(mapObj *map, int scale_independent); /* in maplegend.c */
1848
MS_DLL_EXPORT int msLegendCalcSize(mapObj *map, int scale_independent, int *size_x, int *size_y, layerObj *lp);
1849
MS_DLL_EXPORT int msEmbedLegend(mapObj *map, imageObj *img);
1850
MS_DLL_EXPORT int msDrawLegendIcon(mapObj* map, layerObj* lp, classObj* myClass, int width, int height, imageObj *img, int dstX, int dstY);
1851
MS_DLL_EXPORT imageObj *msCreateLegendIcon(mapObj* map, layerObj* lp, classObj* myClass, int width, int height);
1853
MS_DLL_EXPORT int msLoadFontSet(fontSetObj *fontSet, mapObj *map); /* in maplabel.c */
1854
MS_DLL_EXPORT int msInitFontSet(fontSetObj *fontset);
1855
MS_DLL_EXPORT int msFreeFontSet(fontSetObj *fontset);
1856
MS_DLL_EXPORT char *msTransformLabelText(mapObj *map, imageObj* image, labelObj *label, char *text);
1857
MS_DLL_EXPORT int msGetLabelSize(imageObj *img, char *string, labelObj *label, rectObj *rect, fontSetObj *fontSet, double scalefactor, int adjustBaseline,double **advances);
1858
MS_DLL_EXPORT int msAddLabel(mapObj *map, int layerindex, int classindex, shapeObj *shape, pointObj *point, labelPathObj *labelpath, char *string, double featuresize, labelObj *label);
1859
MS_DLL_EXPORT void msTestLabelCacheCollisions(labelCacheObj *labelcache, labelObj *labelPtr, int mapwidth, int mapheight, int buffer, labelCacheMemberObj *cachePtr, int current_priority, int current_label, int mindistance, double label_size);
1860
MS_DLL_EXPORT labelCacheMemberObj *msGetLabelCacheMember(labelCacheObj *labelcache, int i);
1862
MS_DLL_EXPORT gdFontPtr msGetBitmapFont(int size);
1863
MS_DLL_EXPORT int msImageTruetypePolyline(symbolSetObj *symbolset, imageObj *img, shapeObj *p, styleObj *style, double scalefactor);
1864
MS_DLL_EXPORT int msImageTruetypeArrow(symbolSetObj *symbolset, gdImagePtr img, shapeObj *p, styleObj *style, double scalefactor);
1866
MS_DLL_EXPORT void msFreeShape(shapeObj *shape); /* in mapprimitive.c */
1867
MS_DLL_EXPORT void msFreeLabelPathObj(labelPathObj *path);
1868
MS_DLL_EXPORT shapeObj *msShapeFromWKT(const char *string);
1869
MS_DLL_EXPORT char *msShapeToWKT(shapeObj *shape);
1870
MS_DLL_EXPORT void msInitShape(shapeObj *shape);
1871
MS_DLL_EXPORT void msShapeDeleteLine( shapeObj *shape, int line );
1872
MS_DLL_EXPORT int msCopyShape(shapeObj *from, shapeObj *to);
1873
MS_DLL_EXPORT int *msGetOuterList(shapeObj *shape);
1874
MS_DLL_EXPORT int *msGetInnerList(shapeObj *shape, int r, int *outerlist);
1875
MS_DLL_EXPORT void msComputeBounds(shapeObj *shape);
1876
MS_DLL_EXPORT void msRectToPolygon(rectObj rect, shapeObj *poly);
1877
MS_DLL_EXPORT void msClipPolylineRect(shapeObj *shape, rectObj rect);
1878
MS_DLL_EXPORT void msClipPolygonRect(shapeObj *shape, rectObj rect);
1879
MS_DLL_EXPORT void msTransformShape(shapeObj *shape, rectObj extent, double cellsize, imageObj *image);
1880
MS_DLL_EXPORT void msOffsetPointRelativeTo(pointObj *point, layerObj *layer);
1881
MS_DLL_EXPORT void msOffsetShapeRelativeTo(shapeObj *shape, layerObj *layer);
1882
MS_DLL_EXPORT void msTransformShapeToPixel(shapeObj *shape, rectObj extent, double cellsize);
1883
MS_DLL_EXPORT void msTransformPixelToShape(shapeObj *shape, rectObj extent, double cellsize);
1884
MS_DLL_EXPORT void msImageCartographicPolyline(gdImagePtr im, shapeObj *p, styleObj *style, symbolObj *symbol, int c, double size, double scalefactor);
1885
MS_DLL_EXPORT void msPolylineComputeLineSegments(shapeObj *shape, double ***segment_lengths, double **line_lengths, int *max_line_index, double *max_line_length, int *segment_index, double *total_length);
1886
MS_DLL_EXPORT pointObj** msPolylineLabelPoint(shapeObj *p, int min_length, int repeat_distance, double ***angles, double ***lengths, int *numpoints, int center_on_longest_segment);
1887
MS_DLL_EXPORT pointObj** msPolylineLabelPointExtended(shapeObj *p, int min_length, int repeat_distance, double ***angles, double ***lengths, int *numpoints, int *regularLines, int numlines, int center_on_longest_segment);
1888
MS_DLL_EXPORT void msPolylineLabelPointLineString(shapeObj *p, int min_length, int repeat_distance, double ***angles, double ***lengths, double** segment_lengths,
1889
int line_index, double line_length, double total_length, int segment_index,
1890
int* labelpoints_index, int* labelpoints_size, pointObj ***labelpoints, int center_on_longest_segment);
1891
MS_DLL_EXPORT labelPathObj** msPolylineLabelPath(imageObj *img, shapeObj *p, int min_length, fontSetObj *fontset, char *string, labelObj *label, double scalefactor, int *numpaths, int** regular_lines, int* num_regular_Lines);
1892
MS_DLL_EXPORT void msPolylineLabelPathLineString(imageObj *img, shapeObj *p, int min_length, fontSetObj *fontset, char *string, labelObj *label, double scalefactor,
1893
int line_index, double** segment_lengths, double line_length, double total_length,
1894
int* labelpaths_index, int* labelpaths_size, labelPathObj ***labelpaths, int** regular_lines, int *regular_lines_index, int* regular_lines_size);
1895
MS_DLL_EXPORT int msPolygonLabelPoint(shapeObj *p, pointObj *lp, double min_dimension);
1896
MS_DLL_EXPORT int msAddLine(shapeObj *p, lineObj *new_line);
1897
MS_DLL_EXPORT int msAddLineDirectly(shapeObj *p, lineObj *new_line);
1898
MS_DLL_EXPORT int msAddPointToLine(lineObj *line, pointObj *point );
1899
MS_DLL_EXPORT double msGetPolygonArea(shapeObj *p);
1900
MS_DLL_EXPORT int msGetPolygonCentroid(shapeObj *p, pointObj *lp, double *miny, double *maxy);
1902
MS_DLL_EXPORT int msDrawRasterLayer(mapObj *map, layerObj *layer, imageObj *image); /* in mapraster.c */
1903
MS_DLL_EXPORT imageObj *msDrawReferenceMap(mapObj *map);
1905
MS_DLL_EXPORT size_t msGetBitArraySize(int numbits); /* in mapbits.c */
1906
MS_DLL_EXPORT ms_bitarray msAllocBitArray(int numbits);
1907
MS_DLL_EXPORT int msGetBit(ms_bitarray array, int index);
1908
MS_DLL_EXPORT void msSetBit(ms_bitarray array, int index, int value);
1909
MS_DLL_EXPORT void msSetAllBits(ms_bitarray array, int index, int value);
1910
MS_DLL_EXPORT void msFlipBit(ms_bitarray array, int index);
1911
MS_DLL_EXPORT int msGetNextBit(ms_bitarray array, int index, int size);
1913
MS_DLL_EXPORT int msLayerInitItemInfo(layerObj *layer);
1914
MS_DLL_EXPORT void msLayerFreeItemInfo(layerObj *layer);
1916
MS_DLL_EXPORT int msLayerOpen(layerObj *layer); /* in maplayer.c */
1917
MS_DLL_EXPORT int msLayerIsOpen(layerObj *layer);
1918
MS_DLL_EXPORT void msLayerClose(layerObj *layer);
1919
MS_DLL_EXPORT int msLayerWhichShapes(layerObj *layer, rectObj rect);
1920
MS_DLL_EXPORT int msLayerWhichItems(layerObj *layer, int get_all, char *metadata);
1921
MS_DLL_EXPORT int msLayerNextShape(layerObj *layer, shapeObj *shape);
1922
MS_DLL_EXPORT int msLayerGetItems(layerObj *layer);
1923
MS_DLL_EXPORT int msLayerSetItems(layerObj *layer, char **items, int numitems);
1924
MS_DLL_EXPORT int msLayerResultsGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
1925
MS_DLL_EXPORT int msLayerGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
1926
MS_DLL_EXPORT int msLayerGetExtent(layerObj *layer, rectObj *extent);
1927
MS_DLL_EXPORT int msLayerSetExtent( layerObj *layer, double minx, double miny, double maxx, double maxy);
1928
MS_DLL_EXPORT int msLayerGetAutoStyle(mapObj *map, layerObj *layer, classObj *c, int tile, long record);
1929
MS_DLL_EXPORT void msLayerAddProcessing( layerObj *layer, const char *directive );
1930
MS_DLL_EXPORT void msLayerSetProcessingKey( layerObj *layer, const char *key,
1932
MS_DLL_EXPORT char *msLayerGetProcessing( layerObj *layer, int proc_index);
1933
MS_DLL_EXPORT char *msLayerGetProcessingKey( layerObj *layer, const char *);
1934
MS_DLL_EXPORT int msLayerClearProcessing( layerObj *layer );
1935
MS_DLL_EXPORT char* msLayerGetFilterString( layerObj *layer );
1937
MS_DLL_EXPORT int msLayerSetTimeFilter(layerObj *lp, const char *timestring,
1938
const char *timefield);
1939
/* Helper functions for layers */
1940
MS_DLL_EXPORT int msLayerMakeBackticsTimeFilter(layerObj *lp, const char *timestring,
1941
const char *timefield);
1943
MS_DLL_EXPORT int msLayerMakePlainTimeFilter(layerObj *lp, const char *timestring,
1944
const char *timefield);
1946
MS_DLL_EXPORT int msLayerApplyCondSQLFilterToLayer(FilterEncodingNode *psNode, mapObj *map,
1947
int iLayerIndex, int bOnlySpatialFilter);
1949
MS_DLL_EXPORT int msLayerApplyPlainFilterToLayer(FilterEncodingNode *psNode, mapObj *map,
1950
int iLayerIndex, int bOnlySpatialFilter);
1954
MS_DLL_EXPORT int msLayerGetNumFeatures(layerObj *layer);
1956
/* These are special because SWF is using these */
1957
int msOGRLayerNextShape(layerObj *layer, shapeObj *shape);
1958
int msOGRLayerGetItems(layerObj *layer);
1959
void msOGRLayerFreeItemInfo(layerObj *layer);
1960
int msOGRLayerGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
1961
int msOGRLayerResultGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
1962
int msOGRLayerGetExtent(layerObj *layer, rectObj *extent);
1965
MS_DLL_EXPORT int msOGRGeometryToShape(OGRGeometryH hGeometry, shapeObj *shape,
1966
OGRwkbGeometryType type);
1967
#endif /* USE_OGR */
1969
MS_DLL_EXPORT int drawSDE(mapObj *map, layerObj *layer, gdImagePtr img);
1971
MS_DLL_EXPORT int msInitializeVirtualTable(layerObj *layer);
1972
MS_DLL_EXPORT int msConnectLayer(layerObj *layer, const int connectiontype,
1973
const char *library_str);
1975
MS_DLL_EXPORT int msINLINELayerInitializeVirtualTable(layerObj *layer);
1976
MS_DLL_EXPORT int msShapeFileLayerInitializeVirtualTable(layerObj *layer);
1977
MS_DLL_EXPORT int msTiledSHPLayerInitializeVirtualTable(layerObj *layer);
1978
MS_DLL_EXPORT int msSDELayerInitializeVirtualTable(layerObj *layer);
1979
MS_DLL_EXPORT int msOGRLayerInitializeVirtualTable(layerObj *layer);
1980
MS_DLL_EXPORT int msPostGISLayerInitializeVirtualTable(layerObj *layer);
1981
MS_DLL_EXPORT int msOracleSpatialLayerInitializeVirtualTable(layerObj *layer);
1982
MS_DLL_EXPORT int msWFSLayerInitializeVirtualTable(layerObj *layer);
1983
MS_DLL_EXPORT int msGraticuleLayerInitializeVirtualTable(layerObj *layer);
1984
MS_DLL_EXPORT int msMYGISLayerInitializeVirtualTable(layerObj *layer);
1985
MS_DLL_EXPORT int msRASTERLayerInitializeVirtualTable(layerObj *layer);
1986
MS_DLL_EXPORT int msPluginLayerInitializeVirtualTable(layerObj *layer);
1988
/* ==================================================================== */
1989
/* Prototypes for functions in mapdraw.c */
1990
/* ==================================================================== */
1991
MS_DLL_EXPORT void msClearLayerPenValues(layerObj *layer);
1992
MS_DLL_EXPORT void msClearScalebarPenValues(scalebarObj *scalebar);
1993
MS_DLL_EXPORT void msClearLegendPenValues(legendObj *legend);
1994
MS_DLL_EXPORT void msClearReferenceMapPenValues(referenceMapObj *referencemap);
1995
MS_DLL_EXPORT void msClearQueryMapPenValues(queryMapObj *querymap);
1996
MS_DLL_EXPORT void msClearPenValues(mapObj *map);
1998
MS_DLL_EXPORT imageObj *msPrepareImage(mapObj *map, int allow_nonsquare);
1999
MS_DLL_EXPORT imageObj *msDrawMap(mapObj *map, int querymap);
2000
MS_DLL_EXPORT int msLayerIsVisible(mapObj *map, layerObj *layer);
2001
MS_DLL_EXPORT int msDrawLayer(mapObj *map, layerObj *layer, imageObj *image);
2002
MS_DLL_EXPORT int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image);
2003
MS_DLL_EXPORT int msDrawQueryLayer(mapObj *map, layerObj *layer, imageObj *image);
2004
MS_DLL_EXPORT int msDrawWMSLayer(mapObj *map, layerObj *layer, imageObj *image);
2005
MS_DLL_EXPORT int msDrawWFSLayer(mapObj *map, layerObj *layer, imageObj *image);
2006
MS_DLL_EXPORT int msDrawShape(mapObj *map, layerObj *layer, shapeObj *shape, imageObj *image, int style, int querymapMode);
2007
MS_DLL_EXPORT int msDrawPoint(mapObj *map, layerObj *layer, pointObj *point, imageObj *image, int classindex, char *labeltext);
2010
MS_DLL_EXPORT int msShapeToRange(styleObj *style, shapeObj *shape);
2011
MS_DLL_EXPORT int msValueToRange(styleObj *style, double fieldVal);
2013
MS_DLL_EXPORT void msCircleDrawLineSymbol(symbolSetObj *symbolset, imageObj *image, pointObj *p, double r, styleObj *style, double scalefactor);
2014
MS_DLL_EXPORT void msCircleDrawShadeSymbol(symbolSetObj *symbolset, imageObj *image, pointObj *p, double r, styleObj *style, double scalefactor);
2015
MS_DLL_EXPORT void msDrawMarkerSymbol(symbolSetObj *symbolset,imageObj *image, pointObj *p, styleObj *style, double scalefactor);
2016
MS_DLL_EXPORT void msDrawLineSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2017
MS_DLL_EXPORT void msDrawShadeSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2019
MS_DLL_EXPORT int msDrawLabel(mapObj *map, imageObj *image, pointObj labelPnt, char *string, labelObj *label, double scalefactor);
2020
MS_DLL_EXPORT int msDrawText(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2021
MS_DLL_EXPORT int msDrawTextLine(imageObj *image, char *string, labelObj *label, labelPathObj *labelpath, fontSetObj *fontset, double scalefactor);
2022
MS_DLL_EXPORT int msDrawLabelCache(imageObj *image, mapObj *map);
2024
MS_DLL_EXPORT void msImageStartLayer(mapObj *map, layerObj *layer, imageObj *image);
2025
MS_DLL_EXPORT void msImageEndLayer(mapObj *map, layerObj *layer, imageObj *image);
2027
MS_DLL_EXPORT void msDrawStartShape(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
2028
MS_DLL_EXPORT void msDrawEndShape(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
2029
/* ==================================================================== */
2030
/* End of Prototypes for functions in mapdraw.c */
2031
/* ==================================================================== */
2033
/* ==================================================================== */
2034
/* Prototypes for functions in mapimagemap.c */
2035
/* ==================================================================== */
2036
MS_DLL_EXPORT imageObj *msImageCreateIM(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, double resolution, double defresolution);
2037
MS_DLL_EXPORT imageObj *msImageLoadIM( const char *filename );
2038
MS_DLL_EXPORT imageObj *msImageLoadGD( const char *filename );
2039
MS_DLL_EXPORT imageObj *msImageLoadGDCtx( gdIOCtx *ctx, const char *driver );
2040
MS_DLL_EXPORT void msImageInitIM( imageObj *image );
2041
MS_DLL_EXPORT void msImageStartLayerIM(mapObj *map, layerObj *layer, imageObj *image);
2042
MS_DLL_EXPORT int msSaveImageIM(imageObj* img, char *filename, outputFormatObj *format);
2043
MS_DLL_EXPORT int msSaveImageIM_LL(imageObj* img, char *filename, int type, int transparent, int interlace, int quality);
2044
MS_DLL_EXPORT void msFreeImagexsIM(imageObj* img);
2045
MS_DLL_EXPORT void msFreeImageIM(imageObj* img);
2046
MS_DLL_EXPORT void msCircleDrawLineSymbolIM(symbolSetObj *symbolset, imageObj* img, pointObj *p, double r, styleObj *style, double scalefactor);
2047
MS_DLL_EXPORT void msCircleDrawShadeSymbolIM(symbolSetObj *symbolset, imageObj* img, pointObj *p, double r, styleObj *style, double scalefactor);
2048
MS_DLL_EXPORT void msDrawMarkerSymbolIM(symbolSetObj *symbolset, imageObj* img, pointObj *p, styleObj *style, double scalefactor);
2049
MS_DLL_EXPORT void msDrawLineSymbolIM(symbolSetObj *symbolset, imageObj* img, shapeObj *p, styleObj *style, double scalefactor);
2050
MS_DLL_EXPORT void msDrawShadeSymbolIM(symbolSetObj *symbolset, imageObj* img, shapeObj *p, styleObj *style, double scalefactor);
2051
MS_DLL_EXPORT int msDrawTextIM(imageObj* img, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2052
MS_DLL_EXPORT int msDrawLabelCacheIM(imageObj* img, mapObj *map);
2053
/* ==================================================================== */
2054
/* End of Prototypes for functions in mapimagemap.c */
2055
/* ==================================================================== */
2057
/* ==================================================================== */
2058
/* Prototypes for functions in mapgd.c */
2059
/* ==================================================================== */
2060
MS_DLL_EXPORT imageObj *msImageLoadGDCtx(gdIOCtx* ctx, const char *driver);
2061
MS_DLL_EXPORT int msCompareColors(colorObj *c1, colorObj *c2);
2062
MS_DLL_EXPORT void msPreAllocateColorsGD(imageObj *image, mapObj *map);
2063
MS_DLL_EXPORT imageObj *msImageCreateGD(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, double resolution, double defresolution);
2064
MS_DLL_EXPORT imageObj *msImageLoadGD( const char *filename );
2065
MS_DLL_EXPORT void msImageInitGD( imageObj *image, colorObj *background );
2066
MS_DLL_EXPORT int msImageSetPenGD(gdImagePtr img, colorObj *color);
2068
#define RESOLVE_PEN_GD(img,color) { if( (color).pen == MS_PEN_UNSET ) msImageSetPenGD( img, &(color) ); }
2070
MS_DLL_EXPORT gdIOCtx *msNewGDFileCtx(FILE *file);
2071
MS_DLL_EXPORT int msSaveImageGD(imageObj *img, char *filename, outputFormatObj *format);
2072
MS_DLL_EXPORT unsigned char *msSaveImageBufferGD(imageObj *img, int *bufsize, outputFormatObj *format);
2073
MS_DLL_EXPORT int msSaveImageGDCtx(imageObj *img, gdIOCtx* ctx, outputFormatObj *format);
2074
MS_DLL_EXPORT int msSaveImageGD_LL(imageObj *img, char *filename, int type, int transparent, int interlace, int quality);
2075
MS_DLL_EXPORT void msFreeImageGD(imageObj *img);
2077
MS_DLL_EXPORT void msCircleDrawLineSymbolGD(symbolSetObj *symbolset, imageObj *img, pointObj *p, double r, styleObj *style, double scalefactor);
2078
MS_DLL_EXPORT void msCircleDrawShadeSymbolGD(symbolSetObj *symbolset, imageObj *img, pointObj *p, double r, styleObj *style, double scalefactor);
2079
MS_DLL_EXPORT void msDrawMarkerSymbolGD(symbolSetObj *symbolset, imageObj *img, pointObj *p, styleObj *style, double scalefactor);
2080
MS_DLL_EXPORT void msDrawLineSymbolGD(symbolSetObj *symbolset, imageObj *img, shapeObj *p, styleObj *style, double scalefactor);
2081
MS_DLL_EXPORT void msDrawShadeSymbolGD(symbolSetObj *symbolset, imageObj *img, shapeObj *p, styleObj *style, double scalefactor);
2083
MS_DLL_EXPORT int msDrawTextGD(imageObj *img, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2084
MS_DLL_EXPORT int msDrawTextLineGD(imageObj *img, char *string, labelObj *label, labelPathObj *labelpath, fontSetObj *fontset, double scalefactor);
2086
MS_DLL_EXPORT void msImageCopyMerge (imageObj *dst, imageObj *src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct);
2087
MS_DLL_EXPORT void msImageCopyMergeNoAlpha (imageObj *dst, imageObj *src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct, colorObj *transparent);
2090
/* ==================================================================== */
2091
/* Prototypes for functions in mapagg.cpp */
2092
/* ==================================================================== */
2094
MS_DLL_EXPORT imageObj *msImageCreateAGG(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, double resolution, double defresolution);
2095
MS_DLL_EXPORT void msImageInitAGG( imageObj *image, colorObj *background );
2097
MS_DLL_EXPORT int msSaveImageAGG(imageObj *img, char *filename, outputFormatObj *format);
2098
MS_DLL_EXPORT unsigned char *msSaveImageBufferAGG(imageObj *img, int *bufsize, outputFormatObj *format);
2099
MS_DLL_EXPORT int msSaveImageAGGCtx(imageObj *img, gdIOCtx* ctx, outputFormatObj *format);
2100
MS_DLL_EXPORT int msSaveImageAGG_LL(imageObj *img, char *filename, int type, int transparent, int interlace, int quality);
2101
MS_DLL_EXPORT void msFreeImageAGG(imageObj *img);
2103
MS_DLL_EXPORT void msPieSliceAGG(imageObj *image, styleObj *style, double center_x, double center_y, double diameter, double start, double end);
2104
MS_DLL_EXPORT void msFilledRectangleAGG (imageObj *image, styleObj *style, double c1_x, double c1_y, double c2_x, double c2_y );
2105
MS_DLL_EXPORT void msCircleDrawLineSymbolAGG(symbolSetObj *symbolset, imageObj *image, pointObj *p, double r, styleObj *style, double scalefactor);
2106
MS_DLL_EXPORT void msCircleDrawShadeSymbolAGG(symbolSetObj *symbolset, imageObj *image, pointObj *p, double r, styleObj *style, double scalefactor);
2107
MS_DLL_EXPORT void msDrawMarkerSymbolAGG(symbolSetObj *symbolset, imageObj *image, pointObj *p, styleObj *style, double scalefactor);
2108
MS_DLL_EXPORT void msDrawLineSymbolAGG(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2109
MS_DLL_EXPORT void msDrawShadeSymbolAGG(symbolSetObj *symbolset, imageObj *image,shapeObj *p, styleObj *style, double scalefactor);
2110
int msGetTruetypeTextBBoxAGG(imageObj *img, char *font, double size, char *string, rectObj *rect, double **advances);
2111
int msGetRasterTextBBoxAGG(imageObj *img, int size, char *string, rectObj *rect);
2112
MS_DLL_EXPORT int msDrawTextAGG(imageObj *imgage, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2114
MS_DLL_EXPORT int msDrawTextLineAGG(imageObj *image, char *string, labelObj *label, labelPathObj *labelpath, fontSetObj *fontset, double scalefactor);
2116
MS_DLL_EXPORT void msTransformShapeAGG(shapeObj *shape, rectObj extent, double cellsize);
2118
MS_DLL_EXPORT void msFreeSymbolCacheAGG(void *buffer);
2120
MS_DLL_EXPORT void msAlphaGD2AGG(imageObj *im);
2121
MS_DLL_EXPORT void msAlphaAGG2GD(imageObj *im);
2122
MS_DLL_EXPORT void msImageCopyMergeAGG (imageObj *dst, imageObj *src, int pct);
2123
#endif /* USE_AGG */
2125
/* various JOIN functions (in mapjoin.c) */
2126
MS_DLL_EXPORT int msJoinConnect(layerObj *layer, joinObj *join);
2127
MS_DLL_EXPORT int msJoinPrepare(joinObj *join, shapeObj *shape);
2128
MS_DLL_EXPORT int msJoinNext(joinObj *join);
2129
MS_DLL_EXPORT int msJoinClose(joinObj *join);
2132
MS_DLL_EXPORT int msDrawRasterLayerLow(mapObj *map, layerObj *layer, imageObj *image);
2133
MS_DLL_EXPORT int msAddColorGD(mapObj *map, gdImagePtr img, int cmt, int r, int g, int b);
2135
MS_DLL_EXPORT int msAddColorAGG(mapObj *map, gdImagePtr img, int cmt, int r, int g, int b);
2137
MS_DLL_EXPORT int msGetClass(layerObj *layer, colorObj *color);
2138
MS_DLL_EXPORT int msGetClass_Float(layerObj *layer, float fValue);
2140
/* in mapdrawgdal.c */
2141
MS_DLL_EXPORT int msDrawRasterLayerGDAL(mapObj *map, layerObj *layer, imageObj *image, void *hDSVoid );
2142
MS_DLL_EXPORT int msGetGDALGeoTransform(void *hDS, mapObj *map, layerObj *layer, double *padfGeoTransform );
2143
MS_DLL_EXPORT int *msGetGDALBandList( layerObj *layer, void *hDS, int max_bands, int *band_count );
2144
MS_DLL_EXPORT double msGetGDALNoDataValue( layerObj *layer, void *hBand, int *pbGotNoData );
2147
MS_DLL_EXPORT int msDrawChartLayer(mapObj *map, layerObj *layer, imageObj *image);
2149
/* ==================================================================== */
2150
/* End of prototypes for functions in mapgd.c */
2151
/* ==================================================================== */
2153
/* ==================================================================== */
2154
/* Prototypes for functions in maputil.c */
2155
/* ==================================================================== */
2157
MS_DLL_EXPORT int msExtentsOverlap(mapObj *map, layerObj *layer);
2160
MS_DLL_EXPORT int getRgbColor(mapObj *map,int i,int *r,int *g,int *b); /* maputil.c */
2161
MS_DLL_EXPORT int msBindLayerToShape(layerObj *layer, shapeObj *shape, int querymapMode);
2162
MS_DLL_EXPORT int msValidateContexts(mapObj *map);
2163
MS_DLL_EXPORT int msEvalContext(mapObj *map, layerObj *layer, char *context);
2164
MS_DLL_EXPORT int msEvalExpression(expressionObj *expression, int itemindex, char **items, int numitems);
2165
MS_DLL_EXPORT int msShapeGetClass(layerObj *layer, shapeObj *shape, double scaledenom, int *classgroup, int numclasses);
2166
MS_DLL_EXPORT char *msShapeGetAnnotation(layerObj *layer, shapeObj *shape);
2167
MS_DLL_EXPORT int msAdjustImage(rectObj rect, int *width, int *height);
2168
MS_DLL_EXPORT double msAdjustExtent(rectObj *rect, int width, int height);
2169
MS_DLL_EXPORT int msConstrainExtent(rectObj *bounds, rectObj *rect, double overlay);
2170
MS_DLL_EXPORT int *msGetLayersIndexByGroup(mapObj *map, char *groupname, int *nCount);
2171
MS_DLL_EXPORT unsigned char *msSaveImageBuffer(imageObj* image, int *size_ptr, outputFormatObj *format);
2172
MS_DLL_EXPORT shapeObj* msOffsetPolyline(shapeObj* shape, double offsetx, double offsety);
2173
/* Functions to chnage the drawing order of the layers. */
2174
/* Defined in mapobject.c */
2175
MS_DLL_EXPORT int msMoveLayerUp(mapObj *map, int nLayerIndex);
2176
MS_DLL_EXPORT int msMoveLayerDown(mapObj *map, int nLayerIndex);
2177
MS_DLL_EXPORT int msSetLayersdrawingOrder(mapObj *self, int *panIndexes);
2178
MS_DLL_EXPORT int msInsertLayer(mapObj *map, layerObj *layer, int nIndex);
2179
MS_DLL_EXPORT layerObj *msRemoveLayer(mapObj *map, int nIndex);
2181
/* Defined in layerobject.c */
2182
MS_DLL_EXPORT int msInsertClass(layerObj *layer,classObj *classobj,int nIndex);
2183
MS_DLL_EXPORT classObj *msRemoveClass(layerObj *layer, int nIndex);
2184
MS_DLL_EXPORT int msMoveClassUp(layerObj *layer, int nClassIndex);
2185
MS_DLL_EXPORT int msMoveClassDown(layerObj *layer, int nClassIndex);
2188
MS_DLL_EXPORT int msMoveStyleUp(classObj *classo, int nStyleIndex);
2189
MS_DLL_EXPORT int msMoveStyleDown(classObj *classo, int nStyleIndex);
2190
MS_DLL_EXPORT int msDeleteStyle(classObj *classo, int iStyleIndex);
2191
MS_DLL_EXPORT int msInsertStyle(classObj *classo, styleObj *style,
2193
MS_DLL_EXPORT styleObj *msRemoveStyle(classObj *classo, int index);
2195
/* Measured shape utility functions. */
2196
MS_DLL_EXPORT pointObj *msGetPointUsingMeasure(shapeObj *shape, double m);
2197
MS_DLL_EXPORT pointObj *msGetMeasureUsingPoint(shapeObj *shape, pointObj *point);
2199
MS_DLL_EXPORT char **msGetAllGroupNames(mapObj* map, int *numTok);
2200
MS_DLL_EXPORT char *msTmpFile(const char *mappath, const char *tmppath, const char *ext);
2201
MS_DLL_EXPORT void msForceTmpFileBase( const char *new_base );
2204
MS_DLL_EXPORT imageObj *msImageCreate(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, mapObj *map);
2206
MS_DLL_EXPORT int msAlphaBlend (int dst, int src);
2208
MS_DLL_EXPORT int msCheckParentPointer(void* p, char* objname);
2210
MS_DLL_EXPORT int *msAllocateValidClassGroups(layerObj *lp, int *nclasses);
2211
/* ==================================================================== */
2212
/* End of prototypes for functions in maputil.c */
2213
/* ==================================================================== */
2216
/* ==================================================================== */
2217
/* End of prototypes for functions in mapswf.c */
2218
/* ==================================================================== */
2220
/* ==================================================================== */
2223
/* ==================================================================== */
2224
/* prototypes for functions in mapsvg.c */
2225
/* ==================================================================== */
2227
MS_DLL_EXPORT imageObj *msImageCreateSVG(int width, int height,
2228
outputFormatObj *format, char *imagepath,
2229
char *imageurl, mapObj *map);
2231
MS_DLL_EXPORT void msImageStartLayerSVG(mapObj *map, layerObj *layer,
2234
MS_DLL_EXPORT void msDrawLineSymbolSVG(symbolSetObj *symbolset, imageObj *image,
2235
shapeObj *p, styleObj *style,
2236
double scalefactor);
2237
MS_DLL_EXPORT void msTransformShapeSVG(shapeObj *shape, rectObj extent, double cellsize,
2239
MS_DLL_EXPORT int msSaveImageSVG(imageObj *image, char *filename);
2240
MS_DLL_EXPORT int msSaveImagetoFpSVG(imageObj *image, FILE *fp);
2241
MS_DLL_EXPORT void msFreeImageSVG(imageObj *image);
2243
MS_DLL_EXPORT void msDrawMarkerSymbolSVG(symbolSetObj *symbolset,
2245
pointObj *p, styleObj *style,
2246
double scalefactor);
2248
MS_DLL_EXPORT int msDrawTextSVG(imageObj *image, pointObj labelPnt, char *string,
2249
labelObj *label, fontSetObj *fontset,
2250
double scalefactor);
2251
MS_DLL_EXPORT int msDrawLabelCacheSVG(imageObj *image, mapObj *map);
2253
MS_DLL_EXPORT int msDrawRasterLayerSVG(mapObj *map, layerObj *layer,
2255
MS_DLL_EXPORT void msDrawShadeSymbolSVG(symbolSetObj *symbolset,
2256
imageObj *image, shapeObj *p,
2257
styleObj *style, double scalefactor);
2260
/* ==================================================================== */
2261
/* prototypes for functions in mapoutput.c */
2262
/* ==================================================================== */
2264
MS_DLL_EXPORT void msApplyDefaultOutputFormats( mapObj * );
2265
MS_DLL_EXPORT void msFreeOutputFormat( outputFormatObj * );
2266
MS_DLL_EXPORT int msGetOutputFormatIndex(mapObj *map, const char *imagetype);
2267
MS_DLL_EXPORT int msRemoveOutputFormat(mapObj *map, const char *imagetype);
2268
MS_DLL_EXPORT int msAppendOutputFormat(mapObj *map, outputFormatObj *format);
2269
MS_DLL_EXPORT outputFormatObj *msSelectOutputFormat( mapObj *map, const char *imagetype );
2270
MS_DLL_EXPORT void msApplyOutputFormat( outputFormatObj **target, outputFormatObj *format, int transparent, int interlaced, int imagequality );
2271
MS_DLL_EXPORT const char *msGetOutputFormatOption( outputFormatObj *format, const char *optionkey, const char *defaultresult );
2272
MS_DLL_EXPORT outputFormatObj *msCreateDefaultOutputFormat( mapObj *map, const char *driver );
2273
MS_DLL_EXPORT int msPostMapParseOutputFormatSetup( mapObj *map );
2274
MS_DLL_EXPORT void msSetOutputFormatOption( outputFormatObj *format, const char *key, const char *value );
2275
MS_DLL_EXPORT void msGetOutputFormatMimeList( mapObj *map, char **mime_list, int max_mime );
2276
MS_DLL_EXPORT void msGetOutputFormatMimeListImg( mapObj *map, char **mime_list, int max_mime );
2277
MS_DLL_EXPORT void msGetOutputFormatMimeListWMS( mapObj *map, char **mime_list, int max_mime );
2278
MS_DLL_EXPORT outputFormatObj *msCloneOutputFormat( outputFormatObj *format );
2279
MS_DLL_EXPORT int msOutputFormatValidate( outputFormatObj *format );
2281
#ifndef gdImageTrueColor
2282
# define gdImageTrueColor(x) (0)
2283
#endif /* not gdImageTrueColor */
2285
/* ==================================================================== */
2286
/* prototypes for functions in mapgdal.c */
2287
/* ==================================================================== */
2288
MS_DLL_EXPORT int msSaveImageGDAL( mapObj *map, imageObj *image, char *filename );
2289
MS_DLL_EXPORT int msInitDefaultGDALOutputFormat( outputFormatObj *format );
2291
/* ==================================================================== */
2292
/* End of prototypes for functions in mapoutput.c */
2293
/* ==================================================================== */
2295
/* ==================================================================== */
2296
/* Public prototype for mapogr.cpp functions. */
2297
/* ==================================================================== */
2298
int MS_DLL_EXPORT msOGRLayerWhichShapes(layerObj *layer, rectObj rect);
2299
int MS_DLL_EXPORT msOGRLayerOpen(layerObj *layer, const char *pszOverrideConnection); /* in mapogr.cpp */
2300
int MS_DLL_EXPORT msOGRLayerClose(layerObj *layer);
2302
char MS_DLL_EXPORT *msOGRShapeToWKT(shapeObj *shape);
2303
shapeObj MS_DLL_EXPORT *msOGRShapeFromWKT(const char *string);
2305
/* ==================================================================== */
2306
/* prototypes for functions in mapcopy */
2307
/* ==================================================================== */
2308
MS_DLL_EXPORT int msCopyMap(mapObj *dst, mapObj *src);
2309
MS_DLL_EXPORT int msCopyLayer(layerObj *dst, layerObj *src);
2310
MS_DLL_EXPORT int msCopyPoint(pointObj *dst, pointObj *src);
2311
MS_DLL_EXPORT int msCopyFontSet(fontSetObj *dst, fontSetObj *src, mapObj *map);
2312
MS_DLL_EXPORT void copyProperty(void *dst, void *src, int size);
2313
MS_DLL_EXPORT char *copyStringProperty(char **dst, char *src);
2314
MS_DLL_EXPORT int msCopyClass(classObj *dst, classObj *src, layerObj *layer);
2315
MS_DLL_EXPORT int msCopyStyle(styleObj *dst, styleObj *src);
2317
/* ==================================================================== */
2318
/* end prototypes for functions in mapcopy */
2319
/* ==================================================================== */
2321
/* ==================================================================== */
2322
/* mappool.c: connection pooling API. */
2323
/* ==================================================================== */
2324
MS_DLL_EXPORT void *msConnPoolRequest( layerObj *layer );
2325
MS_DLL_EXPORT void msConnPoolRelease( layerObj *layer, void * );
2326
MS_DLL_EXPORT void msConnPoolRegister( layerObj *layer,
2328
void (*close)( void * ) );
2329
MS_DLL_EXPORT void msConnPoolCloseUnreferenced( void );
2330
MS_DLL_EXPORT void msConnPoolFinalCleanup( void );
2332
/* ==================================================================== */
2333
/* prototypes for functions in mapcpl.c */
2334
/* ==================================================================== */
2335
MS_DLL_EXPORT const char *msGetBasename( const char *pszFullFilename );
2336
MS_DLL_EXPORT void *msGetSymbol(const char *pszLibrary,
2337
const char *pszEntryPoint);
2339
/* ==================================================================== */
2340
/* include definitions from mapows.h */
2341
/* ==================================================================== */
2344
/* ==================================================================== */
2345
/* prototypes for functions in mapgeos.c */
2346
/* ==================================================================== */
2347
MS_DLL_EXPORT void msGEOSSetup(void);
2348
MS_DLL_EXPORT void msGEOSCleanup(void);
2349
MS_DLL_EXPORT void msGEOSFreeGeometry(shapeObj *shape);
2351
MS_DLL_EXPORT shapeObj *msGEOSShapeFromWKT(const char *string);
2352
MS_DLL_EXPORT char *msGEOSShapeToWKT(shapeObj *shape);
2354
MS_DLL_EXPORT shapeObj *msGEOSBuffer(shapeObj *shape, double width);
2355
MS_DLL_EXPORT shapeObj *msGEOSSimplify(shapeObj *shape, double tolerance);
2356
MS_DLL_EXPORT shapeObj *msGEOSTopologyPreservingSimplify(shapeObj *shape, double tolerance);
2357
MS_DLL_EXPORT shapeObj *msGEOSConvexHull(shapeObj *shape);
2358
MS_DLL_EXPORT shapeObj *msGEOSBoundary(shapeObj *shape);
2359
MS_DLL_EXPORT pointObj *msGEOSGetCentroid(shapeObj *shape);
2360
MS_DLL_EXPORT shapeObj *msGEOSUnion(shapeObj *shape1, shapeObj *shape2);
2361
MS_DLL_EXPORT shapeObj *msGEOSIntersection(shapeObj *shape1, shapeObj *shape2);
2362
MS_DLL_EXPORT shapeObj *msGEOSDifference(shapeObj *shape1, shapeObj *shape2);
2363
MS_DLL_EXPORT shapeObj *msGEOSSymDifference(shapeObj *shape1, shapeObj *shape2);
2365
MS_DLL_EXPORT int msGEOSContains(shapeObj *shape1, shapeObj *shape2);
2366
MS_DLL_EXPORT int msGEOSOverlaps(shapeObj *shape1, shapeObj *shape2);
2367
MS_DLL_EXPORT int msGEOSWithin(shapeObj *shape1, shapeObj *shape2);
2368
MS_DLL_EXPORT int msGEOSCrosses(shapeObj *shape1, shapeObj *shape2);
2369
MS_DLL_EXPORT int msGEOSIntersects(shapeObj *shape1, shapeObj *shape2);
2370
MS_DLL_EXPORT int msGEOSTouches(shapeObj *shape1, shapeObj *shape2);
2371
MS_DLL_EXPORT int msGEOSEquals(shapeObj *shape1, shapeObj *shape2);
2372
MS_DLL_EXPORT int msGEOSDisjoint(shapeObj *shape1, shapeObj *shape2);
2374
MS_DLL_EXPORT double msGEOSArea(shapeObj *shape);
2375
MS_DLL_EXPORT double msGEOSLength(shapeObj *shape);
2376
MS_DLL_EXPORT double msGEOSDistance(shapeObj *shape1, shapeObj *shape2);
2378
/* ==================================================================== */
2379
/* prototypes for functions in mapcrypto.c */
2380
/* ==================================================================== */
2381
MS_DLL_EXPORT int msGenerateEncryptionKey(unsigned char *k);
2382
MS_DLL_EXPORT int msReadEncryptionKeyFromFile(const char *keyfile, unsigned char *k);
2383
MS_DLL_EXPORT void msEncryptStringWithKey(const unsigned char *key, const char *in, char *out);
2384
MS_DLL_EXPORT void msDecryptStringWithKey(const unsigned char *key, const char *in, char *out);
2385
MS_DLL_EXPORT char *msDecryptStringTokens(mapObj *map, const char *in);
2386
MS_DLL_EXPORT void msHexEncode(const unsigned char *in, char *out, int numbytes);
2387
MS_DLL_EXPORT int msHexDecode(const char *in, unsigned char *out, int numchars);
2390
/* ==================================================================== */
2391
/* prototypes for functions in mapswf.c */
2392
/* ==================================================================== */
2393
#ifdef USE_MING_FLASH
2394
MS_DLL_EXPORT imageObj *msImageCreateSWF(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, mapObj *map);
2395
MS_DLL_EXPORT void msImageStartLayerSWF(mapObj *map, layerObj *layer, imageObj *image);
2396
MS_DLL_EXPORT int msDrawLabelSWF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2397
MS_DLL_EXPORT int msDrawLabelCacheSWF(imageObj *image, mapObj *map);
2398
MS_DLL_EXPORT void msDrawLineSymbolSWF(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2399
MS_DLL_EXPORT void msDrawShadeSymbolSWF(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2400
MS_DLL_EXPORT void msDrawMarkerSymbolSWF(symbolSetObj *symbolset, imageObj *image, pointObj *p, styleObj *style, double scalefactor);
2401
MS_DLL_EXPORT int msDrawRasterLayerSWF(mapObj *map, layerObj *layer, imageObj *image);
2402
MS_DLL_EXPORT int msDrawVectorLayerAsRasterSWF(mapObj *map, layerObj *layer, imageObj*image);
2404
MS_DLL_EXPORT int msDrawWMSLayerSWF(int nLayerId, httpRequestObj *pasReqInfo, int numRequests, mapObj *map,
2405
layerObj *layer, imageObj *image);
2407
MS_DLL_EXPORT void msTransformShapeSWF(shapeObj *shape, rectObj extent, double cellsize);
2408
MS_DLL_EXPORT int msSaveImageSWF(imageObj *image, char *filename);
2409
MS_DLL_EXPORT void msFreeImageSWF(imageObj *image);
2410
MS_DLL_EXPORT int draw_textSWF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2411
MS_DLL_EXPORT void msDrawStartShapeSWF(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
2412
#endif /* USE_MING_FLASH */
2414
/* ==================================================================== */
2415
/* prototypes for functions in mappdf.c */
2416
/* ==================================================================== */
2418
MS_DLL_EXPORT PDF *msDrawMapPDF(mapObj *map, PDF *pdf, hashTableObj fontHash);
2419
MS_DLL_EXPORT imageObj *msImageCreatePDF(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, mapObj *map);
2420
MS_DLL_EXPORT void msImageStartLayerPDF(mapObj *map, layerObj *layer, imageObj *image);
2421
MS_DLL_EXPORT int msDrawLabelPDF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2422
MS_DLL_EXPORT int msDrawLabelCachePDF(imageObj *image, mapObj *map);
2423
MS_DLL_EXPORT void msDrawLineSymbolPDF(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2424
MS_DLL_EXPORT void msDrawShadeSymbolPDF(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
2425
MS_DLL_EXPORT void msDrawMarkerSymbolPDF(symbolSetObj *symbolset, imageObj *image, pointObj *p, styleObj *style, double scalefactor);
2426
MS_DLL_EXPORT int msDrawRasterLayerPDF(mapObj *map, layerObj *layer, imageObj *image);
2427
MS_DLL_EXPORT int msDrawVectorLayerAsRasterPDF(mapObj *map, layerObj *layer, imageObj*image);
2428
MS_DLL_EXPORT void msTransformShapePDF(shapeObj *shape, rectObj extent, double cellsize);
2429
MS_DLL_EXPORT int msSaveImagePDF(imageObj *image, char *filename);
2430
MS_DLL_EXPORT void msFreeImagePDF(imageObj *image);
2431
MS_DLL_EXPORT int msDrawTextPDF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
2432
MS_DLL_EXPORT void msDrawStartShapePDF(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
2434
MS_DLL_EXPORT int msDrawWMSLayerPDF(int nLayerId, httpRequestObj *pasReqInfo,
2435
int numRequests, mapObj *map, layerObj *layer, imageObj *image);
2438
#endif /* USE_PDF */
2440
/* ==================================================================== */
2441
/* End of prototypes for functions in mappdf.c */
2442
/* ==================================================================== */
2445
/* ==================================================================== */
2446
/* prototypes for functions in maprgbapng.c */
2447
/* ==================================================================== */
2449
int msSaveImageRGBAQuantized(gdImagePtr img, gdIOCtx *ctx, outputFormatObj *format);
2450
int msSaveImageRGBAPalette(gdImagePtr img, gdIOCtx *ctx ,outputFormatObj *format);
2451
#endif /*USE_RGBA_PNG*/
2452
/* ==================================================================== */
2453
/* end of prototypes for functions in maprgbapng.c */
2454
/* ==================================================================== */
2456
/* ==================================================================== */
2457
/* prototypes for functions in mapgeomtransform.c */
2458
/* ==================================================================== */
2459
#define MS_GEOMTRANSFORM_NONE 0
2460
#define MS_GEOMTRANSFORM_START 1
2461
#define MS_GEOMTRANSFORM_END 2
2462
#define MS_GEOMTRANSFORM_VERTICES 3
2463
#define MS_GEOMTRANSFORM_BBOX 4
2464
#define MS_GEOMTRANSFORM_CENTROID 5
2465
#define MS_GEOMTRANSFORM_BUFFER 6
2466
#define MS_GEOMTRANSFORM_CONVEXHULL 7
2468
MS_DLL_EXPORT int msDrawTransformedShape(mapObj *map, symbolSetObj *symbolset, imageObj *image, shapeObj *shape, styleObj *style, double scalefactor);
2469
MS_DLL_EXPORT void msStyleSetGeomTransform(styleObj *style, char *transform);
2470
MS_DLL_EXPORT char *msStyleGetGeomTransform(styleObj *style);
2471
/* ==================================================================== */
2472
/* end of prototypes for functions in mapgeomtransform.c */
2473
/* ==================================================================== */
2476
/* ==================================================================== */
2477
/* prototypes for functions in mapgraticule.c */
2478
/* ==================================================================== */
2479
MS_DLL_EXPORT graticuleIntersectionObj *msGraticuleLayerGetIntersectionPoints(mapObj *map, layerObj *layer);
2480
MS_DLL_EXPORT void msGraticuleLayerFreeIntersectionPoints( graticuleIntersectionObj *psValue);
2482
/* ==================================================================== */
2483
/* end of prototypes for functions in mapgraticule.c */
2484
/* ==================================================================== */
2494
double width; /* line width in pixels */
2496
/* line pattern, e.g. dots, dashes, etc.. */
2498
double pattern[MS_MAXPATTERNLENGTH];
2500
/* must not be NULL, must be a valid color */
2501
/* color.alpha must be used if supported by the renderer */
2504
int linecap; /* MS_CJC_TRIANGLE, MS_CJC_SQUARE, MS_CJC_ROUND, MS_CJC_BUTT */
2505
int linejoin; /* MS_CJC_BEVEL MS_CJC_ROUND MS_CJC_MITER */
2506
double linejoinmaxsize;
2515
/* must not be NULL, must be a valid color *
2516
* color.alpha must be used if supported by the renderer */
2520
/* if not null, use the passed tile (which is a pointer to a
2521
* renderer specific structure) for tiling the polygon */
2531
/* must not be NULL, must be a valid color */
2532
/* color.alpha must be used if supported by the renderer */
2534
colorObj backgroundcolor;
2536
double outlinewidth;
2537
colorObj outlinecolor;
2539
/* scalefactor to be applied on the tile or symbol*/
2542
/* rotation to apply on the symbol (and the tile?)
2549
symbolStyleObj style;
2560
/* full path to truetype font file */
2568
/* if outlinewidth is > 0, use the outlinecolor */
2569
double outlinewidth;
2570
colorObj outlinecolor;
2572
/* if shadowsizex or shadowsizey are != 0,
2573
* use the shadowcolor */
2574
double shadowsizex, shadowsizey;
2575
colorObj shadowcolor;
2580
void msFreeRasterBuffer(rasterBufferObj *b);
2584
MS_DLL_EXPORT int msInitializeRendererVTable(outputFormatObj *outputformat);
2585
MS_DLL_EXPORT int msPopulateRendererVTableCairoRaster( rendererVTableObj *renderer );
2586
MS_DLL_EXPORT int msPopulateRendererVTableCairoSVG( rendererVTableObj *renderer );
2587
MS_DLL_EXPORT int msPopulateRendererVTableCairoPDF( rendererVTableObj *renderer );
2588
MS_DLL_EXPORT int msPopulateRendererVTableOGL( rendererVTableObj *renderer );
2590
//allocate 50k for starters
2591
#define MS_DEFAULT_BUFFER_ALLOC 50000
2593
typedef struct _autobuffer {
2594
unsigned char *data;
2597
size_t _next_allocation_size;
2601
int msSaveRasterBuffer(rasterBufferObj *data, FILE *stream,
2602
outputFormatObj *format);
2603
int msSaveRasterBufferToBuffer(rasterBufferObj *data, bufferObj *buffer,
2604
outputFormatObj *format);
2606
inline void msBufferInit(bufferObj *buffer);
2607
inline void msBufferResize(bufferObj *buffer, size_t target_size);
2608
MS_DLL_EXPORT inline void msBufferFree(bufferObj *buffer);
2609
MS_DLL_EXPORT inline void msBufferAppend(bufferObj *buffer, void *data, size_t length);
2611
struct rendererVTable {
2612
int supports_transparent_layers;
2613
int supports_pixel_buffer;
2614
int supports_imagecache;
2616
void (*renderLine)(imageObj *img, shapeObj *p, strokeStyleObj *style);
2617
void (*renderPolygon)(imageObj *img, shapeObj *p, colorObj *color);
2618
void (*renderPolygonTiled)(imageObj *img, shapeObj *p, imageObj *tile);
2619
void (*renderLineTiled)(imageObj *img, shapeObj *p, imageObj *tile);
2621
void (*renderGlyphs)(imageObj *img, double x, double y,
2622
labelStyleObj *style, char *text);
2624
void (*renderGlyphsLine)(imageObj *img,labelPathObj *labelpath,
2625
labelStyleObj *style, char *text);
2627
void (*renderVectorSymbol)(imageObj *img, double x, double y,
2628
symbolObj *symbol, symbolStyleObj *style);
2630
void* (*createVectorSymbolTile)(int width, int height,
2631
symbolObj *symbol, symbolStyleObj *style);
2633
void (*renderPixmapSymbol)(imageObj *img, double x, double y,
2634
symbolObj *symbol, symbolStyleObj *style);
2636
void* (*createPixmapSymbolTile)(int width, int height,
2637
symbolObj *symbol, symbolStyleObj *style);
2639
void (*renderEllipseSymbol)(imageObj *image, double x, double y,
2640
symbolObj *symbol, symbolStyleObj *style);
2642
void* (*createEllipseSymbolTile)(int width, int height,
2643
symbolObj *symbol, symbolStyleObj *style);
2645
void (*renderTruetypeSymbol)(imageObj *img, double x, double y,
2646
symbolObj *symbol, symbolStyleObj *style);
2648
void* (*createTruetypeSymbolTile)(int width, int height,
2649
symbolObj *symbol, symbolStyleObj *style);
2651
void (*renderTile)(imageObj *img, imageObj *tile, double x, double y);
2654
void (*getRasterBuffer)(imageObj *img,rasterBufferObj *rb);
2656
void (*mergeRasterBuffer)(imageObj *dest, rasterBufferObj *overlay, double opacity, int dstX, int dstY);
2658
imageObj* (*createImage)(int width, int height, outputFormatObj *format, colorObj* bg);
2659
int (*saveImage)(imageObj *img, FILE *fp, outputFormatObj *format);
2662
/* helper functions */
2663
int (*getTruetypeTextBBox)(imageObj *img,char *font, double size, char *string,
2664
rectObj *rect, double **advances);
2666
void (*startNewLayer)(imageObj *img, double opacity);
2667
void (*closeNewLayer)(imageObj *img, double opacity);
2669
void (*transformShape)(shapeObj *shape, rectObj extend, double cellsize);
2670
void (*freeImage)(imageObj *image);
2671
void (*freeTile)(imageObj *tile);
2672
void (*freeSymbol)(symbolObj *symbol);