Export to polish format includes unwanted linebreaks to object name

mrpurplemrpurple Global Mapper UserPosts: 8
edited October 2013 in Vector Data
When I export shape files to polish format in global mapper the output file sometimes has line breaks inside the lable.
ie a polish feature might be created as follows:
[POLYGON]
Type=0x011008
Label=Fee Simple, 1/1, Lot 8 Deposited Plan 20248, 671 m2

Fee Simple, 1/4, Lot 6 Deposited Plan 20248, 284 m2
EndLevel=1
Data0=(-44.8559223,170.6821037),(-44.8559145,170.6824542),(-44.8558936,170.6824545),
[END]
I'm not sure if line break characters exist in my data or if they are the result of some internal global mapper bug but they certainly dont belong in the polish format output.

Is there some way to avoid this problem when exporting to polish format without having to use some third party software to remove the unwanted line breaks from the output polish format files.
(I'm still using global mapper 13)

Comments

  • mrpurplemrpurple Global Mapper User Posts: 8
    edited September 2013
    Shame there doesnt seem to be a way within global mapper...
    Using "textpad" i was able to remove the offending line break that occur within a label with regex find/replace setting find to "\(^Label=.+\)\n\n" and replace to "\1"
    Without quotes obviously.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited September 2013
    I'm not sure how I missed this post the first time. It actually should be easy to update the Polish MP exporter from Global Mapper to remove newlines. If I replace them with \1 on export will that do the trick? It would be in v15 though.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • mrpurplemrpurple Global Mapper User Posts: 8
    edited September 2013
    You would want to do it to all new lines as most are correct - only the first of two when two appear in a "label". Also, the problem seems intermittant. It may be related to fields being truncated to the the label limit size (188 characters I think). I can post/email an example file to test if you like (3.5Mb). Then you can see if its something inside the program or something inside my data. Also, although moving up to v15 is on my wishlist I can personally live with the solution I posted for now. Particularly if it turned out that my original data contained the offending characters.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited September 2013
    Yes if you want to email a sample file to me to reproduce the issue that would make it easy to test the fix.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited September 2013
    Thanks for the file. I updated the Polish MP exporter to replace any embedded \n (newline) characters in a label with \1 on export to .mp files. I have placed a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip with the latest changes for you to try. Simply download that file and extract the contents into your existing v15.xx installation folder to give it a try. If you are using the 64-bit v15 version there is a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip .

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • mrpurplemrpurple Global Mapper User Posts: 8
    edited September 2013
    Thanks, I'm afraid I'm not in a position to test it though. Also I just wanted to go over the regex replace I posted to solve this. The find string "\(^Label=.+\)\n\n" looks for "Label=<anylengthstring><newline><newline>" Then the (escaped)brackets capture everything except the 2 <newline> characters into capture group \1 which the regex find/replace process uses to replace the whole find. This effectively deletes the two unwanted newline characters. I'm not sure that replaceing a single <newline> that occurs in a Label with "\1" would give the desired result. I beleive that whatever process you use would need to find two consecutive <newline> characters in the label then delete them. FYI in the example shape file i sent the issue I describe occured at line 7255 in the output mp file.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited September 2013
    Ah I was not using the regular expression correctly at all. I have updated it now to just get rid of any newlines embedded in a label string at all and for now just replace them with a space so they don't run directly together, but maybe something else than a space would be more appropriate. The goal is to ensure the entire Label= field fits on a single line.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • Denae84Denae84 Global Mapper User Posts: 1
    edited October 2013
    Hey guy, Would you please show this with screen view.. I am new in this field, so didn't get your point.
Sign In or Register to comment.