Global Mapper Pro

Export single file, but dont export empty files

STH
STH Global Mapper UserTrusted User
edited November 2007 in Technical Support
My trial period has ended so I haven`t got the chance to try this out.

1. Load several GeoTIFFs
2. Load area (dxf) defining the map
3. Export to GeoTIFF
4. Gridding: No grid - Just one export file per input file. I assume this will give the exact same output file as the input file.
5. Export bounds - Crop to Selected Area Features.
No if I change the background color to green, everything that is outside the selected area will be green. Right?

Ie. I want to be able to change the background color on several pictures, without changing all pixels 255-255-255 to 234-12-234 (because the pixels within the map also consist of the value 255-255-255.

Comments

  • global_mapper
    global_mapper Administrator
    edited November 2007
    That is the correct procedure to do what you are after. All pixels outside the selected crop area, but within the bounding rectangle of the crop area, will be filled with the selected background color. You can change the background color using the View->Background Color menu command.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • STH
    STH Global Mapper User Trusted User
    edited November 2007
    I think it does not work as I want. The whole area is covered with several map tiles ( for instance tiles: 213-345-6.tif, 213-345-7.tif and 921-123-4.tif) I want to export them (Step
    3. (Export to GeoTIFF)) to each individual file with the same size and name to another catalogue. Just changing the area outside the map to have another color. Since I usually have hundreds of files this would be slow to do manually on each file.
  • global_mapper
    global_mapper Administrator
    edited November 2007
    What I think you can do is first do your initial tiled export to GeoTIFF and create 24-bit RGB images and check the option to mark the background as transparent. Then, change the background color to what you want and do a File->Batch Convert opteration to convert the GeoTIFF files that you just created to new GeoTIFF files in whatever end configuration that you need (i.e. palette-based, RGB, etc.) but without transparency. Then all of the transparent areas around the outside of your data will be filled with the selected background color, but the pixels inside your data bounds should stay at their original color.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • STH
    STH Global Mapper User Trusted User
    edited November 2007
    Ah, didn`t see the Batch Convert dialog. Would be perfect if I could select an Area or a DXF within as boundaries (Like the regular Export to GeoTIFF dialog). And then the background would be black or white or whatever it is set to.

    I did not initialy create the GeoTIFFs with GlobalMapper. Thats why I can not do as you suggest. There is a bug in the software (not your) that does not limit the colors from 1-254 and then set the background to 0 or 255.
  • global_mapper
    global_mapper Administrator
    edited November 2007
    You can crop to a polygon during batch conversion. Just select your crop area prior to doing the batch conversion, then check the box to crop to the selected area feature(s) on the batch conversion dialog.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • STH
    STH Global Mapper User Trusted User
    edited November 2007
    UPDATE: The area was not selected, trying now...
    It seems that "Crop to Selected Areas" is not an option in the "Batch Convert" dialogue when selecting. GeoTIFF in and
    GeoTIFF(raster) out.
  • STH
    STH Global Mapper User Trusted User
    edited November 2007
    It looks correct and the area gets selected. Also the background gets completely back as the background color. However the file size and dimensions of the picture have changed. (Showing the most important tags:)
    This is the original:
    Output from Display Header
    File Name:  tile1.tif
    File Information:
     Standard : : TIFF File
     Format : : Uncompressed 24 bit RGB data
     Pixels per Line :  16001
     Number of Lines :  12001
     Samples per pixel :  3
     File bits per sample : 8
     Actual bits per sample : 8
     Untiled file
     Number of overviews :  0
     Scanning device resolution :  72  : lines/inch
     Orientation :  4  : Row major order, origin at top left
     NO scan line headers : non-scannable file
     Packet size (16-bit words) : 0
     Free vlt space (16-bit words) : 2000000000
     Free packet space (16-bit words) : 2000000000
    Raster to UOR matrix:
     Unspecified or All Zero Matrix
    Raster to World Matrix:
     Units: Unknown or Unspecified
     amx[ 0]=            0.2, amx[ 1]=              0, amx[ 2]=         426400
     amx[ 3]=              0, amx[ 4]=           -0.2, amx[ 5]=      6967200.2
             426400 ,       6967200.2
           429600.2 ,       6967200.2
           429600.2 ,         6964800
             426400 ,         6964800
    No GeoTIFF info found
    

    And the new file:
    Output from Display Header
    File Name:  globalmapper_tile1.tif
    File Information:
     Standard : : TIFF File
     Format : : Uncompressed 24 bit RGB data
     Pixels per Line :  11132
     Number of Lines :  10456
     Samples per pixel :  3
     File bits per sample : 8
     Actual bits per sample : 8
     Untiled file
     Number of overviews :  0
     Scanning device resolution :  0  : None Specified
     Orientation :  4  : Row major order, origin at top left
     NO scan line headers : non-scannable file
     Packet size (16-bit words) : 0
     Free vlt space (16-bit words) : 2000000000
     Free packet space (16-bit words) : 2000000000
    Raster to UOR matrix:
     Unspecified or All Zero Matrix
    Raster to World Matrix:
     Units: Meters
     amx[ 0]=0.199996406755299, amx[ 1]=              0, amx[ 2]=      427373.84
     amx[ 3]=              0, amx[ 4]=-0.200007651109347, amx[ 5]=      6967200.2
          427373.84 ,       6967200.2
           429600.2 ,       6967200.2
           429600.2 ,      6965108.92
          427373.84 ,      6965108.92
    Geotiff_Information:
       Version: 1
       Key_Revision: 1.0
       Tagged_Information:
          ModelTiepointTag (2,3):
             0                0                0                
             427373.84        6967200.2        0                
          ModelPixelScaleTag (1,3):
             0.199996407      0.200007651      1                
          End_Of_Tags.
       Keyed_Information:
          GTModelTypeGeoKey (Short,1): ModelTypeProjected
          GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
          GeogAngularUnitsGeoKey (Short,1): Angular_Degree
          ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_32N
          ProjLinearUnitsGeoKey (Short,1): Linear_Meter
          End_Of_Keys.
       End_Of_Geotiff.
    PCS = 32632 (WGS 84 / UTM zone 32N)
    Projection = 16032 (UTM zone 32N)
    Projection Method: CT_TransverseMercator
       ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
       ProjNatOriginLongGeoKey: 9.000000 (  9d 0' 0.00"E)
       ProjScaleAtNatOriginGeoKey: 0.999600
       ProjFalseEastingGeoKey: 500000.000000 m
       ProjFalseNorthingGeoKey: 0.000000 m
    GCS: 4326/WGS 84
    Datum: 6326/World Geodetic System 1984
    Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
    Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
    Projection Linear Units: 9001/metre (1.000000m)
    Corner Coordinates:
    Upper Left    ( 427373.840,6967200.200)
    Lower Left    ( 427373.840,6965108.920)
    Upper Right   ( 429600.200,6967200.200)
    Lower Right   ( 429600.200,6965108.920)
    Center        ( 428487.020,6966154.560)
    

    This may have something to do with the sampling space? I have set it to "Use same Sample Spacing as Source File" but it does not create the correct number of pixels per line or line or "Raster to World Matrix: Units: Unknown or Unspecified amx[ 0]= 0.2" Any suggestions what to look at?
  • global_mapper
    global_mapper Administrator
    edited November 2007
    When you crop to a selected area on batch conversion (and on normal export), the bounds of the export will also be cropped to that selected area if the selected export bounds are not contained completely within that area. That is why you are getting a different pixel size and very slightly different calculated sample spacing in your export.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • STH
    STH Global Mapper User Trusted User
    edited November 2007
    Ah, so it does not maintain the map-tile size of the files. Hm - I need to maintain the exact size of all the files. I guest that is not currently possible. I could define each maptile as an Area manually, however doing that it would not be possible to change the background color.

    I guess the only solution is to define each map- tile export by coordinates manually - unfortunately I do not have much time for the moment to experiment with writing scripts.

    Unless it is easy for you to implement this? Add a checkbox in the menu something like: "Keep FULL image size".

    An algorithm like this may help:
    For each GeoTIFF selected in the batch reprojection do:
      IF file completely outside the "Crop Area" THEN skip to next file
      ELSE create new file with exact same dimensions and then change the background accordingly
    
  • global_mapper
    global_mapper Administrator
    edited November 2007
    I have gone ahead and added an option to "Maintain Full Size When Cropped" when doing a batch conversion and cropping to an area. I have placed a new build at http://www.globalmapper.com/global_mapper9.zip with the change for you to try. Simply download that file and extract the contents into your existing v9.xx installation folder to give it a try.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • STH
    STH Global Mapper User Trusted User
    edited November 2007
    Fast as lightning as always.

    I have tried to download and extract the files. And it seems to be the right files (EXE Dated 21. nov. 2007 16:47) I have also selected "Crop to Selected Areas" and was looking for the option to select "Maintain Full Size When Cropped" on the same list. However I could not find it and I am not quite sure what I have done wrong.
  • global_mapper
    global_mapper Administrator
    edited November 2007
    I'm actually not sure that the build you got was the right one (there were several yesterday). Try downloading the latest from http://www.globalmapper.com/global_mapper9.zip (it should be dated today) and see if that works better. The "Maintain Full Size When Cropped" option should be right below the "Crop to Selected Area" option.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • STH
    STH Global Mapper User Trusted User
    edited November 2007
    That solved everything. Thanks again for great support!
Sign In or Register to comment.