Go Back   Global Mapper Forum > Features Discussion > Raster Data


Raster Data Post your questions here about how to use Raster data. Importing, Exporting, Converting, reprojecting, etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-09-2008, 10:11 PM
Global Mapper User
 
Join Date: Jun 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default Batch Geotiff/JPG Conversions

Hi,

I'm trying to figure out the best GM tools to accomplish the following:
- find all the tiff & jpg files that are within a nested directory structure
- For each file, determine it's coordinate system
- Based on it's current coordinate system, set the projection
- save the new image file (one per source image)

I think the best would be to create a perl script (or something like that) to recursively go through the nested directory and find the tif or jpg file. Then call a GM script for the one file.

That brings up some questions.
- is the only way to read the current coordinate system is to export a prj?
- can I pass in parameters to the GM script (ie the source filename).

I guess I could have the wrapper script generate the GM script on the fly as it finds the image file. The biggest question is do I have to create a prj, read it and then load the new projection. If that is the case I think I would have to have two seperate GM scripts created on the fly (one to create the prj) and the second one to load the new projection and save the new file.

Hopefully that's clear! If anyone can give me any suggestions I would really appreciate it.
Thanks,
Kathy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-09-2008, 10:41 PM
Administrator
 
Join Date: Jun 2007
Posts: 3,117
Thanks: 1
Thanked 95 Times in 94 Posts
Default

I would think that the normal File->Batch Convert/Reproject command would work. Just choose to generate the export file in the native projection of the source file (this is the default).

Let me know if I can be of further assistance.

Thanks,

Mike
Global Mapper Support
support@globalmapper.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-10-2008, 02:47 PM
Global Mapper User
 
Join Date: Jun 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Mike,

I need to determine what the source raster file is to determine how I want to reproject the new export file.

For example: If the source is UTM 8 - NAD27, I want to reproject the raster to a UTM8 - NAD83. If the source is UTM9-NAD27, I want to reproject to raster UTM9-NAD83.

Is there a way to do that other then the complicated steps I was thinking of?

Thanks!
Kathy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-10-2008, 10:12 PM
Administrator
 
Join Date: Jun 2007
Posts: 3,117
Thanks: 1
Thanked 95 Times in 94 Posts
Default

Kathy,

Yes, the batch convertor has a datum option allowing you to select an output datum other than the input datum when converting files.

Let me know if I can be of further assistance.

Thanks,

Mike
Global Mapper Support
support@globalmapper.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-12-2008, 04:36 PM
Global Mapper User
 
Join Date: Jun 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Mike,

The problem is I don't know what output datum I want until I read the datum of the source file. Each output datum for each image will needs to be determined when the source datum is read.

If I used a batch convertor with the datum option, I would have to set a single output datum.

In a batch script, can I read the source projection of an image and set the output datum, depending on the source projection?

Thanks,
Kathy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-12-2008, 09:41 PM
Administrator
 
Join Date: Jun 2007
Posts: 3,117
Thanks: 1
Thanked 95 Times in 94 Posts
Default

Kathy,

The scripting language does not have any kind of logic capabilities for doing something based on something else. I think your best bet would either be what you described earlier (i.e. export out a PRJ file from a script, then read it back in, generate a new script, then run it), or to use the Global Mapper SDK to load your data file, query the projection, then export a new file with the desired projection/datum. See the Developers page at GLOBAL MAPPER for more details on the SDK.

Let me know if I can be of further assistance.

Thanks,

Mike
Global Mapper Support
support@globalmapper.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to global_mapper For This Useful Post:
kwmish (06-16-2008)
  #7 (permalink)  
Old 06-16-2008, 02:22 PM
Global Mapper User
 
Join Date: Jun 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks! I just wanted to make sure I wasn't missing anything.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Sponsored links
Canvas 11


All times are GMT. The time now is 03:16 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright 200 Globalmapperforum.comAd Management by RedTyger