Hello,<br><br>I'm trying to access the data of a GRIB file using lat, lon coordinates. I've defined a ProjectedCRS modifying some parameters of the Lambert Conic Conformal (1SP) projection to adjust it to the one used in my GRIB file. This is my code:<br>
<br> <br> GridCoverage coverage = CoverageIO.read("~/myfile.grb");<br> GridCoverage2D gc2D = (GridCoverage2D) coverage;<br> float[] values=null;<br> values = gc2D.evaluate(new Point2D.Float(600, -420), values);<br>
<br> MathTransformFactory mtFactory = FactoryFinder.getMathTransformFactory(null);<br> ParameterValueGroup p = mtFactory.getDefaultParameters("Lambert Conic Conformal (1SP)");<br>
p.parameter("Latitude of natural origin").setValue(40);<br> p.parameter("Longitude of natural origin").setValue(-2.5);<br> Conversion conversion = new DefiningConversion("Harmonie_ES", p);<br>
<br> CRSFactory crsFactory = FactoryFinder.getCRSFactory(null);<br> Map<String,?> properties = Collections.singletonMap(ProjectedCRS.NAME_KEY, "Harmonie_ES");<br> GeographicCRS baseCRS = DefaultGeographicCRS.WGS84;<br>
CartesianCS projectedCS = DefaultCartesianCS.PROJECTED;<br> ProjectedCRS crs = crsFactory.createProjectedCRS(properties, baseCRS, conversion, projectedCS);<br><br><br>Does anybody knows how to use the ProjectedCRS to transform my GridCoverage2D and being able to evaluate points using lat, lon coordinates?<br>
<br>Thanks for your help,<br><br>Pablo Rozas<br>