Loading ...
Sorry, an error occurred while loading the content.

Problem with the mitab_c_set_points and double values

Expand Messages
  • olywyer
    Hi ! I m in trouble.... maybe you ll help me : I try to write points with the mitab_c_set_points. The points coords look like this : x=0.9432799379
    Message 1 of 2 , Dec 20, 2006
    View Source
    • 0 Attachment
      Hi !

      I'm in trouble.... maybe you'll help me :

      I try to write points with the mitab_c_set_points. The points coords
      look like this : x=0.9432799379 y=48.2336944724... Unfortunately, once
      write in the Feature, when I read this values MiAPI, from the same
      file, the precision is lower : 0,943 48,234 ... which means a BIG
      difference with the original points.

      I tried another solution : reproject my data in a Lambert II (then the
      coords are like this : x=654405 y=2254064) , but in this case, the y
      value seams to be too large, and is transfomed to "1000000" for all
      values...

      Any advices, solution, experience ???

      Thank you very much for your help

      Olivier
    • cjegan@melbpc.org.au
      ... once ... Olivier, You need to set the coordinate bounds when creating the file using mitab_c_create. MapInfo uses integer values internally, and applies
      Message 2 of 2 , Jan 2, 2007
      View Source
      • 0 Attachment
        > Hi !
        >
        > I'm in trouble.... maybe you'll help me :
        >
        > I try to write points with the mitab_c_set_points. The points coords
        > look like this : x=0.9432799379 y=48.2336944724... Unfortunately,
        once>
        > write in the Feature, when I read this values MiAPI, from the same
        > file, the precision is lower : 0,943 48,234 ... which means a BIG
        > difference with the original points.
        >
        > I tried another solution : reproject my data in a Lambert II (then the
        > coords are like this : x=654405 y=2254064) , but in this case, the y
        > value seams to be too large, and is transfomed to "1000000" for all
        > values...
        >
        > Any advices, solution, experience ???
        >
        > Thank you very much for your help
        >
        > Olivier
        >
        >


        Olivier,

        You need to set the coordinate bounds when creating the file using
        mitab_c_create. MapInfo uses integer values internally, and applies an
        offset and multiplier to convert to/from world coordinates. Its
        coordinate range is 2000 million units.

        I assume your coordinates 0.943 48.234 are longitude/latitude. If you
        don't set specific bounds, MapInfo assumes -180 to 180 in longitude, and
        gives you only 1 million units per degree - about 0.1 metre.

        If you set your bounds to cover 1 degree, MapInfo will then give you 2000
        million units to that one degree, and you will get 9 decimal places. If
        you set the bounds to cover 10 degrees, you will get 200 million units to
        one degree, and 8 decimal places. You need to look at the range of
        coordinates you need to cover, and then set appropriate bounds - which may
        mean losing some precision.

        I set bounds for my area (Victoria) as -28, -44, 154, 138. This gives 16
        degrees, with 125 million units per degree, and this is sufficient for
        millimetre precision.

        When using your Lambert coordinates, you again need to calculate the range
        needed to cover your area, and then set the appropriate bounds.

        I hope this helps,

        Chris Egan



        Message sent using MelbPC WebMail Server
      Your message has been successfully submitted and would be delivered to recipients shortly.