Hi Trey, I can replicate your problem using 7.5, but I can also fix it.
Simply add a bounds clause to your coordsys and it should work OK. I used this: Create Map For fail CoordSys Earth Projection 1, 0 bounds (-100,25) (-95,30) but you should choose your bounds carefully so as to ensure that they are well beyond your area of interest. Adding the bounds clause basically allows MapInfo to work at a greater resolution. As a side issue, I would strongly recommend you do not use coordsys 1,0. The "0" parameter is the datum, and you are telling MapInfo that you are unconcerned what datum will be used - ie. a null datum. This is fine for mapping where shifts of a few hundred metres are unimportant, or where you can *guarantee* that all your spatial data will have the same datum. The problem occurs because when a layer with null datum is displayed together with a layer with a real datum, MapInfo just uses the real datum for your null datum layer. If you display your null datum layer with NAD83 data it will be positioned slightly differently than with NAD27 data - especially if your scale of operations is of the order of single metres. So - standardize on a datum and always ensure that all your data uses a real datum, otherwise the 911 call could end up in the wrong street. Hope this helps. Best Regards, Martin Higham Avantra Geosystems ph (61 3) 8504 0428 0425-730-428 fx (61 3) 9596 7997 www.avantra.com.au > -----Original Message----- > From: Trey Pattillo [mailto:[EMAIL PROTECTED] > Sent: Thursday, 13 November 2003 14:50 > To: MapInfo List > Subject: MI-L Wednesday wierdness - SQL Intersects Fails > > > > Select * from StreetFile where CircleSelector intersects obj into Work > Fails on some polylines > > Working on my 911 MapALI program to "reverse geocode" a cell > phone location > yep, in Corpus Christi TX of 1000 911 calls per day 70% are cell and 60% > have valid and *accurate* lat/lon coords > > Note accurate, as the location can be less than 10 feet from the street > center line > > I have MI 4.5, 6, and 6.5 and all fail the same way. > > You can copy and paste the code at the end to test it -- correct > is that no > objects are selected > > CircleSelector is 8 feet and 14 feet from the line > > If you draw a line from the nodes above and below the *close* > node you find > that it cuts thru the selector > > This is *reverse logic* at this point and nothing should be > selected so that > the SQL loop continues 8,16,32...8192 feet and drops out when answer table > has found an object > So it should have looped to 16ft and correctly found the line intersecting > the selector -- not the imaginary line > > Problem then occurs later when testing the distance from the location back > to the line segment extracted from the polyline > If the *triangle height* calculated from start/end/location points is > greater than the selector radius distance > indicating that this segment was not the one intersecting with selector > [NOT] > the app continues looking at the rest of the segments and fails. > > Move the point around a bit and then it will pick up correctly and try > changing the 8 in CreateCircle to 16, 32 > > FWI this is a real street and a real cell call location > 911 is happy with what app does BUT..............when, not if, something > goes wrong the legal buzzards will be hovering above > > > Besure to change file location in create table and get all line wrapping > back on one line................ > ------------------------ copy start --------------------- > Set Distance Units "ft" > Create Table "fail" (Street Char(50),FromLeft Integer,ToLeft > Integer,FromRight Integer,ToRight Integer) file "C:\fail.TAB" TYPE NATIVE > Charset "WindowsLatin1" > Create Map For fail CoordSys Earth Projection 1, 0 > Map From fail > > dim aSel as object > Create Pline into variable aSel 8 (-97.412431,27.802423) > (-97.412656,27.802733) (-97.41275,27.803293) (-97.412748,27.803833) > (-97.412661,27.804223) (-97.412467,27.804637) (-97.412428,27.804869) > (-97.412441,27.805053) PEN MakePen(1,2,0) > > insert into fail (obj,street,fromleft,toleft,fromright,toright) values > (aSel,"Oak Ln",6477,6515,6478,6516) > commit table fail > Set Map window windowid(0) Zoom Entire Layer 1 > > aSel=createcircle(-97.412705,27.803829,8) > select * from fail where obj intersects aSel into work browse * from work > insert into cosmetic1 (obj) values (aSel) > undim aSel > > ------------------ copy end --------------------------------- > > > > > > Trey Pattillo > [EMAIL PROTECTED] > www.wap3.com > N27.799013 W-97.665322 > > > --------------------------------------------------------------------- > List hosting provided by Directions Magazine | www.directionsmag.com | > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Message number: 9138 > --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 9139
