Hi Peter,
You are right. i have used the reference to a cell row and column in the grid.
There is a ConvertWorldToCell method in SDK that can be used on RasterDataset object to convert a spatial coordinate, point to cell row/column reference. Please refer the following snippet.
// Point coordinate should be in grid projection.
double pointX = -114.944043;
double pointY = 52.459101;
double dCellX = 0;
double dCellY = 0;
uint nField = 0;
string inputFilePath = System.IO.Path.GetFullPath(@"..\..\..\Input\12_ClassTable_AllDataType.mrr");
IRasterDataset dataset = RasterDatasetFactory.Open(inputFilePath);
//Convert World coordinate to cell coordinate.
dataset.ConvertWorldToCell(pointX,pointY,out dCellX,out dCellY,nField);
//Make cell coordinate to left- bottom coordinate of cell
long lCellX = (long)Math.Floor(dCellX);
long lCellY = (long)Math.Floor(dCellX);
Thanks
Upendra Patel
------------------------------
Upendra Patel
Knowledge Community Shared Account
Shelton CT
------------------------------
Original Message:
Sent: 12-17-2018 02:55
From: Peter Horsbøll Møller
Subject: MapBasic function to retrieve MRR-GridCellValue
Thanks Upendra,
This will be very helpful.
It looks like you use a reference to a cell row and cell column in the grid. Is that correct?
If yes, is there an easy way to convert a spatial coordinate, or a point, to a cell row/cell column reference?
Thanks
------------------------------
Peter Horsbøll Møller
Pitney Bowes
Original Message:
Sent: 12-17-2018 01:51
From: Upendra Patel
Subject: MapBasic function to retrieve MRR-GridCellValue
Hi,
If you are running the MapInfo Pro without Advance license, and want to get the cell value from raster SDK. you can use the attached sample C# code.
Thanks
Upendra Patel
------------------------------
Upendra Patel
Knowledge Community Shared Account
Shelton CT
Original Message:
Sent: 12-07-2018 07:09
From: Stefan Hausmann
Subject: MapBasic function to retrieve MRR-GridCellValue
Hi Bob,
yes, using the raster sdk is an Option, but an expensive one.
You can open mrr files with Standard MiPro 17 and you can query other raster cell values with mapbasic out of the box, so it would be consequent, - my opinion -, if querying a mrr-cell value would also be possible, without obtaining an expensive advanced License.
If the raster Team Comes up with an answer, it would be nice, if you share it.
Thanks and regards
Stefan
Original Message:
Sent: 12-04-2018 12:50
From: Bob Fortin
Subject: MapBasic function to retrieve MRR-GridCellValue
I have asked a member of our raster dev team to answer with details on how to do this.
You can do it using our raster sdk (which I think requires an advanced Pro license).
------------------------------
Bob Fortin
Original Message:
Sent: 12-03-2018 07:56
From: Stefan Hausmann
Subject: MapBasic function to retrieve MRR-GridCellValue
Hi,
Is there currently really no mapbasic function to query a raster cell value in a mrr-file?
Tried it with GetGridCellValue but do only get error Messages.
RasterTableInfo seems to work with mrr-Tables.
In the mapbasic help file i couldn't find a hint to such a function.
Many thanks in Advance
and
Cheers
Stefan