|
@@ -632,29 +632,54 @@ namespace WebApplication3.Clases
|
632
|
632
|
return piezometria;
|
633
|
633
|
}
|
634
|
634
|
|
635
|
|
- public void GetGeolocalizationFromFile(string file,out string worldX,out string worldY, out string angle, out string length, out string heigth)
|
|
635
|
+ public void GetGeolocalizationFromFile(string file,out string worldX,out string worldY, out string angle, out string length, out string height)
|
636
|
636
|
{
|
|
637
|
+ string[] world_origin_x, world_origin_y, modelAngle, modelLength, modelHeight;
|
637
|
638
|
|
|
639
|
+ worldX = worldY = angle = length = height = "";
|
638
|
640
|
string text = File.ReadAllText(file);
|
639
|
641
|
|
640
|
642
|
List<string> data = text.Split("\r\n", StringSplitOptions.RemoveEmptyEntries).ToList();
|
641
|
643
|
//string geolocationData = data[2];
|
642
|
644
|
string geolocation_line = data.Find(x => x.Contains("<Georeference"));
|
643
|
645
|
|
644
|
|
- string[] geolocation_data = geolocation_line.Split(" ", StringSplitOptions.RemoveEmptyEntries);
|
645
|
|
- string[] world_origin_x = geolocation_data[3].Split("World_Origin_X=", StringSplitOptions.RemoveEmptyEntries);
|
646
|
|
- string[] world_origin_y = geolocation_data[4].Split("World_Origin_Y=", StringSplitOptions.RemoveEmptyEntries);
|
647
|
|
- string[] modelAngle = geolocation_data[5].Split("Angle=", StringSplitOptions.RemoveEmptyEntries);
|
648
|
|
- string[] modelLength = geolocation_data[6].Split("Length=", StringSplitOptions.RemoveEmptyEntries);
|
649
|
|
- string[] modelHeigth = geolocation_data[7].Split("Height=", StringSplitOptions.RemoveEmptyEntries);
|
|
646
|
+ List<string> geolocation_data = geolocation_line.Split(" ", StringSplitOptions.RemoveEmptyEntries).ToList();
|
650
|
647
|
|
|
648
|
+ string wox = geolocation_data.Find(x => x.Contains("World_Origin_X="));
|
|
649
|
+ if(wox != null)
|
|
650
|
+ {
|
|
651
|
+ world_origin_x = wox.Split("World_Origin_X=", StringSplitOptions.RemoveEmptyEntries);
|
|
652
|
+ worldX = world_origin_x[0].Replace("\"", string.Empty);
|
|
653
|
+ }
|
|
654
|
+
|
|
655
|
+ string woy = geolocation_data.Find(x => x.Contains("World_Origin_Y="));
|
|
656
|
+ if (wox != null)
|
|
657
|
+ {
|
|
658
|
+ world_origin_y = woy.Split("World_Origin_Y=", StringSplitOptions.RemoveEmptyEntries);
|
|
659
|
+ worldY = world_origin_y[0].Replace("\"", string.Empty);
|
|
660
|
+ }
|
|
661
|
+
|
|
662
|
+ string magl = geolocation_data.Find(x => x.Contains("Angle="));
|
|
663
|
+ if (magl != null)
|
|
664
|
+ {
|
|
665
|
+ modelAngle = magl.Split("Angle=", StringSplitOptions.RemoveEmptyEntries);
|
|
666
|
+ angle = modelAngle[0].Replace("\"", string.Empty);
|
|
667
|
+ }
|
651
|
668
|
|
652
|
|
- worldX = world_origin_x[0].Replace("\"", string.Empty);
|
653
|
|
- worldY = world_origin_y[0].Replace("\"", string.Empty);
|
654
|
|
- angle = modelAngle[0].Replace("\"",string.Empty);
|
655
|
|
- length = modelLength[0].Replace("\"", string.Empty);
|
656
|
|
- heigth = modelHeigth[0].Replace("\"", string.Empty);
|
|
669
|
+ string mlgth = geolocation_data.Find(x => x.Contains("Length="));
|
|
670
|
+ if (mlgth != null)
|
|
671
|
+ {
|
|
672
|
+ modelLength = mlgth.Split("Length=", StringSplitOptions.RemoveEmptyEntries);
|
|
673
|
+ length = modelLength[0].Replace("\"", string.Empty);
|
|
674
|
+ }
|
657
|
675
|
|
|
676
|
+ string mhei = geolocation_data.Find(x => x.Contains("Height="));
|
|
677
|
+ if (mhei != null)
|
|
678
|
+ {
|
|
679
|
+ modelHeight = mhei.Split("Height=", StringSplitOptions.RemoveEmptyEntries);
|
|
680
|
+ height = modelHeight[0].Replace("\"", string.Empty);
|
|
681
|
+ height = height.Replace("/>", string.Empty);
|
|
682
|
+ }
|
658
|
683
|
}
|
659
|
684
|
|
660
|
685
|
public WellData[] parseWellCSV(string file)
|