MapWindow Home
Search MapWindow.org


  • Home
    • Download
    • Why MW
    • FAQ
    • Contact
  • Products
    • MapWindow
    • ActiveX
    • Plug-ins
  • Software Dev
    • Sample Code
    • Scripts
    • Source
    • Bugs
    • Support
    • Languages
  • Site Tools
    • Forums
    • Tutorials
    • Mailing Lists
    • Team
    • Site Stats
    • Links
  • Get Stuff
    • Buy a CD
    • Buy a T-Shirt
    • MW Book
    • ActiveX Book
    • Donate
    • Buy Support
  • Documentation
    • MWGIS App. User Guide
    • GISTools User Guide
    • MW Plug-ins Dev. Guide
    • MWGIS ActiveX Dev. Guide
    • MWGeoProc Dev. Guide

MapWinGIS:Grid CellToProj

From MapWindow GIS

Jump to: navigation, search

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://www.mapwindow.org/wiki/index.php/MapWinGIS:Grid_CellToProj"
Views
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in / create account
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
  • Permanent link

Geospatial Software Lab

Copyright © 2008 - MapWindow Open Source Team
( last updated: December 03 2008.)
Home | Donate | Download | MapWindow GIS Desktop | MapWinGIS.ocx | Plug-ins | Contact | Lists | Bugs | Sample Code | Documentation
Code Repository | Open Source License | Discussion Forum | Wiki | Join the Team | Site Statistics | Links