Below I have written some code where I overlap a polyline with a circle to create another polyline with the ends being the center of the circle and the other at the "edge". I could use the objectgeography commands to get the "edge" point. My problem is that the point created isn't on the polyline. Can someone explain what is going on? Where I went wrong or I'm I doing some sort of Bozo-no,no.
'******************************* include "mapbasic.def" declare sub main sub main dim o_circle, o_nline, o_polyline, midpoint as object dim f_lat1, f_long1, f_lat2, f_long2, f_lat3, f_long3, f_lat4, f_long4 as float dim f_dist3 as float dim s_cosmetic as string Set Distance Units "survey ft" f_lat1=40.404209 f_long1=-122.196977 f_lat2=40.406122 f_long2=-122.196918 f_lat3=40.418733 f_long3=-122.198224 F_dist3=2656.5 Create Table TEST ( Longitude float, latitude float) File ApplicationDirectory$() & "test.tab" Insert Into TEST Values (f_long1,f_lat1) Insert Into TEST Values (f_long2,f_lat2) Insert Into TEST Values (f_long3, f_lat3) Commit Table TEST Create Map For TEST CoordSys Earth Projection 1, 62 Map From TEST Set Map Distance Units "survey ft" s_cosmetic=windowinfo(frontwindow(), win_info_table) set style pen makepen(1,2,blue) create pline into Variable o_polyline 3 (f_long1,f_lat1)(f_long2,f_lat2)(f_long3,f_lat3) set style pen makepen(1,2,red) o_circle=createcircle(f_long1,f_lat1,f_dist3) insert into s_cosmetic(obj) values (o_circle) o_nline=overlap(o_polyline,o_circle) insert into s_cosmetic(obj) values (o_nline) 'midpoint=createpoint(objectgeography(o_nline,obj_geo_lineendx),objectge ography(o_nline,obj_geo_lineendy)) 'insert into s_cosmetic(obj) values (midpoint) set style Pen(1, 2, BLack) f_long4=objectgeography(o_nline,obj_geo_lineendx) print f_long4 f_lat4=objectgeography(o_nline,obj_geo_lineendy) print f_lat4 insert into s_cosmetic(obj) values (createpoint(f_long4,f_lat4)) Set Map Window 53039528 Zoom Entire --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 12829
