I am creating a Plugin and I need to know the
- Min and Max Latitud
- Min and max Longitud
That information shows in the Statistics tab of the Settings Window of the Project. (Menu Project -> Project Settings -> Statistics tab)
I get the Statistics information with:
Statistics stat = StatisticsService.GetStatistics(PetrelProject.PrimaryProject);
And then to get Latitud and Longitud information I do:
var latitud = stat.AxisInfo.OfType<PropertyInfoItem>().FirstOrDefault(item => item.Name == "Lat");
var longitud = stat.AxisInfo.OfType<PropertyInfoItem>().FirstOrDefault(item => item.Name == "Long");
However I arrived to this solution by looking at the data while debugging. I don't know if this will be the data structure for every project.
Additionally the precision of the Data that is in the AxisInfo item is less than what it is shown in the Statistics tab of the project.
Is there another way to get the Latitude and Longitud of the project?