Hi All,Well it looks like the AffineTransform scale I believe is wrong. Not 
sure how that happened.The value for crsToGrid2D for scale x & y is:  
0.002159437302465473So now I need to understand why it might be incorrect. So I 
need to know how it was calculated or if this is some sort of default value. If 
a default I would like to know how it was calculated so I can make a correction 
for it.
Best Regards,-Tony
 

    On Tuesday, February 16, 2016 7:23 PM, Tony Anecito <[email protected]> 
wrote:
 

 Hi All,
I think the answer to this issue might be the error message I see when starting 
up geoserver.No code "EPSG:4326" from European Petrolleum Survey Group" found 
for object of type "IdentifiedObject". I seem to be using the correct 
dimensions.It almost looks like the scaling is incorrect for the transform. I 
will see if I can get that info from the transform to confirm it.Best 
Regards,-TonyPS: I have deleted most my emails so hopefully you will not get 
bounces if you reply. I think that is the issue for my emails that only seem to 
bounce for email groups sometimes.
 

    On Monday, February 15, 2016 11:25 PM, Tony Anecito <[email protected]> 
wrote:
 

 Hi All,
Does anyone know where AffineTransform parameters are set? From what I can tell 
the Grid2DReader creates a GridCoverage2D which in turn can create an instance 
of AffineTransform via a call to ((GridGeometry) 
GridCoverage2D.getGridGeometry()).getGridTCRS(PixelInCell.CELL_CORNER).
Thanks,-Tony
 

    On Monday, February 15, 2016 10:36 PM, Tony Anecito <[email protected]> 
wrote:
 

 Okay looks like for some reason the AffineTransform passed into 
XAffineTransform.transform() only seems to change a few hundredths for a 20 
degee bounds change. So now I will look into that.
-Tony


    On Sunday, February 14, 2016 11:30 PM, Tony Anecito <[email protected]> 
wrote:
 

 Sorry, I forgot to mention I am using Oracle JDK 7. I mention this because I 
noticed the Crop.java class has been changed due to issues with OpenJDK. Maybe 
there are issues with this area because of Oracle JDK?

Best Regards,-Tony
 

    On Sunday, February 14, 2016 9:14 PM, Tony Anecito <[email protected]> 
wrote:
 

 Hi All,
Basically I am reading a geotiff file via geoserver and in turn cropping (the 
scaling) a region of interest. The problem is the area I am getting back from 
crop is 1x1 pixel.

I am using crop in Crop.java (geoserver 2.8.2 with the geotools provided with 
it) and I am getting back results I do not expect. Below I list the functions 
with what I know about input/output to hopefully determine what the issue is 
and hopefully recommendations to fix.

//from geoserver passed onto extension?
final GridCoverage2D coverage = coverageReader.read(CoverageUtils.getParameters(
                    coverageReader.getFormat().getReadParameters(), parameters, 
true));
param.parameter("Source").setValue(coverage); //source in Crop.doOperation()

Crop.doOperation() 
-------------------------------------------------------------------------------------------------------------------
source = (GridCoverage2D) sourceParameter.getValue();
final AffineTransform sourceCornerGridToWorld = (AffineTransform) 
((GridGeometry2D) source
                        .getGridGeometry())
                        .getGridToCRS(PixelInCell.CELL_CORNER);

The intersectionEnvelope has : lower corner of -140, -10 and upper corner of 
-120,10 



Crop.BuildResults() 
-----------------------------------------------------------------------------------------------------------------The
 cropEnvelope created inside crop has Min/Max x,y values for: 
lower corner: -140, -10 and the upper corner -120, 10
The sourceWorldToGridTransform is the inverse transform of 
sourceGridToWorldTransform which is the sourceCornerGridToWorld transform.
The cropEnvelope above are the values just before:final Rectangle2D 
finalRasterAreaDouble = XAffineTransform
                    .transform(sourceWorldToGridTransform,
                            cropEnvelope.toRectangle2D(), null);
The finalRasterAreaDouble are 23040,11520 and 23041, 115201 

// intersection with the original range in order to not try to crop
            // outside the image bounds
            Rectangle.intersect(finalRasterArea, sourceGridRange,
                    finalRasterArea);
The finalRasterAreaDouble is still after the above Rectangle.intersect 
23040,11520 and 23041, 115201 
internalROI is null

At the end of Build Results method inside Crop.java:
I am getting back a coverage of width 1 and height 1. The minx and min y are 
23040 and 11520 respectively. 


Any ideas? I am suspecting something wrong about the first transform when you 
get into BuildResults(). Why would the resultant rectangle be in the middle of 
the image and one pixel apart for the final raster area?
Best Regards,-Tony





   

   

   

   

  
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to