MapWinGIS:Grid CellToProj

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

CellToProj

Uses a cell's column and row position to find the center of the cell in projected map coordinates.


VB.NET Usage

Sub CellToProj(Column As Integer, Row As Integer, ByRef x As Double, ByRef y As Double)

            Parameters

Column

The column of the cell to find the center in projected map coordinates.
Row The row of the cell to find the center in projected map coordinates.
x Reference parameter. Returns the x projected map coordinate of the center of the specified cell.
y Reference parameter. Returns the yprojected map coordinate of the center of the specified cell.

Sample Code

    Private Sub CellToProj()
        Dim grid As New MapWinGIS.Grid()
        Dim x As Double, y As Double
        'Open a grid from disk
        grid.Open("C:\grid.asc")
        'Get the center of the cell in projected map coordinates stored in x and y
        grid.CellToProj(5, 5, x, y)
        'Display center of the cell in message box
        MsgBox("The center of cell col 5, row 5: x = " + Str(x) + " y = " + Str(y))
        'Close the grid
        grid.Close()
    End Sub
  

VB 6 Usage
Sub CellToProj(Column As Long, Row As Long, ByRef x As Double, ByRef y As Double)
            Parameters

Column

The column of the cell to find the center in projected map coordinates.
Row The row of the cell to find the center in projected map coordinates.
x Reference parameter. Returns the x projected map coordinate of the center of the specified cell.
y Reference parameter. Returns the yprojected map coordinate of the center of the specified cell.

Sample Code

    Private Sub CellToProj()
        Dim grid As New MapWinGIS.grid
        Dim x As Double, y As Double
        'Open a grid from disk
        grid.Open ("C:\grid.asc")
        'Get the center of the cell in projected map coordinates stored in x and y
        grid.CellToProj 5, 5, x, y
        'Display center of the cell in message box
        MsgBox ("The center of cell col 5, row 5: x = " + Str(x) + " y = " + Str(y))
        'Close the grid
        grid.Close
    End Sub

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:Grid_CellToProj"

This page has been accessed 1,722 times. This page was last modified on 9 November 2005, at 16:31.