Personal tools
You are here: Home Documentation References PHP/Mapscript Class Reference Classes PointObj Class

4.14. PointObj Class

Document Actions
Up one level
Constructor, members, and methods.
  • Constant names and class member variable names are case-sensitive in PHP.
  • Several MapScript functions (all those that access files in the back end such as ms_newMapObj(), drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP environment. This will be fixed eventually but in the meantime you should be careful about these side-effects.
Constructor:

  PointObj ms_newPointObj()

Members:

  double x
  double y
  double z (used for 3d shape files. set to 0 for other types)
  double m  (used only for measured shape files. set to 0 for other types.)

Methods:

  int setXY(double x, double y [, double m])
       Set X,Y coordinate values.
       Note : the 3rd parameter m is used for measured shape files only.
       It is not mandatory.
       Returns 0 on success, -1 on error.

  int setXYZ(double x, double y , double z, [, double m])
       Set X,Y,Z coordinate values.
       Note : the 4th parameter m is used for measured shape files only.
       It is not mandatory.
       Returns 0 on success, -1 on error.
    

  int draw(mapObj map, layerObj layer, imageObj img, 
           int class_index, string text)
       Draws the individual point using layer.  The class_index is used
       to classify the point based on the classes defined for the layer.
       The text string is used to annotate the point.
       Returns MS_SUCCESS/MS_FAILURE.

 double distanceToPoint(pointObj poPoint)
      Calculates distance between two points.  

 double distanceToLine(pointObject p1, pointObject p2)
       Calculates distance between a point ad a lined defined by the
       two points passed in argument. 

 double distanceToShape(shapeObj shape)
       Calculates the minimum distance between a point and a shape.

 int project(projectionObj in, projectionObj out)
       Project the point from "in" projection (1st argument) to "out" 
       projection (2nd argument).  Returns MS_SUCCESS/MS_FAILURE.
     
 void free()
      Releases all resources used by the object.   
by Jeff McKenna last modified 2008-07-15 10:10

Powered by Plone