通信人家园

标题: 关于Mapinfo坐标问题  [查看完整版帖子] [打印本页]

时间:  2009-4-13 14:56
作者: ypcwpp13     标题: 关于Mapinfo坐标问题

在Mapbasic中使用Objectnodex()和objectgeography()读取到的坐标在mapinfo中用十进制显示,小数点后位数可以自动控制并显示。但是读取并使用mapbasic打印输出的坐标只有小数点后三位或四位,请问那位高手可以指点将其扩为6位?谢谢!
时间:  2009-5-4 11:28
作者: cdma1xdj

这个问题问的不太明白 所以一直没法回答
你是从objectnodex()打印输出还是利用其他函数打印输出不行呢?
扩充位数是为了什么目的?
请把问题充实一下,这样没法回答啊

ObjectNodeX( ) function
Purpose
Returns the x-coordinate of a specific node in a region or polyline object. You can call this function
from the MapBasic Window in MapInfo Professional.
Syntax
ObjectNodeX( object, polygon_num, node_num )
object is an Object expression.
polygon_num is a positive integer value indicating which polygon or section to query. It is ignored for
Multipoint objects (it used for regions and polylines).
node_num is a positive integer value indicating which node to read.
Return Value
Float
Description
The ObjectNodeX( ) function returns the x-value of a specific node from a region or polyline object.
The corresponding ObjectNodeY( ) function returns the y-coordinate value.
The polygon_num parameter must have a value of one or more. This specifies which polygon (if
querying a region) or which section (if querying a polyline) should be queried. Call the ObjectInfo( )
function to determine the number of polygons or sections in an object. The ObjectNodeX( )
function supports Multipoint objects and returns the x-coordinate of a specific node in a Multipoint
object.
The node_num parameter must have a value of one or more; this tells MapBasic which of the
object's nodes should be queried. You can use the ObjectInfo( ) function to determine the number
of nodes in an object. The ObjectNodeX( ) function returns the value in the coordinate system
currently in use by MapBasic; by default, MapBasic uses a Longitude/Latitude coordinate system.
See Set CoordSys statement for more information about coordinate systems.
Example
The following example queries the first graphic object in the table Routes. If the first object is a
polyline, the program queries the x- and y-coordinates of the first node in the polyline, then creates a
new Point object at the location of the polyline's starting node.
Dim i_obj_type As SmallInt, x, y As Float, new_pnt As Object
Open Table "routes"
Fetch First From routes
' at this point, the expression:
' routes.obj
' represents the graphical object that's attached
' to the first record of the routes table.
i_obj_type = ObjectInfo(routes.obj, OBJ_INFO_TYPE)
If i_obj_type = OBJ_PLINE Then
' ... then the object is a polyline...
x = ObjectNodeX(routes.obj, 1, 1) ' read longitude
y = ObjectNodeY(routes.obj, 1, 1) ' read latitude
Create Point Into Variable new_pnt (x, y)
Insert Into routes (obj) Values (new_pnt)
End If
时间:  2009-5-10 23:48
作者: chenshanbo

学习中




通信人家园 (https://www.txrjy.com/) Powered by C114