grid - world coord conversion methods for GridCoverage2D --------------------------------------------------------
Key: GEOT-2666 URL: http://jira.codehaus.org/browse/GEOT-2666 Project: GeoTools Issue Type: Improvement Components: core coverage Reporter: Michael Bedward Assignee: Michael Bedward Priority: Minor Attachments: coverage-grid2world.patch Converting between grid and world coordinates can be tricky with the various options of PixelOrientation, definitions of inclusiveness etc. After stuffing this one in my own code for the 1000th time I've written methods for GridCoverage2D to handle conversions for points and rectangles which adhere to (hopefully) commonly useful conventions. The new methods are: - GridCoordinates2D worldToGrid(DirectPosition point) : returns the coords of the grid cell containing this point - GridEnvelope2D worldToGrid(Envelope2D env) : returns the rectangle of grid cells that intersect the input envelope - DirectPosition gridToWorld(GridCoordinates2D point) : returns the world coords of the grid cell centre - Envelope2D gridToWorld(GridEnvelope2D env) : returns the bounding rectangle (outer grid cell edges) in world coords The attached patch contains these methods as well as unit tests and some minor mods to GridGeometry2D. I'm unsure if GridCoverage2D is a good place for these methods or if they would better put in a helper class. I'm also unsure whether they correctly deal with all combinations of grid and world dimension order. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel