BSB to KMZ Quality

Andrew TarrAndrew Tarr Global Mapper UserPosts: 8
edited November 2014 in Raster Data
Hi Mike,

Global Mapper12 is absolutely fantastic and is achieving 98% of what I need to do.

May I please ask for a little guidance?

I'm currently exporting some BSB Marine Charts onto Google Earth. For some charts this works great, but for others the quality is very poor, especially down toward Antarctica.

Could you spare a moment to look at the settings I'm using and confirm this is the best method? I'm using the batch convert function as I have 332 charts to export.

I open the chart (or charts) then select from the control center options -

- No blend
- Box Average 4x4 (this seems to create the sharpest image, without going fuzzy)

I then select the Batch convert function and select BSB to KMZ. The options I have checked are -

- Auto Grid (Superoverlay)
- Anti-Alias Pixels (I tried this off and on and there doesn't seem to be much difference)
- Clamp Export to Lat/Lon
- Fill Small gaps in data (This seemed to improve the charts to the south)
- Make background pixels transparent
- Show batch conversion
- Minimize Window...

Due to the 180 meridian, I have to use transparency, otherwise I get a filled band around the earth. The colors were are bit off using PNG 256, so I'm now using PNG 24 bit.

Sample spacing and projection are the default source.

I've attached two files if you want to test anything. The first chart (463) looks ok, but the other (14065) goes really fuzzy and stretched. I know wrapping a flat chart around something round does distort things, but some other geotiffs I used for roughly the same area worked really well.

Checking the Force Square pixels output option made quite an improvement on 14065, but for both charts I'm seeing really reduced quality at high altitude until I zoom right in close.

The force square pixels option also greatly increases the conversion time.

I'll greatly appreciate any help you can give me.

Thanks
Andrew

BSB_Files.zip

Comments

  • redbeardredbeard Global Mapper User Posts: 279Trusted User
    edited March 2011
    my guess is that you have a small scale mercator chart that far south, and usually google earth kmz arent really in mercator - so it's reprojecting it to a non-mercator projection. Though it seems odd that you arent having issues on some near there. My thoughts (I havent tried these) is to reproject the files first to see whats warping and where, then consider cutting the chart into smaller pieces before making a kmz. Then make a catalog of the smaller pieces and export to the kmz. You might just leave out the worst areas, and find a different source, one that uses an antarctic projection. Or better yet, use some ENC data.
  • Andrew TarrAndrew Tarr Global Mapper User Posts: 8
    edited March 2011
    Thanks for the response and good ideas.

    I think I'm slowly getting to an answer. I've just been looking at another small scale chart for the North Pacific Ocean (14051) and it's rendered nicely and still quite readable when zoomed out a reasonable distance. The key I think, is this chart doesn't cross the 180 meridian.

    What I think is happening is when I have a chart crossing the 180, say from 160E to 160W, it processes the export the long way around e.g.

    180 --Map Data---> 160W
    Calc'd Fill
    >160E --Map Data---> 180

    I could be talking rubbish, but I think it calculates the entire area, which muddles the default sample spacing.

    Maybe breaking the image at the 180 into two images would solve this problem. I'm just not sure how to do this. I also imagine quite a few of our charts cross the 180......sigh.:)

    Help?!?

    Cheers
    Andrew
  • redbeardredbeard Global Mapper User Posts: 279Trusted User
    edited March 2011
    There is a way to export based on a polygon, and it will crop to the poly. Perhaps you could make a couple square polygons going from 0-180 E and 0-180 W, with 90 N and 90 S as the bounds. Then export the charts that cross the 180 as clipped to the polygon boundary - this should effectively cut the chart at the 180 line. You would have to export them twice, once for E and once for W. I'd just export them into an E and W folder and manage it that way. BTW there is an option to select crop collars - as the BSB files often have the chart boundary info in them, and GlobalMapper can read it to find out where the edge of the charts are. It's a little prep work, but if it is the 180 issue - then this may help.
  • Andrew TarrAndrew Tarr Global Mapper User Posts: 8
    edited March 2011
    Fantastic. Thank you.

    I'm not sure how to create the polycons, but I've give it a go and see how I get on.
    ;)
    Watch this space...
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2011
    The charts the cross the anti-meridian are the real issue since KMZ files require everything to be in lat/lon degrees centered at a longitude of 0, so those charts basically flip around the world. If you can crop those charts into separate pieces, one of each side of the 180 boundary that would definitely fix the issue.

    I did also update Global Mapper to do a much better job of maintaining the sample spacing to use for these charts so even without cropping you can get better results, although with a long export because of all the empty space being exported. I have placed a new build at http://www.globalmapper.com/global_mapper12.zip with the change for you to try. Simply download that file and extract the contents into your existing v12.xx installation folder to give it a try. If you are using the 64-bit v12 version there is a new build at http://www.globalmapper.com/global_mapper12_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2011
    One more thing, I would not suggest using the 'Box Average 4x4' option when exporting. That is going to make each output pixel an average of the nearest 16 pixels, so you are basically reducing your resolution by a factor of 4. You should just keep that at the default of 'Nearest Neighbor' or use one of the resampling methods appropriate for a full resolution export, like Bilinear or Bicubic.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • redbeardredbeard Global Mapper User Posts: 279Trusted User
    edited March 2011
    Looks like to create the polygons - turn on the Digitizer tool (alt-D) and add a square box, double click on it, hit vertices button, edit the vertice coords so they say 0 to 180 and -90 to 90, and repeat the process for the other side, 0 to -180 and -90 to 90, and you should have two polygons. I tried this and named them E and W.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2011
    Hold everything, I just added detection of ATM-crossing rasters to the batch conversion operation and now split those automatically into separate files, so now the batch conversion to KMZ should work automatically with no need for cropping. You will just get 2 KMZ files if the data crosses the ATM now, one west of the ATM and one east of it, rather than just one that tries to wrap the entire thing. I have placed a new build at http://www.globalmapper.com/global_mapper12.zip with the change for you to try. Simply download that file and extract the contents into your existing v12.xx installation folder to give it a try. If you are using the 64-bit v12 version there is a new build at http://www.globalmapper.com/global_mapper12_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • redbeardredbeard Global Mapper User Posts: 279Trusted User
    edited March 2011
    Nice work.
    Here's a thought - If I understand correctly, a KMZ (which can be a zip file) can have multiple rasters? So is it possible to combine the two raster kmz files into another kmz (zip) file that will dispay both kmz files?
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2011
    It would be possible, although I'm afraid it would be a lot more difficult than the fix that I just made, at least within Global Mapper. It might be easier to create another simple KML file that just references the 2 KMZ files that were created if you required things to be in just one file.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Andrew TarrAndrew Tarr Global Mapper User Posts: 8
    edited March 2011
    Thank you both for your fantastic help. I'm running it now. I'll let you know how I get on.
  • Andrew TarrAndrew Tarr Global Mapper User Posts: 8
    edited March 2011
    Well, the splitting works very well. The maps process into KMZ much quicker.

    I've taken your suggestion and I'm using the Nearest Neighbour option. It's looking pretty good. I've also switched off most of the options I'd previously had on.

    I'm still losing quality down by Antarctica, but I don't think there is much I can do about this. It's not a fault of GM in any way, but simply looks to be just too much image distortion of wrapping a flat chart around a round ball. If you have any ideas about this please let me know.

    Thanks again for your help guys.
    Andrew
  • Andrew TarrAndrew Tarr Global Mapper User Posts: 8
    edited November 2014
    Hi Mike,

    Following the successful fix for V12, I've now moved to V16 and I'm seeing a big gap at the anti-meridian on KML exports displayed in Google Earth.

    I'm using a script to do the export, but running it locally has the same results. Example KAP file attached

    NZ1460501.zip

    Is there a switch for V16 to detect the ATM and create two files?

    Here is the script just in case.

    GLOBAL_MAPPER_SCRIPT VERSION="1.00"
    DIR_LOOP_START DIRECTORY="C:\Users\Andrew\Documents\Marine" FILENAME_MASKS="*.kap" RECURSE_DIR=YES
    IMPORT FILENAME="%FNAME_W_DIR%"
    EXPORT_RASTER FILENAME="C:\Users\Andrew\Documents\Marine\Script\%FNAME_WO_EXT%.KML" TYPE=KML KML_SUPER_OVERLAY=YES GRID_CREATE_FOLDERS=YES KML_RASTER_FORMAT=PNG OVERWRITE_EXISTING=NO BG_TRANSPARENT=YES
    UNLOAD_ALL
    DIR_LOOP_END

    Thanks
    Andrew
Sign In or Register to comment.