PHP/MapScript ShapeObjクラス

コンストラクタ:

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"];

メソッド:

connoteaint set(string property_name, new_value)

オブジェクトのプロパティをnew_valueに設定します。エラーの場合 -1が返ります。

connoteaint add(lineObj line)

シェープにライン(すなわち一部分)を追加します。

connoteaLineObj line(int i)

ライン番号iへの参照を返します。参照は、このラインを含むshapeObjが存在している間のみ有効です。

connoteaint draw(mapObj map, layerObj layer, imageObj img)

レイヤを使って個別のシェープを描きます。
MS_SUCCESSまたはMS_FAILUREが返ります。

connoteaboolean contains(pointObj point)

シェープにpointが含まれていたらMS_TRUEが、そうでなければMS_FALSEが返ります。

connoteaboolean intersects(shapeObj shape)

2つのシェープが交差していたらMS_TRUEが、そうでなければMS_FALSEが返ります。

connoteaint project(projectionObj in, projectionObj out)

シェープを ”in” 投影(第1引数)から”out” 投影(第2引数)へ投影します。MS_SUCCESSまたはMS_FAILUREが返ります。

connoteapointObj getpointusingmeasure(double m)

measureシェープファイルに対してのみ適用されます。measure mを与えて、シェープオブジェクト中の対応するXY位置を返します。

connoteapointObj getmeasureusingpoint(pointObject point)

measureシェープファイルに対してのみ適用されます。XY位置を与えて、シェープオブジェクト中の最も近いポイントを探します。このポイントのポイントオブジェクトがm値とともに返ります。

connoteavoid free()

シェープオブジェクトが使ったリソースを解放します。

connoteastring getvalue(layerObj layer, string filedname)

フィールド名を与えて値を返します。

connoteashapeobj buffer(width)

指定された幅でバッファーリンク図形を作成します。

connoteashapeobj convexhull()

凸包ポリゴンを作成します。

connoteashapeobj boundary()

図形の境界線を返します。

connoteaint containsShape(shapeobj shape2)

shape2は完全に図形の範囲内含まれる場合はtrueを返します。

connoteashapeobj Union(shapeobj shape)

この図形をパラメータで渡した図形と合併して新図形を返します。

connoteashapeobj intersection(shapeobj shape)

交差部分の図形を返します。

connoteashapeobj difference(shapeobj shape)

違い部分の図形を返します。

connoteashapeobj symdifference(shapeobj shape)

Returns the computed symmetric difference of the supplied and existing shape.

connoteaint overlaps(shapeobj shape)

共通部分がある場合は、trueを返します。

connoteaint within(shapeobj shape2)

shape2は完全に図形の範囲内含まれる場合はtrueを返します。

connoteaint crosses(shapeobj shape)

交差部分がある場合ははtrueを返します。

connoteaint touches(shapeobj shape)

Returns true if the shape passed as argument touches the shape.Else return false.

connoteaint equals(shapeobj shape)

同じ図形の場合はtrueを返します。

connoteaint disjoint(shapeobj shape)

Returns true if the shape passed as argument is disjoint to the shape. Else return false.

connoteapointObj getCentroid(shapeobj shape)

図形の重心を返します。

connoteadouble getArea(shapeobj shape)

図形の面積を返します。

connoteadouble getLength(shapeobj shape)

図形の長さを返します。

connoteastring toWkt()

図形をWkt文字列を返します。

Add a new comment
Page tags: mapserver phpmapscript
page_revision: 3, last_edited: 1208156614|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License