Global Navigation Bar

MapInfo Products Knowledge Base


Product: MapBasic
Version: 6.x
Platform: Windows NT 4.0
Category: Tools

Summary:
Finding beginning and ending nodes of polylines that are in combined features.

Question:
How can the ends of polylines that are in combined features be found?

Answer:
Below is a code example:

endmark.MB

'Be sure to have the map window open and on top before running.
'This will mark the beginning and the end of each segment within all the features
'in the table "mytable" with a symbol on the cosmetic layer

'to use on a different table, replace "mytable" on the next line with the name of the table
define mytab mytable

include "mapbasic.def"
dim i,c,c2 as integer
dim x,y as float
dim current as object
Set Map Layer 0 Editable On
fetch first from mytab
do while not EOT (mytab)
current = mytab.obj
c = objectinfo (current , OBJ_INFO_NPOLYGONS)
for i = 1 to c
c2 = objectinfo (current , OBJ_INFO_NPOLYGONS+i)
x = objectnodex(current,i,1)
y = objectnodey(current,i,1)
create point (x,y)
x = objectnodex(current,i,c2)
y = objectnodey(current,i,c2)
create point (x,y)
next
fetch next from mytab
loop

Last Modified: 12/06/2000 11:14:59 AM
Global Navigation Bar