mapscript.rectObj¶
- class mapscript.rectObj(minx: double = -1.0, miny: double = -1.0, maxx: double = -1.0, maxy: double = -1.0, imageunits: int = 0)¶
A rectObj represents a rectangle or bounding box. A rectObj may be a lone object or an attribute of another object and has no other associations.
Attributes
maxxdouble Maximum easting
maxydouble Maximum northing
minxdouble Minimum easting
minydouble Minimum northing
thisownThe membership flag
Methods
- __init__(minx: double = -1.0, miny: double = -1.0, maxx: double = -1.0, maxy: double = -1.0, imageunits: int = 0)[sumber]¶
Create new instance. The four easting and northing arguments are optional and default to -1.0. Note the new optional fifth argument which allows creation of rectangles in image (pixel/line) units which are also tested for validity.
- draw(map: mapObj, layer: layerObj, image: imageObj, classindex: int, text: char) int[sumber]¶
Draw rectangle into img using style defined by the classindex class of layer. The rectangle is labeled with the string text. Returns
MS_SUCCESSorMS_FAILURE
- fit(width: int, height: int) double[sumber]¶
Adjust the rect to fit the width and height. Returns cellsize of rect.
- project(*args) int[sumber]¶
Overload 1: Reproject rectangle from proj_in to proj_out. Transformation is done in place. Returns
MS_SUCCESSorMS_FAILUREOverload 2: Reproject rectangle given a reprojection object. Transformation is done in place. Returns
MS_SUCCESSorMS_FAILURE
- toString() char[sumber]¶
Return a string formatted like:
{ 'minx': %f , 'miny': %f , 'maxx': %f , 'maxy': %f }with the bounding values substituted appropriately. Python users can get the same effect via the rectObj __str__ method:>>> r = mapscript.rectObj(0, 0, 1, 1)
>>> str(r) { 'minx': 0 , 'miny': 0 , 'maxx': 1 , 'maxy': 1 }
