Combination View Flat View Tree View
Threads [ Previous | Next ]
MapInfo?? how to?.
toggle
MapInfo?? how to?.
2/12/10 2:36 PM
I want to automatically georeference an image using the method;-

1 ProductProjectionBuilder.createProductProjection(sourceProduct, mapInfo, name, desc)


As you can see MapInfo is one of the arguments. The MapInfo class holds information required to bring the cartographic map co-ordinate system to a raster co-ordinate system and back. MapInfo constructor is as follows;

1 MapInfo(MapProjection mapProjection, float pixelX, float pixelY, float easting, float northing, float pixelSizeX, float pixelSizeY, Datum datum)   


How do i read these parameters from a raw image.

MapProjection mapProjection,
float pixelX,
float pixelY,
float easting,
float northing,
float pixelSizeX,
float pixelSizeY,
Here is my indented class

 1
 2import java.awt.Rectangle;
 3import java.io.IOException;
 4import org.esa.beam.framework.dataio.ProductIO;
 5import org.esa.beam.framework.dataio.ProductProjectionBuilder;
 6import org.esa.beam.framework.datamodel.Product;
 7
 8import org.esa.beam.framework.dataop.maptransf.MapInfo;
 9import org.esa.beam.framework.dataop.maptransf.MapProjection;
10
11public class AutoProjectImage {
12            
13        public static void main(String[] args) {
14            
15            String filePath = args[0]; // Raw Image in. 
16            
17            String targetFilename = args[1];// Georeferenced Image out
18            
19            try {
20                System.out.println("Loading rawProduct: " + filePath);
21               
22                Product rawProduct = ProductIO.readProduct(filePath, null);
23       
24                   MapProjection mapProjection = Geographic Lat/Lon
25
26               MapInfo theMapInfo = MapInfo(MapProjection mapProjection, float pixelX, float pixelY, float easting, float northing, float pixelSizeX, float pixelSizeY, Datum datum)-
27                    //"This is where my problem is. How do why construct MapInfo for a raw Image that has not been projected?"

28               
29                Product projectedProduct = ProductProjectionBuilder.createProductProjection(rawProduct, theMapInfo, "projectedProduct", "Automatically gereferenced product");
30               
31                ProductIO.writeProduct(projectedProduct,  targetFilename, null);
32               
33               rawProduct.closeProductReader();
34               
35                projectedProduct.closeProductWriter();
36               
37                System.out.println("Process Complete:");
38
39            } catch (IOException e) {
40               
41                System.out.println("I/O error: " + e.getMessage());
42               
43                e.printStackTrace();
44            }
45
46
47        }
Flag Flag
RE: MapInfo?? how to?.
Answer Answer (Unmark)
2/12/10 8:48 PM as a reply to Kabuchanga Eric.
Please see the other thread.
Flag Flag
RE: MapInfo?? how to?.
2/17/10 10:48 AM as a reply to Marco Peters.
Thanks a lot Peter.
mapproj.bat will do for me. i had not carefully looked at it.

It is the most i deal for me but how do i get parameters for it. This in the other Thread

Thank you once more
Flag Flag

 

Welcome to the BEAM Forum!

We encourage you to sign in our forum and participate in the BEAM community. The forum is maintained by the BEAM project team who will most likely answer your questions within 24 hours (except during common holidays) - if not done by other community members. Collaborate, share your knowledge and learn from other users!

If you don't find what you are looking for, please also consider the following external forums: