Answer the question
In order to leave comments, you need to log in
Can a two-dimensional array int[,] be a Dictionary value in C#?
Such a task. There are files containing 1.4 lyama values in the form of a two-dimensional array 1201x1201. Files with a specific type name - N02E128 (this is longitude and latitude).
The essence of the program will be that they set a square on the map with coordinates and it should load into memory all files suitable for the given coordinates, and I will check by deserialized coordinates from the file name.
Well, I decided that the dictionary is suitable to make the names the keys and store these arrays by the keys. But it looks like it can't store a 2D array as a value.
I'm also happy to hear other suggestions on how to store it.
Answer the question
In order to leave comments, you need to log in
You can push a tuple into a dictionary
Or describe the class itself, for example
public struct Coordinate {
public double Longitude { get; set; }
public double Latitude { get; set; }
}
public class MapPart {
public string Name { get; set; }
public ICollection<Coordinate> Coordinates { get; set; }
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question