OSM Export - open polygons

BajanNavBajanNav Global Mapper UserPosts: 4
edited November 2012 in Bug Report
Hi,

I am using Global Mapper V13, build 101711.

Task is importing mp files and exporting as OSM, for display in Maperitive.

Problem - it works OK for lines, but not for polygons, which did not display at all in Maperitive. I thought it was the Maperitive styling that was wrong, and spent many happy(!) hours trying to get Maperitive to "see" the polygons, but to no avail.

However, I think I have found the root of the problem. The mp file has closed polygons - the first and last vertices are the same. However, in the OSM file exported from Global Mapper, the polygons are open (i.e. missing the final "closure" vertex) and therefore Maperitive sees them as lines, not polygons.

Looking at a "standard" OSM file, downloaded from OSM, the polygons are all closed.

I do believe this is a Global Mapper bug - is there a simple solution, please?

Best regards,

John

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2012
    John,

    The OSM file shouldn't have to explicitly close the polygons, there are in an <area> tag that implies closure. However that doesn't mean that doesn't mean that Maperitive doesn't have some extra requirement.

    However I first notice that you are using an older GM13 build and there were some fixes to OSM export after that. Can you get the latest v13 release from the links below and see if that helps?

    32-bit: http://www.globalmapper.com/downloads/global_mapper13_setup.exe
    64-bit: http://www.globalmapper.com/downloads/global_mapper13_setup_64bit.exe

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • BajanNavBajanNav Global Mapper User Posts: 4
    edited November 2012
    Mike,

    Thanks for the link to the later build, GM13.2, which I have installed and tried - unfortunately, there is no improvement.

    I can't find an OSM spec for their KML anywhere, but a look at their own exported files shows polygons with opening and closing vertices in the same location - the closing vertices are missing in the GM export. I agree that the "area" designation should let Maperitive know that it's a polygon, but Maperitive's author clearly wrote it with an OSM file beside him, and I expect it seemed obvious to him to treat lines with closures as polygons (not sure about a true roundabout, though - but these are always in 2 parts if designed in mapedit!).

    I'm going to have to find a way of adding closing vertices to some hundreds of polygons (mainly buildings), and I'm not at all sure how I'm going to do that. Have you any suggestions, please?

    Best regards,

    John
  • BajanNavBajanNav Global Mapper User Posts: 4
    edited November 2012
    Mike,

    Further to my post above, I manually inserted a few closing vertices in the OSM file output from GM, and these polygons then displayed correctly in Maperitive. Just to see whether this was simply a Maperitive "quirk", I loaded the OSM file into the de-facto JOSM Editor, and exactly the same errors were apparent - all the polygons which I had not manually closed in the OSM file displayed simply as lines, with the final "joining" line missing.

    I do think that this is a problem in GM, and it makes the OSM export pretty well unusable for polygons. I do rather wonder if I'm the only user to be using the OSM export in earnest - otherwise I would have thought that this would have cropped up before!

    Best regards,

    John
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited November 2012
    John,

    There are actually quite a few users of the OSM export, I just spent quite a bit of time fixing an issue with the export of Korean text to OSM yesterday for a user. However, I'm guessing most of them are using data files where the areas are explicitly closed. Global Mapper doesn't care one way another, but in principle I consider it wasteful of space to explicitly close an area when you can already tell in another way that it is closed.

    In any case, I went ahead and updated the OSM XML export to explicitly close all areas on export so that any reader can handle it. I have placed a new build at http://www.globalmapper.com/global_mapper13.zip with the latest changes for you to try. Simply download that file and extract the contents into your existing v13.xx installation folder to give it a try. If you are using the 64-bit v13 version there is a new build at http://www.globalmapper.com/global_mapper13_64bit.zip .

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • BajanNavBajanNav Global Mapper User Posts: 4
    edited November 2012
    Mike,

    Very many thanks - the new build, with the closing vertices included in the OSM file, works an absolute treat.

    I should point out that the data loaded into GM, a mp file from gpsmapedit, actually had explicit closing vertices - but these had disappeared by the time the data had been exported from GM to OSM. It is always possible that the GM import filter for Polish files was the problem, stripping the closing vertices on import?

    However, whether the problem was due to the import or export filter, the new build gives the required explicit closure of polygons in the OSM file.

    I absolutely agree with you that it is strange that OSM (not just Maperitive, but other OSM utilities as well) requires explicit closing vertices. With the "area" flag set, the inclusion of these extra lines of code appears superfluous, and only serves to increase data size - by many hundreds of lines, in my case.

    Very many thanks for your assistance in this - we had reached what seemed like a dead stop in our planned workflow, and now we can proceed.

    May I say what an excellent and useful tool GlobalMapper is - and that the speed of your support is without equal.

    Thanks again.

    Best regards,

    John
Sign In or Register to comment.