Dear list;
Problem solved, and as Ian Tidy first guessed the problem involved Coordinate System. While I have tried setting CoordSys for all my mapper windows, evidently there is coordsys in use throughout any MapBasic program, and it has to be set too. Syntax:


set CoordSys Earth Projection 3, 33, "survey ft", -81, 31.8333333333, 32.5, 34.8333333333, 1999996, 0

Notice no window specified.  I guess my anal retentiveness got me.
Thank you for your help!

--
Sofia Nikolsky

JCH GeoInfo Solutions
(919) 493-9339
www.jchgis.com


 >----------------------------------------------------------------------------|
 |                                                                            |
 |      To:     Ian Tidy <[EMAIL PROTECTED]>,                               |
 |       [EMAIL PROTECTED]                                    |
 |      cc:     (bcc: Steve Smith/Staff/ABS)                                  |
 |      Subject:     Re: MI-L Distance functions returning garbage            |
 >----------------------------------------------------------------------------|




Alas yes I have checked the projection, set it too. Removed this code since it did nothing. After the selection bit in my code I set up various other mappers, but each is explicitly set to proper coord sys and is only referred to by window handle (no assumptions as to which is active - it is always Set Map Window MyWinHandle). The Now_Printing appears also in another mapper window.

--
Sofia Nikolsky

JCH GeoInfo Solutions
(919) 493-9339
www.jchgis.com


Ian Tidy wrote:




Sofia,

Have you set your projection in MapBasic??

Cheers Ian

-----Original Message-----
From: Sonya Nikosky [mailto:[EMAIL PROTECTED]
Sent: Thursday, 22 January 2004 7:55 a.m.
To: [EMAIL PROTECTED]
Subject: MI-L Distance functions returning garbage


Dear list; I have wrote a little tool, that given a list of numbers selects corresponding column in a table, and zooms to selected object (it does other stuff too but this is the problem bit). Selection is in a loop - and it works properly the first time, then all distance functions start returning garbage, namely that MinX=MaxX=MinY etc. all of which are for some reason equal to -694444.44 (I am using state plane coordinate system). I have checked the selection - it works properly throughout, no problems on second iteration. Please help!

My code:

Dim CurPage, NumPages as integer, other definitions

  i=1
  Fetch first from TempPages
  CurPage=TempPages.PageNum
  Do
      Print "Printing page "+CurPage+" ("+ i +" of "+NumPages+")"

      Select * From GridName Where Page_Num=CurPage into Now_Printing
      MyObjType = ObjectInfo(Now_Printing.obj, OBJ_INFO_TYPE)
      If MyObjType <> OBJ_TYPE_REGION Then
          'Print error message
          Print "Error: grid must be made up of region objects"
          exit sub
      End If

      'find the center
      MyMinX = ObjectGeography(Now_Printing.obj, OBJ_GEO_MINX)
      MyMinY = ObjectGeography(Now_Printing.obj, OBJ_GEO_MINY)
      MyMaxX = ObjectGeography(Now_Printing.obj, OBJ_GEO_MAXX)
      MyMaxY = ObjectGeography(Now_Printing.obj, OBJ_GEO_MAXY)
Print "   MyMinX="+MyMinX+" MyMinY="+MyMinY
      CenterX = MyMinX+(MyMaxX-MyMinX)/2
      CenterY = MyMinY+(MyMaxY-MyMinY)/2

'and other actions
  Fetch Next from TempPages
  CurPage=TempPages.PageNum
Loop while i<=NumPages










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







-----------------------------------------------
ABS Web Site:  www.abs.gov.au





-- Sofia Nikolsky

JCH GeoInfo Solutions
(919) 493-9339
www.jchgis.com



Reply via email to