VECGetVertices

Demonstrates how to retrieve vertices of a shape.

Remarks

This example illustrates how to retrieve the first and last point for each shape in a layer.

Code

 local integer tfid , integer layer
 local integer shape, integer num_points
 local vertex ptr  Points

 try
    tfid = DBOpen( GetPCIHOME() + "/demo/irvine.pix", "r")
    layer = 28
    shape = VECNextShape(tfid, layer, -1)
    Points = VECGetVertices(tfid, layer, shape)
    while (shape > -1)
     num_points = f$len( Points )

     if (num_points = 0) Then
         print shape, "[", num_points, "]: no vertices"
     else
 
         print shape, "[", num_points, "]: (", Points[1].x, ", ", \
               Points[1].y, ") - (", Points[num_points].x, ", ", \
               Points[num_points].y, ")"
     endif

     shape = VECNextShape(tfid, layer, shape)
    endwhile

    call EFree( Points )
    call DBClose(tfid)

 onerror
   print "Error: "+ GetLastErrorMessage()
 endonerror

Output

1[2]: (429080, 3734400) - (429290, 3734400)
2[2]: (429080, 3734400) - (429290, 3734400)
3[2]: (429080, 3734400) - (429290, 3734400)
4[2]: (429080, 3734400) - (429290, 3734400)
5[2]: (429080, 3734400) - (429290, 3734400)
6[2]: (429080, 3734400) - (429290, 3734400)
7[2]: (429080, 3734400) - (429290, 3734400)
8[2]: (429080, 3734400) - (429290, 3734400)
9[2]: (429080, 3734400) - (429290, 3734400)
10[2]: (429080, 3734400) - (429290, 3734400)
11[2]: (429080, 3734400) - (429290, 3734400)
12[2]: (429080, 3734400) - (429290, 3734400)
13[2]: (429080, 3734400) - (429290, 3734400)
14[2]: (429080, 3734400) - (429290, 3734400)
15[2]: (429080, 3734400) - (429290, 3734400)
16[2]: (429080, 3734400) - (429290, 3734400)
17[2]: (429080, 3734400) - (429290, 3734400)
...
...

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.