コンストラクタ:
ShapeObj ms_newShapeObj(int type)
typeには、MS_SHAPE_POINT, MS_SHAPE_LINE, MS_SHAPE_POLYGON, MS_SHAPE_NULLのいずれかを指定します。
ShapeObj ms_shapeObjFromWkt(string wkt)
WKT文字列からShapeObj作成します。
メンバ:
string text
int classindex
int type (read-only)
int numlines (read-only)
int index
int tileindex (read-only)
rectObj bounds (read-only)
int numvalues (read-only)
array values (read-only)
values配列は、このシェープの属性値を持つ連想配列です。これはlayer->getShape() によって取得したシェープにのみ設定されます。配列の値に対するキーは属性名です。例えば:
$population = $shape->values["Population"];
メソッド:
int set(string property_name, new_value)
オブジェクトのプロパティをnew_valueに設定します。エラーの場合 -1が返ります。
int add(lineObj line)
シェープにライン(すなわち一部分)を追加します。
LineObj line(int i)
ライン番号iへの参照を返します。参照は、このラインを含むshapeObjが存在している間のみ有効です。
int draw(mapObj map, layerObj layer, imageObj img)
レイヤを使って個別のシェープを描きます。
MS_SUCCESSまたはMS_FAILUREが返ります。
boolean contains(pointObj point)
シェープにpointが含まれていたらMS_TRUEが、そうでなければMS_FALSEが返ります。
boolean intersects(shapeObj shape)
2つのシェープが交差していたらMS_TRUEが、そうでなければMS_FALSEが返ります。
int project(projectionObj in, projectionObj out)
シェープを ”in” 投影(第1引数)から”out” 投影(第2引数)へ投影します。MS_SUCCESSまたはMS_FAILUREが返ります。
pointObj getpointusingmeasure(double m)
measureシェープファイルに対してのみ適用されます。measure mを与えて、シェープオブジェクト中の対応するXY位置を返します。
pointObj getmeasureusingpoint(pointObject point)
measureシェープファイルに対してのみ適用されます。XY位置を与えて、シェープオブジェクト中の最も近いポイントを探します。このポイントのポイントオブジェクトがm値とともに返ります。
void free()
シェープオブジェクトが使ったリソースを解放します。
string getvalue(layerObj layer, string filedname)
フィールド名を与えて値を返します。
shapeobj buffer(width)
指定された幅でバッファーリンク図形を作成します。
shapeobj convexhull()
凸包ポリゴンを作成します。
shapeobj boundary()
図形の境界線を返します。
int containsShape(shapeobj shape2)
shape2は完全に図形の範囲内含まれる場合はtrueを返します。
shapeobj Union(shapeobj shape)
この図形をパラメータで渡した図形と合併して新図形を返します。
shapeobj intersection(shapeobj shape)
交差部分の図形を返します。
shapeobj difference(shapeobj shape)
違い部分の図形を返します。
shapeobj symdifference(shapeobj shape)
Returns the computed symmetric difference of the supplied and existing shape.
int overlaps(shapeobj shape)
共通部分がある場合は、trueを返します。
int within(shapeobj shape2)
shape2は完全に図形の範囲内含まれる場合はtrueを返します。
int crosses(shapeobj shape)
交差部分がある場合ははtrueを返します。
int touches(shapeobj shape)
Returns true if the shape passed as argument touches the shape.Else return false.
int equals(shapeobj shape)
同じ図形の場合はtrueを返します。
int disjoint(shapeobj shape)
Returns true if the shape passed as argument is disjoint to the shape. Else return false.
pointObj getCentroid(shapeobj shape)
図形の重心を返します。
double getArea(shapeobj shape)
図形の面積を返します。
double getLength(shapeobj shape)
図形の長さを返します。
string toWkt()
図形をWkt文字列を返します。