Combination View Flat View Tree View
Threads [ Previous | Next ]
RE: About Setting Mosaic parameter
toggle
About Setting Mosaic parameter
mosaic
4/9/18 2:02 PM
I want to complete Mosaic by GTF.But which of the following parameters can be obtained from the source image?

parameters.put("crs","EPSG:32650");
parameters.put("westBound",113.7);
parameters.put("northBound",30.0);
parameters.put("eastBound",117.7);
parameters.put("southBound",27.6);
parameters.put("pixelSizeX",30.0);
parameters.put("pixelSizeY",30.0);
Or,how to get the value of "westBound" from source image?
Flag Flag
RE: About Setting Mosaic parameter
4/10/18 8:22 AM as a reply to zhang zhou quan.
You can use the method
1ProductUtils.createGeoBoundaryPaths(product);

It returns one or more paths (see api doc). On each path you can call
1getBoundary()
With this information you can set the parameters.
Flag Flag
RE: About Setting Mosaic parameter
mosaic
4/10/18 10:53 AM as a reply to Marco Peters.
I was successful~~. emoticon Thank you very much!!emoticon

I share my results here(my beam version is 4.11):
 1
 2        GeneralPath[] gpath=ProductUtils.createGeoBoundaryPaths(product);
 3
 4        for(int i=0;i<gpath.length;i++){
 5            // get resolution,but It may be wrong
 6            double resolution=gpath.getBounds().getHeight();
 7
 8            System.out.println(" resolution:"+ resolution*10);
 9                        
10                        //get westBound,northBound,eastBound,southBound.
11                        //Need to match it yourself
12            double gMaxX=gpath.getBounds2D().getMaxX();
13            double gMinX=gpath.getBounds2D().getMinX();
14            double gMaxY=gpath.getBounds2D().getMaxY();
15            double gMinY=gpath.getBounds2D().getMinY();
16
17            System.out.println("gMaxX:"+gMaxX);
18            System.out.println("gMinX:"+gMinX);
19            System.out.println("gMaxY:"+gMaxY);
20            System.out.println("gMinY:"+gMinY);
21        }

result:
resolution:30.0
gMaxX:117.72537231445312
gMinX:115.3448257446289
gMaxY:29.92502784729004
gMinY:27.79532814025879
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: