Global Mapper v25.0

USGS Topo GeoPDF to GeoTiff script

VCGI_Mapper
VCGI_Mapper Global Mapper User
edited October 2012 in Technical Support
I have downloaded the latest USGS topos in GeoPDF format, and I want to convert them to GeoTiffs. Before converting them I want to remove the imagery, map collar, and grid line from the USGS topo. I want to know how to access these different components of the GeoPDF and turn them on or off. A script would be ideal that batch converts all the GeoPDFs to GeoTiffs and also removes the imagery, map collar and grid line.

If anyone has any ideas or script examples that would be geatly appreciated. Thanks.

-Christopher

Comments

  • global_mapper
    global_mapper Administrator
    edited October 2012
    Christopher,

    If you have the latest Global Mapper then when you load the GeoPDF you can select which layers to load. Just turn off the ones you don't want then. If you save a workspace file you can then examine that (a workspace is a script file) in a text editor and see the LOAD_FLAGS used for the IMPORT command on the PDF file to see how to filter just those layers in a script.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • VCGI_Mapper
    VCGI_Mapper Global Mapper User
    edited October 2012
    Thanks Mike,

    I have completed the script and it does everything I want it to do. However there is one remaining issue that I can't seem to resolve. The exported GeoTiffs have slivers of no data areas at some of the edges of the image. Is there any way to have these no data slivers not show up?

    Here is the link to one of the original GeoPDFs: http://store.usgs.gov/b2c_usgs/usgs/maplocator/(ctype=areaDetails&xcm=r3standardpitrex_prd&carea=%24ROOT&layout=6_1_61_48&uiarea=2)/.do

    Here is the exported GeoTiff with the map collar, grid lines, and imagery cropped and removed:
    full_geotiff.PNG

    Here is the sliver of no data area only viewable when zoomed in (it is the blue line located on the top left edge of the image):

    no_data_sliver.PNG

    Attached is my script as .txt and .gms

    Let me know if you have any solutions.

    Thanks,

    Christopher
  • global_mapper
    global_mapper Administrator
    edited October 2012
    Christopher,

    I think there are a couple of things going on. First off, the collar in a USGS quad is aligned on lat/lon boundaries, so it will not be a rectangle orthogonal to the XY axes in most projections. The exceptions would be projections like Geographic (with the proper datum) or Mercator. So to fill the image rectangle outside the collar the background color has to be filled in (I'm guessing you have that set to blue?). You can add BG_TRANSPARENT=YES to your EXPORT_RASTER command to have those pixels outside the collar but inside the rectangle of the image marked as transparent so that compatible applications won't draw them. There will be some applications that can't handle that though.

    To get an image that has no border you would need to set your projection to one that the collars are defined in, like 4269 for lat/lon/NAD83, using the LOAD_PROJECTION command prior to export.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com