Welcome to our new forum platform. We realize there is still some work to do and we appreciate your patience. Please let us know if you have any ideas or suggestions: paul@globalmapperforum.com

A bug in Converting MID/MIF to TAB files

abdulabdul Global Mapper UserPosts: 3 ✭✭
edited August 2010 in Vector Data
Hello,

I'm working at Wireless Applications Corporation where I use your SDK (v11.02, anyway I think the issue exists in all versions) to perform the conversion from MID/MIF to TAB and shp files. Recently I have noticed what I think is a bug in your conversion from MID/MIF to other formats. Let's consider this case explained below:

Consider this simple MIF file below:

Version 300
Charset "WindowsLatin1"
Delimiter ","
CoordSys Earth Projection 1, 104
Columns 3
GM_LAYER Char(17)
LAYER Integer
Signal Integer
Data

Region 3
7
-98.3162803339 44.0109796645
-98.2917610896 44.0109796645
-98.2917610896 43.983448
-98.3088440000 43.983448
-98.3088440000 43.9955904
-98.3162803339 43.9955904
-98.3162803339 44.0109796645
5
-98.292686 44.002833
-98.292686 44.002023
-98.293811 44.002023
-98.293811 44.002833
-98.292686 44.002833
7
-98.296062 43.987454
-98.296062 43.986645
-98.296062 43.985836
-98.297187 43.985836
-98.297187 43.986645
-98.297187 43.987454
-98.296062 43.987454
Pen (1,2,11656863)
Brush (2,11656863,16777215)
Center -98.302813 43.997167

This file describe a region with 3 polygons, the first big polygon describe an area where the second and third polygons describe small holes inside this big area. At this point everything works fine. When I use your converter to convert it to TAB file or open this MIF in GM, it will detect the two holes correctly. However, let's consider the following MIF file:

Version 300
Charset "WindowsLatin1"
Delimiter ","
CoordSys Earth Projection 1, 104
Columns 3
GM_LAYER Char(17)
LAYER Integer
Signal Integer
Data

Region 4
7
-98.3162803339 44.0109796645
-98.2917610896 44.0109796645
-98.2917610896 43.983448
-98.3088440000 43.983448
-98.3088440000 43.9955904
-98.3162803339 43.9955904
-98.3162803339 44.0109796645
5
-98.292686 44.002833
-98.292686 44.002023
-98.293811 44.002023
-98.293811 44.002833
-98.292686 44.002833
7
-98.296062 43.987454
-98.296062 43.986645
-98.296062 43.985836
-98.297187 43.985836
-98.297187 43.986645
-98.297187 43.987454
-98.296062 43.987454
5
-98.316523 43.991096
-98.317648 43.991096
-98.317648 43.990000
-98.316523 43.990000
-98.316523 43.991096
Pen (1,2,11656863)
Brush (2,11656863,16777215)
Center -98.302813 43.997167



This MIF file is exactly the same as the previous one, except with the modification of adding a new polygon to the region. This new polygon is a small area next to the big original area. At this point the converter (or when I try to open this MIF file in GM) will fail to detect the two holes in the big area. Now it will show these two small areas (that are supposed to be holes) as just regular areas and not holes. In the summary, when we have more than one real area inside the same region (what I mean by real area is a polygon that will be ultimately represented by an area not a hole), your converter fails on detecting the holes anymore, it just represents them as real areas.

Another related issue is that when I have two polygons (two real areas now, forgot the issue about holes in this case) inside one region, it looks like when I open this MIF file in GM, it treats these two polygons as two different regions NOT as two polygons in the same region. This behavior is confirmed when I re-export to MIF file again from GM, the exported file will have two regions one for each polygon. So it looks like always GM automatically seperate different polygons into different regions, which is not supposed to be the case. There are a lot of good reasons why I (and I guess a lot of other engineers) need many polygons to be grouped in the same region.

Thanks a lot for taking the time to consider this long email. I have tried to explain the problem to the best I can. If it still not clear, just copy and paste the two examples of MIF files I provided above and open them in GM, then I'm sure it will be clear what I mean.

Please let me know what do you think ASAP.

Abdul Salama
Wireless Engineer

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238BMG Staff
    edited August 2010
    Abdul,

    Thank you for your detailed explanation. I was able to reproduce the issue with the multiple parent areas with islands within a single region and get it fixed. I have placed a new SDK build with the fix at http://www.globalmapper.com/GlobalMapperSDK_v134_beta.zip for you to try.

    Global Mapper does not support grouping multiple parent areas into a single grouping/region, so when you pull in something like this into Global Mapper the areas will be split into separate regions on export to a new MapInfo or Shape file as the grouping is lost on import.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • abdulabdul Global Mapper User Posts: 3 ✭✭
    edited August 2010
    thanks for the quick response Mike. However, I checked the new code but the problem is not fixed. It still doesn't detect the holes when we have multiple parent areas.
    Did you checked it on both of the MIF files I provided and detected the holes on both of them?

    thanks a lot again.
  • global_mapperglobal_mapper Administrator Posts: 17,238BMG Staff
    edited August 2010
    I apologize, I fixed the problem, but didn't update the .zip file properly, so the old DLL was still out there. If you re-download http://www.globalmapper.com/GlobalMapperSDK_v134_beta.zip then it should fix the issue.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • abdulabdul Global Mapper User Posts: 3 ✭✭
    edited August 2010
    thanks a lot Mike. It is fixed now. I'm concerned about the supporting for multiple parent areas. Is that something you are planning to support in the near future? or is it something that you might consider to support later on? Or is there a very good reason why you don't have this feature and you still won't add it in the future? please let me know. I would like to know more about it and whether you can add this feature or not.

    I really appreciate your time.
  • global_mapperglobal_mapper Administrator Posts: 17,238BMG Staff
    edited August 2010
    We don't have any short-term plans for grouping multiple parent areas into a single feature. This is really the first time in nearly 10 years that someone has mentioned it as an issue, so it really hasn't been on our radar to implement support for. I can add it to our todo list, but it would require some pretty significant changes in our underlying data model so it wouldn't be a simple change.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.