On the subject of what "first" and "last" point in a polyline
means, beware of weird cases in multi-segment polylines (often
encountered when a polyline is made up of combined street lines.)
It is possible, for example, to have segment 1 occur in the
middle of the combined polyline and the last point in the last
segment not to be an end point. Hopefully, you can look at the
following in plain, non proportional text, but it's a diagram of
a possible 3-segment polyline with the nodes numbered:

1  2   3 1   2     3 1  2  3     4
o--o----o----o------o---o--o-----o
|-------|-----------|------------|
  seg 3     seg 1       seg 2

In this case, the "first" point (segment 1, node 1) is the same
as the "last" (segment 3, node 3), and it's not even an endpoint.
This one bit me a few years ago to my cost. The lesson? If you
are doing anything where geometry matters, convert multi-segment
polylines to single segments first and make sure the nodes are in
proper order.

- Bill

Spencer Simpson wrote:
> 
> If you look inside MAPBASIC.DEF, you will see the following:
> 
> Define OBJ_GEO_MINX                     1
> Define OBJ_GEO_LINEBEGX                 1
> Define OBJ_GEO_POINTX                   1
> 
> For polylines and regions, ObjectGeography (myline, 1) returns the minimum
> of myline's MBR.
> 
> To extract the endpoints of a polyline (assuming it's a single part) you
> must use
> 
> ObjectNodeX (myline, 1, 1)
> ObjectNodeY (myline, 1, 1)
> ObjectNodeX (myline, 1, ObjectInfo(myline, OBJ_INFO_NPOLYGONS+1))
> ObjectNodeY (myline, 1, ObjectInfo(myline, OBJ_INFO_NPOLYGONS+1))
> 
> Don't use OBJ_INFO_NPNTS unless you're absolutely sure you polylines will
> always be a single part.
> 
> I eventually wound up developing a whole module to encode and decode
> polylines and regions.
> 
> HTH
> Spencer

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 5367

Reply via email to