Analytic geometry methods only have a
chance of working if you use a projected coordinate system. A conformal
projection (such as the British National Grid you're using) is preferred, if
you want vectors calculated from your coordinates to have a chance of
representing vectors on the Earth. If you're displaying the result data using
a different projection than the "current coordinate system" you were
calculating in, things may appear off anyway. Even then, some things can bite you: First of all, you have to make sure you've
set MapBasic's "current coordinate system" to the desired coordinate
system. What values are you actually getting out of the calls to ObjectNodeX()
and ObjectNodeY()? (hint: Use print statements.) If they're BNG
coordinates then you've done this correctly. If they're latitudes and longitudes,
[FA1, FA2] is not really a vector, fLinkLength isn't really a length, and [FB1,
FB2] isn't really a normal unit vector. Set the "current coordinate
system" by issuing Set Coordsys Table mytable before you begin looping through mytable. Secondly, if your bounds are too wide, then
the granularity of your space is too large, and when MapInfo knocks the
coordinates you calculate over to the corner of the nearest grid cell, the movement
may be large enough to see. This will occur with very small widths and
can only be solved by using a coordinate system with tighter bounds. Finally, if fOffset is large, fOffset*[FB1,
FB2] will never represent a vector normal to your line segment on the surface
of the Earth, because even a conformal projection represents angles correctly only
over short distances (actually 0, but they don't go far out of whack until the
distances get large). The solution is to use spherical geometry to insert
several intermediate points, something that's probably too complicated to be
worth the effort. Hope this helps Spencer From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gibb, Stuart All, I am using the following snippets of code to create fixed width
band regions at 90 degrees to a series of given straight lines. The lines
contain numerical data which I can then thematically map. I also have a version
that creates variable width bands but for the moment I'll assume all bands are
the same width. After a lot of tweaking I thought I had finished the
tool...Unfortunately, after crudely holding the corner of a sheet of paper up
to the screen it appears my bands aren't perfectly perpendicular to the
original line though I am clueless as to what could have gone wrong… Is there any error converting degrees to radians and then back
again in MapInfo ? Also, I am the using British national grid co-ordinate set,
could this where my slight discrepancy has come from multiplying ? fFNodeX = ObjectNodeX(oLine, 1, 1) ' read
longitude fA1 = fTNodeX - fFNodeX x1 = fFNodeX + (fB1 *(fWidth + fOffset))
As always, any help would be greatly appreciated…
Many thanks Stu Visit our
website at http://www.halcrow.com ------------------------------------------------------------------------ |
_______________________________________________ MapInfo-L mailing list MapInfo-L@lists.directionsmag.com http://www.directionsmag.com/mailman/listinfo/mapinfo-l