1
/**********************************************************************
2
* $Id: php_mapscript.h 11619 2011-04-27 15:23:07Z aboudreault $
5
* Purpose: PHP/MapScript extension for MapServer. Header file
6
* - prototypes / module definitions
7
* Author: Daniel Morissette, DM Solutions Group (dmorissette@dmsolutions.ca)
9
**********************************************************************
10
* Copyright (c) 2000-2005, Daniel Morissette, DM Solutions Group Inc.
12
* Permission is hereby granted, free of charge, to any person obtaining a
13
* copy of this software and associated documentation files (the "Software"),
14
* to deal in the Software without restriction, including without limitation
15
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
16
* and/or sell copies of the Software, and to permit persons to whom the
17
* Software is furnished to do so, subject to the following conditions:
19
* The above copyright notice and this permission notice shall be included in
20
* all copies of this Software or works derived from this Software.
22
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28
* DEALINGS IN THE SOFTWARE.
29
**********************************************************************/
32
#ifndef PHP_MAPSCRIPT_H
33
#define PHP_MAPSCRIPT_H
36
#include "zend_interfaces.h"
37
#include "php_mapscript_util.h"
45
#if defined(_WIN32) && !defined(__CYGWIN__)
53
#include "mapserver.h"
55
#endif /* USE_PHP_REGEX */
58
#include "maptemplate.h"
59
#include "mapogcsld.h"
61
#define MAPSCRIPT_VERSION "($Revision: 11619 $ $Date: 2011-04-27 11:23:07 -0400 (Wed, 27 Apr 2011) $)"
63
extern zend_module_entry mapscript_module_entry;
64
#define phpext_mapscript_ptr &mapscript_module_entry
66
#ifndef zend_parse_parameters_none
67
#define zend_parse_parameters_none() \
68
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
72
#define Z_ADDREF_P(pz) (pz)->refcount++
76
#define Z_DELREF_P(pz) (pz)->refcount--
79
#ifndef Z_SET_REFCOUNT_P
80
#define Z_SET_REFCOUNT_P(pz, rc) (pz)->refcount = rc
83
/* Taken from the CAIRO php extension */
84
/* turn error handling to exception mode and restore */
85
#if defined(PHP_VERSION_ID) && PHP_VERSION_ID >= 50300
86
/* 5.3 version of the macros */
87
#define PHP_MAPSCRIPT_ERROR_HANDLING(force_exceptions) \
88
zend_error_handling error_handling; \
89
if(force_exceptions || getThis()) { \
90
zend_replace_error_handling(EH_THROW, mapscript_ce_mapscriptexception, &error_handling TSRMLS_CC); \
93
#define PHP_MAPSCRIPT_RESTORE_ERRORS(force_exceptions) \
94
if(force_exceptions || getThis()) { \
95
zend_restore_error_handling(&error_handling TSRMLS_CC); \
99
/* 5.2 versions of the macros */
100
#define PHP_MAPSCRIPT_ERROR_HANDLING(force_exceptions) \
101
if(force_exceptions || getThis()) { \
102
php_set_error_handling(EH_THROW, mapscript_ce_mapscriptexception TSRMLS_CC); \
105
#define PHP_MAPSCRIPT_RESTORE_ERRORS(force_exceptions) \
106
if(force_exceptions || getThis()) { \
107
php_std_error_handling(); \
112
/* MapScript objects */
113
typedef struct _parent_object {
114
zval *val; // the zval of the parent
115
zval **child_ptr; // a ptr to a parent property, which point to the child object.
116
// should be set to NULL when the child is destroyed
119
typedef struct _php_color_object {
121
parent_object parent;
125
typedef struct _php_rect_object {
127
parent_object parent;
132
typedef struct _php_hashtable_object {
134
parent_object parent;
135
hashTableObj *hashtable;
136
} php_hashtable_object;
138
typedef struct _php_symbol_object {
140
parent_object parent;
144
typedef struct _php_class_object {
146
parent_object parent; //old layer
152
typedef struct _php_image_object {
157
typedef struct _php_web_object {
159
parent_object parent;
165
typedef struct _php_legend_object {
167
parent_object parent;
174
typedef struct _php_outputformat_object {
176
parent_object parent;
177
outputFormatObj *outputformat;
178
} php_outputformat_object;
180
typedef struct _php_querymap_object {
182
parent_object parent;
184
queryMapObj *querymap;
185
} php_querymap_object;
187
typedef struct _php_grid_object {
189
parent_object parent;
193
typedef struct _php_error_object {
198
typedef struct _php_referencemap_object {
200
parent_object parent;
204
referenceMapObj *referencemap;
205
} php_referencemap_object;
207
typedef struct _php_label_object {
209
parent_object parent;
213
zval *backgroundcolor;
214
zval *backgroundshadowcolor;
218
typedef struct _php_style_object {
220
parent_object parent;
223
zval *backgroundcolor;
227
typedef struct _php_projection_object {
229
parent_object parent;
231
projectionObj *projection;
232
} php_projection_object;
234
typedef struct _php_point_object {
236
parent_object parent;
241
typedef struct _php_line_object {
243
parent_object parent;
248
typedef struct _php_shape_object {
250
parent_object parent;
257
typedef struct _php_shapefile_object {
260
shapefileObj *shapefile;
261
} php_shapefile_object;
263
typedef struct _php_labelcache_object {
265
parent_object parent;
266
labelCacheObj *labelcache;
267
} php_labelcache_object;
269
typedef struct _php_labelcachemember_object {
271
parent_object parent;
272
zval *label; /* should be immutable */
273
zval *point; /* should be immutable */
274
zval *styles; /* should be immutable */
275
zval *poly; /* should be immutable */
276
labelCacheMemberObj *labelcachemember;
277
} php_labelcachemember_object;
279
typedef struct _php_result_object {
281
parent_object parent;
285
typedef struct _php_scalebar_object {
287
parent_object parent;
289
zval *backgroundcolor;
293
scalebarObj *scalebar;
294
} php_scalebar_object;
296
typedef struct _php_owsrequest_object {
298
cgiRequestObj *cgirequest;
299
} php_owsrequest_object;
301
typedef struct _php_layer_object {
303
parent_object parent; //old map
314
typedef struct _php_map_object {
330
typedef struct _php_cluster_object {
332
parent_object parent;
335
} php_cluster_object;
337
/* Lifecyle functions*/
338
PHP_MINIT_FUNCTION(mapscript);
339
PHP_MINFO_FUNCTION(mapscript);
340
PHP_MSHUTDOWN_FUNCTION(mapscript);
341
PHP_RINIT_FUNCTION(mapscript);
342
PHP_RSHUTDOWN_FUNCTION(mapscript);
344
PHP_MINIT_FUNCTION(mapscript_error);
345
PHP_MINIT_FUNCTION(color);
346
PHP_MINIT_FUNCTION(label);
347
PHP_MINIT_FUNCTION(style);
348
PHP_MINIT_FUNCTION(symbol);
349
PHP_MINIT_FUNCTION(image);
350
PHP_MINIT_FUNCTION(web);
351
PHP_MINIT_FUNCTION(legend);
352
PHP_MINIT_FUNCTION(outputformat);
353
PHP_MINIT_FUNCTION(querymap);
354
PHP_MINIT_FUNCTION(grid);
355
PHP_MINIT_FUNCTION(error);
356
PHP_MINIT_FUNCTION(referencemap);
357
PHP_MINIT_FUNCTION(class);
358
PHP_MINIT_FUNCTION(projection);
359
PHP_MINIT_FUNCTION(labelcachemember);
360
PHP_MINIT_FUNCTION(labelcache);
361
PHP_MINIT_FUNCTION(result);
362
PHP_MINIT_FUNCTION(scalebar);
363
PHP_MINIT_FUNCTION(owsrequest);
364
PHP_MINIT_FUNCTION(point);
365
PHP_MINIT_FUNCTION(rect);
366
PHP_MINIT_FUNCTION(hashtable);
367
PHP_MINIT_FUNCTION(line);
368
PHP_MINIT_FUNCTION(shape);
369
PHP_MINIT_FUNCTION(shapefile);
370
PHP_MINIT_FUNCTION(layer);
371
PHP_MINIT_FUNCTION(map);
372
PHP_MINIT_FUNCTION(cluster);
374
/* mapscript functions */
375
PHP_FUNCTION(ms_GetVersion);
376
PHP_FUNCTION(ms_GetVersionInt);
377
PHP_FUNCTION(ms_GetErrorObj);
378
PHP_FUNCTION(ms_ResetErrorList);
379
PHP_FUNCTION(ms_getCwd);
380
PHP_FUNCTION(ms_getPid);
381
PHP_FUNCTION(ms_getScale);
382
PHP_FUNCTION(ms_tokenizeMap);
383
PHP_FUNCTION(ms_ioInstallStdoutToBuffer);
384
PHP_FUNCTION(ms_ioInstallStdinFromBuffer);
385
PHP_FUNCTION(ms_ioGetStdoutBufferString);
386
PHP_FUNCTION(ms_ioResetHandlers);
387
PHP_FUNCTION(ms_ioStripStdoutBufferContentType);
388
PHP_FUNCTION(ms_ioGetStdoutBufferBytes);
390
/* object constructors */
391
PHP_FUNCTION(ms_newLineObj);
392
PHP_FUNCTION(ms_newRectObj);
393
PHP_FUNCTION(ms_newShapeObj);
394
PHP_FUNCTION(ms_shapeObjFromWkt);
395
PHP_FUNCTION(ms_newOWSRequestObj);
396
PHP_FUNCTION(ms_newShapeFileObj);
397
PHP_FUNCTION(ms_newMapObj);
398
PHP_FUNCTION(ms_newMapObjFromString);
399
PHP_FUNCTION(ms_newLayerObj);
400
PHP_FUNCTION(ms_newPointObj);
401
PHP_FUNCTION(ms_newProjectionObj);
402
PHP_FUNCTION(ms_newStyleObj);
403
PHP_FUNCTION(ms_newSymbolObj);
404
PHP_FUNCTION(ms_newClassObj);
405
PHP_FUNCTION(ms_newGridObj);
407
/* mapscript zend class entries */
408
extern zend_object_handlers mapscript_std_object_handlers;
409
extern zend_class_entry *mapscript_ce_mapscriptexception;
410
extern zend_class_entry *mapscript_ce_color;
411
extern zend_class_entry *mapscript_ce_label;
412
extern zend_class_entry *mapscript_ce_projection;
413
extern zend_class_entry *mapscript_ce_point;
414
extern zend_class_entry *mapscript_ce_rect;
415
extern zend_class_entry *mapscript_ce_hashtable;
416
extern zend_class_entry *mapscript_ce_style;
417
extern zend_class_entry *mapscript_ce_class;
418
extern zend_class_entry *mapscript_ce_symbol;
419
extern zend_class_entry *mapscript_ce_image;
420
extern zend_class_entry *mapscript_ce_web;
421
extern zend_class_entry *mapscript_ce_legend;
422
extern zend_class_entry *mapscript_ce_outputformat;
423
extern zend_class_entry *mapscript_ce_querymap;
424
extern zend_class_entry *mapscript_ce_grid;
425
extern zend_class_entry *mapscript_ce_error;
426
extern zend_class_entry *mapscript_ce_referencemap;
427
extern zend_class_entry *mapscript_ce_line;
428
extern zend_class_entry *mapscript_ce_shape;
429
extern zend_class_entry *mapscript_ce_shapefile;
430
extern zend_class_entry *mapscript_ce_labelcachemember;
431
extern zend_class_entry *mapscript_ce_labelcache;
432
extern zend_class_entry *mapscript_ce_result;
433
extern zend_class_entry *mapscript_ce_scalebar;
434
extern zend_class_entry *mapscript_ce_owsrequest;
435
extern zend_class_entry *mapscript_ce_layer;
436
extern zend_class_entry *mapscript_ce_map;
437
extern zend_class_entry *mapscript_ce_cluster;
439
/* PHP Object constructors */
440
extern zend_object_value mapscript_object_new(zend_object *zobj, zend_class_entry *ce,
441
void (*zend_objects_free_object) TSRMLS_DC);
442
extern zend_object_value mapscript_object_new_ex(zend_object *zobj, zend_class_entry *ce,
443
void (*zend_objects_free_object),
444
zend_object_handlers *object_handlers TSRMLS_DC);
445
extern void mapscript_fetch_object(zend_class_entry *ce, zval* zval_parent, php_layer_object* layer,
446
void *internal_object, zval **php_object_storage,
447
zval ***return_value_ptr TSRMLS_DC);
448
extern void mapscript_create_color(colorObj *color, parent_object parent, zval *return_value TSRMLS_DC);
449
extern void mapscript_create_rect(rectObj *rect, parent_object php_parent, zval *return_value TSRMLS_DC);
450
extern void mapscript_create_hashtable(hashTableObj *hashtable, parent_object parent, zval *return_value TSRMLS_DC);
451
extern void mapscript_create_label(labelObj *label, parent_object parent, zval *return_value TSRMLS_DC);
452
extern void mapscript_create_style(styleObj *style, parent_object parent, zval *return_value TSRMLS_DC);
453
extern void mapscript_create_symbol(symbolObj *symbol, parent_object parent, zval *return_value TSRMLS_DC);
454
extern void mapscript_create_class(classObj *class, parent_object parent, zval *return_value TSRMLS_DC);
455
extern void mapscript_create_labelcachemember(labelCacheMemberObj *labelcachemember,
456
parent_object parent, zval *return_value TSRMLS_DC);
457
extern void mapscript_create_labelcache(labelCacheObj *labelcache,
458
parent_object parent, zval *return_value TSRMLS_DC);
459
extern void mapscript_create_result(resultObj *result,
460
parent_object parent, zval *return_value TSRMLS_DC);
461
extern void mapscript_create_scalebar(scalebarObj *scalebar, parent_object parent, zval *return_value TSRMLS_DC);
462
extern void mapscript_create_owsrequest(cgiRequestObj *cgirequest, zval *return_value TSRMLS_DC);
463
extern void mapscript_create_image(imageObj *image, zval *return_value TSRMLS_DC);
464
extern void mapscript_create_web(webObj *web, parent_object parent, zval *return_value TSRMLS_DC);
465
extern void mapscript_create_legend(legendObj *legend, parent_object parent, zval *return_value TSRMLS_DC);
466
extern void mapscript_create_outputformat(outputFormatObj *outputformat, parent_object parent, zval *return_value TSRMLS_DC);
467
extern void mapscript_create_querymap(queryMapObj *querymap, parent_object parent, zval *return_value TSRMLS_DC);
468
extern void mapscript_create_grid(graticuleObj *grid, parent_object parent, zval *return_value TSRMLS_DC);
469
extern void mapscript_create_error(errorObj *error, zval *return_value TSRMLS_DC);
470
extern void mapscript_create_referencemap(referenceMapObj *referenceMap, parent_object parent, zval *return_value TSRMLS_DC);
471
extern void mapscript_create_point(pointObj *point, parent_object parent, zval *return_value TSRMLS_DC);
472
extern void mapscript_create_projection(projectionObj *projection,
473
parent_object parent, zval *return_value TSRMLS_DC);
474
extern void mapscript_create_line(lineObj *line, parent_object parent, zval *return_value TSRMLS_DC);
475
extern void mapscript_create_shape(shapeObj *shape, parent_object parent, php_layer_object *php_layer, zval *return_value TSRMLS_DC);
476
extern void mapscript_create_shapefile(shapefileObj *shapefile, zval *return_value TSRMLS_DC);
477
extern void mapscript_create_layer(layerObj *layer, parent_object parent, zval *return_value TSRMLS_DC);
478
extern void mapscript_create_map(mapObj *map, zval *return_value TSRMLS_DC);
479
extern void mapscript_create_cluster(clusterObj *cluster, parent_object php_parent, zval *return_value TSRMLS_DC);
481
/* Exported functions for PHP Mapscript API */
482
/* throw a MapScriptException */
483
extern zval * mapscript_throw_exception(char *format TSRMLS_DC, ...);
484
/* print all MapServer errors (as Warning) and throw a MapScriptException */
485
extern zval* mapscript_throw_mapserver_exception(char *format TSRMLS_DC, ...);
486
extern void mapscript_report_mapserver_error(int error_type TSRMLS_DC);
487
extern void mapscript_report_php_error(int error_type, char *format TSRMLS_DC, ...);
489
/*=====================================================================
490
* Internal functions from mapscript_i.c
491
*====================================================================*/
493
mapObj *mapObj_new(char *filename, char *new_path);
494
mapObj *mapObj_newFromString(char *map_text, char *new_path);
495
void mapObj_destroy(mapObj* self);
496
mapObj *mapObj_clone(mapObj* self);
497
int mapObj_setRotation(mapObj* self, double rotation_angle );
498
layerObj *mapObj_getLayer(mapObj* self, int i);
499
layerObj *mapObj_getLayerByName(mapObj* self, char *name);
500
int *mapObj_getLayersIndexByGroup(mapObj* self, char *groupname,
502
int mapObj_getSymbolByName(mapObj* self, char *name);
503
void mapObj_prepareQuery(mapObj* self);
504
imageObj *mapObj_prepareImage(mapObj* self);
505
imageObj *mapObj_draw(mapObj* self);
506
imageObj *mapObj_drawQuery(mapObj* self);
507
imageObj *mapObj_drawLegend(mapObj* self);
508
imageObj *mapObj_drawScalebar(mapObj* self);
509
imageObj *mapObj_drawReferenceMap(mapObj* self);
510
int mapObj_embedScalebar(mapObj* self, imageObj *img);
511
int mapObj_embedLegend(mapObj* self, imageObj *img);
512
int mapObj_drawLabelCache(mapObj* self, imageObj *img);
513
labelCacheMemberObj *mapObj_getLabel(mapObj* self, int i);
514
int mapObj_queryByPoint(mapObj* self, pointObj *point,
515
int mode, double buffer);
516
int mapObj_queryByRect(mapObj* self, rectObj rect);
517
int mapObj_queryByFeatures(mapObj* self, int slayer);
518
int mapObj_queryByShape(mapObj *self, shapeObj *shape);
519
int mapObj_queryByIndex(mapObj *self, int qlayer,
520
int tileindex, int shapeindex,
522
int mapObj_saveQuery(mapObj *self, char *filename, int results);
523
int mapObj_loadQuery(mapObj *self, char *filename);
525
int mapObj_setWKTProjection(mapObj *self, char *string);
526
char* mapObj_getProjection(mapObj* self);
527
int mapObj_setProjection(mapObj* self, char *string);
528
int mapObj_save(mapObj* self, char *filename);
529
char *mapObj_getMetaData(mapObj *self, char *name);
530
int mapObj_setMetaData(mapObj *self, char *name, char *value);
531
int mapObj_removeMetaData(mapObj *self, char *name);
532
void mapObj_freeQuery(mapObj *self, int qlayer);
533
int mapObj_moveLayerup(mapObj *self, int layerindex);
534
int mapObj_moveLayerdown(mapObj *self, int layerindex);
535
int *mapObj_getLayersdrawingOrder(mapObj *self);
536
int mapObj_setLayersdrawingOrder(mapObj *self, int *panIndexes);
538
char *mapObj_processTemplate(mapObj *self, int bGenerateImages,
539
char **names, char **values,
541
char *mapObj_processLegendTemplate(mapObj *self,
542
char **names, char **values,
544
char *mapObj_processQueryTemplate(mapObj *self,
546
char **names, char **values,
548
int mapObj_setSymbolSet(mapObj *self, char *szFileName);
549
int mapObj_getNumSymbols(mapObj *self);
550
int mapObj_setFontSet(mapObj *self, char *szFileName);
551
int mapObj_saveMapContext(mapObj *self, char *szFileName);
552
int mapObj_loadMapContext(mapObj *self, char *szFileName,
553
int bUniqueLayerName);
554
int mapObj_selectOutputFormat(mapObj *self,
555
const char *imagetype);
556
int mapObj_applySLD(mapObj *self, char *sld);
557
int mapObj_applySLDURL(mapObj *self, char *sld);
558
char *mapObj_generateSLD(mapObj *self);
559
int mapObj_loadOWSParameters(mapObj *self, cgiRequestObj *request,
560
char *wmtver_string);
561
int mapObj_OWSDispatch(mapObj *self, cgiRequestObj *req );
562
int mapObj_insertLayer(mapObj *self, layerObj *layer, int index);
563
layerObj *mapObj_removeLayer(mapObj *self, int layerindex);
565
int mapObj_setCenter(mapObj *self, pointObj *center);
566
int mapObj_offsetExtent(mapObj *self, double x, double y);
567
int mapObj_scaleExtent(mapObj *self, double zoomfactor, double minscaledenom,
568
double maxscaledenom);
570
layerObj *layerObj_new(mapObj *map);
571
void layerObj_destroy(layerObj* self);
572
int layerObj_updateFromString(layerObj *self, char *snippet);
573
int layerObj_open(layerObj *self);
574
int layerObj_whichShapes(layerObj *self, rectObj *poRect);
575
shapeObj *layerObj_nextShape(layerObj *self);
576
void layerObj_close(layerObj *self);
577
int layerObj_getShape(layerObj *self, shapeObj *shape,
578
int tileindex, int shapeindex);
579
resultObj *layerObj_getResult(layerObj *self, int i);
580
classObj *layerObj_getClass(layerObj *self, int i);
581
int layerObj_getClassIndex(layerObj *self, mapObj *map, shapeObj *shape,
582
int *classgroup, int numclasses);
583
int layerObj_draw(layerObj *self, mapObj *map, imageObj *img);
584
int layerObj_drawQuery(layerObj *self, mapObj *map, imageObj *img);
585
int layerObj_queryByAttributes(layerObj *self, mapObj *map,
586
char *qitem, char *qstring,
588
int layerObj_queryByPoint(layerObj *self, mapObj *map,
589
pointObj *point, int mode, double buffer);
590
int layerObj_queryByRect(layerObj *self, mapObj *map,rectObj rect);
591
int layerObj_queryByFeatures(layerObj *self, mapObj *map,
593
int layerObj_queryByShape(layerObj *self, mapObj *map,
595
int layerObj_setFilter(layerObj *self, char *string);
596
char* layerObj_getFilter(layerObj *self);
597
int layerObj_setWKTProjection(layerObj *self, char *string);
598
char* layerObj_getProjection(layerObj *self);
599
int layerObj_setProjection(layerObj *self, char *string);
600
int layerObj_addFeature(layerObj *self, shapeObj *shape);
601
char *layerObj_getMetaData(layerObj *self, char *name);
602
int layerObj_setMetaData(layerObj *self, char *name, char *value);
603
int layerObj_removeMetaData(layerObj *self, char *name);
604
char *layerObj_getWMSFeatureInfoURL(layerObj *self, mapObj *map,
605
int click_x, int click_y,
608
char *layerObj_executeWFSGetFeature(layerObj *self);
609
int layerObj_applySLD(layerObj *self, char *sld, char *stylelayer);
610
int layerObj_applySLDURL(layerObj *self, char *sld, char *stylelayer);
611
char *layerObj_generateSLD(layerObj *self);
612
int layerObj_moveClassUp(layerObj *self, int index);
613
int layerObj_moveClassDown(layerObj *self, int index);
614
classObj *layerObj_removeClass(layerObj *self, int index);
615
int layerObj_setConnectionType(layerObj *self, int connectiontype,
616
const char *library_str) ;
618
int labelObj_updateFromString(labelObj *self, char *snippet);
620
int legendObj_updateFromString(legendObj *self, char *snippet);
622
int queryMapObj_updateFromString(queryMapObj *self, char *snippet);
624
int referenceMapObj_updateFromString(referenceMapObj *self, char *snippet);
626
int scalebarObj_updateFromString(scalebarObj *self, char *snippet);
628
int webObj_updateFromString(webObj *self, char *snippet);
630
classObj *classObj_new(layerObj *layer, classObj *class);
631
int classObj_updateFromString(classObj *self, char *snippet);
632
void classObj_destroy(classObj* self);
633
int classObj_setExpression(classObj *self, char *string);
634
char *classObj_getExpressionString(classObj *self);
635
int classObj_setText(classObj *self,layerObj *layer,char *string);
636
char *classObj_getTextString(classObj *self);
637
int classObj_drawLegendIcon(classObj *self,
640
int width, int height,
643
imageObj *classObj_createLegendIcon(classObj *self,
646
int width, int height);
647
int classObj_setSymbolByName(classObj *self,
649
char *pszSymbolName);
650
int classObj_setOverlaySymbolByName(classObj *self,
652
char *pszOverlaySymbolName);
653
classObj *classObj_clone(classObj *class, layerObj *layer);
654
int classObj_moveStyleUp(classObj *self, int index);
655
int classObj_moveStyleDown(classObj *self, int index);
656
int classObj_deleteStyle(classObj *self, int index);
657
char *classObj_getMetaData(classObj *self, char *name);
658
int classObj_setMetaData(classObj *self, char *name, char *value);
659
int classObj_removeMetaData(classObj *self, char *name);
661
pointObj *pointObj_new();
662
void pointObj_destroy(pointObj *self);
663
int pointObj_project(pointObj *self, projectionObj *in,
665
int pointObj_draw(pointObj *self, mapObj *map, layerObj *layer,
666
imageObj *img, int class_index,
668
double pointObj_distanceToPoint(pointObj *self, pointObj *point);
669
double pointObj_distanceToLine(pointObj *self, pointObj *a,
671
double pointObj_distanceToShape(pointObj *self, shapeObj *shape);
674
lineObj *lineObj_new();
675
void lineObj_destroy(lineObj *self);
676
int lineObj_project(lineObj *self, projectionObj *in,
678
pointObj *lineObj_get(lineObj *self, int i);
679
int lineObj_add(lineObj *self, pointObj *p);
682
shapeObj *shapeObj_new(int type);
683
void shapeObj_destroy(shapeObj *self);
684
int shapeObj_project(shapeObj *self, projectionObj *in,
686
lineObj *shapeObj_get(shapeObj *self, int i);
687
int shapeObj_add(shapeObj *self, lineObj *line);
688
int shapeObj_draw(shapeObj *self, mapObj *map, layerObj *layer,
690
void shapeObj_setBounds(shapeObj *self);
691
int shapeObj_copy(shapeObj *self, shapeObj *dest);
692
int shapeObj_contains(shapeObj *self, pointObj *point);
693
int shapeObj_intersects(shapeObj *self, shapeObj *shape);
694
pointObj *shapeObj_getpointusingmeasure(shapeObj *self, double m);
695
pointObj *shapeObj_getmeasureusingpoint(shapeObj *self, pointObj *point);
697
shapeObj *shapeObj_buffer(shapeObj *self, double width);
698
shapeObj *shapeObj_simplify(shapeObj *self, double tolerance);
699
shapeObj *shapeObj_topologypreservingsimplify(shapeObj *self, double tolerance);
700
shapeObj *shapeObj_convexHull(shapeObj *self);
701
shapeObj *shapeObj_boundary(shapeObj *self);
702
int shapeObj_contains_geos(shapeObj *self, shapeObj *poshape);
703
shapeObj *shapeObj_Union(shapeObj *self, shapeObj *poshape);
704
shapeObj *shapeObj_intersection(shapeObj *self, shapeObj *poshape);
705
shapeObj *shapeObj_difference(shapeObj *self, shapeObj *poshape);
706
shapeObj *shapeObj_symdifference(shapeObj *self, shapeObj *poshape);
707
int shapeObj_overlaps(shapeObj *self, shapeObj *shape);
708
int shapeObj_within(shapeObj *self, shapeObj *shape);
709
int shapeObj_crosses(shapeObj *self, shapeObj *shape);
710
int shapeObj_touches(shapeObj *self, shapeObj *shape);
711
int shapeObj_equals(shapeObj *self, shapeObj *shape);
712
int shapeObj_disjoint(shapeObj *self, shapeObj *shape);
713
pointObj *shapeObj_getcentroid(shapeObj *self);
714
double shapeObj_getarea(shapeObj *self);
715
double shapeObj_getlength(shapeObj *self);
716
pointObj *shapeObj_getLabelPoint(shapeObj *self);
718
rectObj *rectObj_new();
719
void rectObj_destroy(rectObj *self);
720
int rectObj_project(rectObj *self, projectionObj *in,
722
double rectObj_fit(rectObj *self, int width, int height);
723
int rectObj_draw(rectObj *self, mapObj *map, layerObj *layer,
724
imageObj *img, int classindex, char *text);
727
shapefileObj *shapefileObj_new(char *filename, int type);
728
void shapefileObj_destroy(shapefileObj *self);
729
int shapefileObj_get(shapefileObj *self, int i, shapeObj *shape);
730
int shapefileObj_getPoint(shapefileObj *self, int i, pointObj *point);
731
int shapefileObj_getTransformed(shapefileObj *self, mapObj *map,
732
int i, shapeObj *shape);
733
void shapefileObj_getExtent(shapefileObj *self, int i,
735
int shapefileObj_add(shapefileObj *self, shapeObj *shape);
736
int shapefileObj_addPoint(shapefileObj *self, pointObj *point);
738
projectionObj *projectionObj_new(char *string);
739
int projectionObj_getUnits(projectionObj *self);
740
void projectionObj_destroy(projectionObj *self);
742
void labelCacheObj_freeCache(labelCacheObj *self);
744
char *DBFInfo_getFieldName(DBFInfo *self, int iField);
745
int DBFInfo_getFieldWidth(DBFInfo *self, int iField);
746
int DBFInfo_getFieldDecimals(DBFInfo *self, int iField);
747
DBFFieldType DBFInfo_getFieldType(DBFInfo *self, int iField);
749
styleObj *styleObj_new(classObj *class, styleObj *style);
750
int styleObj_updateFromString(styleObj *self, char *snippet);
751
int styleObj_setSymbolByName(styleObj *self, mapObj *map,
752
char* pszSymbolName);
753
styleObj *styleObj_clone(styleObj *style);
754
void styleObj_setGeomTransform(styleObj *style, char *transform);
756
hashTableObj *hashTableObj_new();
757
int hashTableObj_set(hashTableObj *self, const char *key,
759
const char *hashTableObj_get(hashTableObj *self, const char *key);
760
int hashTableObj_remove(hashTableObj *self, const char *key);
761
void hashTableObj_clear(hashTableObj *self);
762
char *hashTableObj_nextKey(hashTableObj *self, const char *prevkey);
765
cgiRequestObj *cgirequestObj_new();
766
int cgirequestObj_loadParams(cgiRequestObj *self,
767
char* (*getenv2)(const char*, void* thread_context),
769
ms_uint32 raw_post_data_length,
770
void* thread_context);
771
void cgirequestObj_setParameter(cgiRequestObj *self, char *name, char *value);
772
char *cgirequestObj_getName(cgiRequestObj *self, int index);
773
char *cgirequestObj_getValue(cgiRequestObj *self, int index);
774
char *cgirequestObj_getValueByName(cgiRequestObj *self, const char *name);
775
void cgirequestObj_destroy(cgiRequestObj *self);
777
resultObj *resultObj_new();
779
int clusterObj_updateFromString(clusterObj *self, char *snippet);
780
int clusterObj_setGroup(clusterObj *self, char *string);
781
char *clusterObj_getGroupString(clusterObj *self);
782
int clusterObj_setFilter(clusterObj *self, char *string);
783
char *clusterObj_getFilterString(clusterObj *self);
785
#endif /* PHP_MAPSCRIPT_H */