Hi Mike,
It's just Java's typing being a bit painful. A DirectPosition2D
object is a Point2D object with geospatial extras.
What I usually do use DirectPosition references instead which avoids
the ambiguity...
DirectPosition pos = new DirectPosition2D(myCRS, x, y);
dest = cov.evaluate(pos, dest);
The only hassle with this is that you can no longer say pos.x and
pos.y. Instead you have to say pos.getOrdinate(0) and
pos.getOrdinate(1) which is clunky.
The other option of course is to explicitly cast...
DirectPosition2D pos = new DirectPosition2D(myCRS, x, y);
dest = cov.evaluate( (DirectPosition2D)pos, dest);
Your mission is to decide which of these is the least worst :)
Hope that helps,
Michael
On 30 March 2011 15:38, Mike O'Toole <[email protected]> wrote:
> Hello all,
> I'm brand new to GeoTools. I'm trying to use the evaluate() method on my
> GridCoverge2D object. However I get a reference to evaluate is ambiguous
> error.
> Error:
> reference to evaluate is ambiguous, both method
> evaluate(org.opengis.geometry.DirectPosition,double[]) in
> org.geotools.coverage.AbstractCoverage and method
> evaluate(java.awt.geom.Point2D,double[]) in
> org.geotools.coverage.grid.GridCoverage2D match
>
> Here is the code snippet:
> DirectPosition2D nextPoint = new DirectPosition2D(sphericalMercator, x, y);
>
> double[] dest = gridCoverage.evaluate(nextPoint, dest);
>
> Any help pointing me in the right direction is greatly appreciated and let
> me know if more information is needed.
> Thank You,
> Mike
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users