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 -----Original Message----- From: Canfield, Andrew [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 9:18 AM To: 'Percival, Mark'; MapInfo-L (E-mail) Subject: RE: MI-L Node coordinate extraction This works for lines. I have never tried it on poly lines so I'm not sure if it works on them or not. Obviously make sure your variables are correctly declared and set first. stXcoord = ObjectGeography(myLine,OBJ_GEO_LINEBEGX) stYcoord = ObjectGeography(myLine,OBJ_GEO_LINEBEGY) ndXcoord = ObjectGeography(myLine,OBJ_GEO_LINEENDX) ndYcoord = ObjectGeography(myLine,OBJ_GEO_LINEENDY) -----Original Message----- From: Percival, Mark [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 5:10 AM To: MapInfo-L (E-mail) Subject: MI-L Node coordinate extraction Can someone tell me how to extract the x & y coordinates for the start and end nodes of a line or polyline - am getting into a muddle! TIA Mark Percival ICT Client Officer(GIS) ICT Client Team City Development Directorate Coventry City Council mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Tel:024 7683 2540 ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 5360 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 5363
