ik ben braindead. long en lat zijn graden fml

This commit is contained in:
BuildTools
2020-07-30 16:57:32 +02:00
parent dee6b3a496
commit 414db7f523
28 changed files with 48 additions and 30 deletions

View File

@@ -27,22 +27,18 @@ namespace Globals
{
Naam = naam;
Punten = new List<Punt>();
MaximumX = double.MinValue;
MaximumY = double.MinValue;
MinimumX = double.MaxValue;
MinimumY = double.MaxValue;
foreach (LineString l in p.Coordinates)
{
foreach (Position pos in l.Coordinates)
{
if (pos.Longitude > MaximumX) MaximumX = pos.Longitude;
if (pos.Longitude < MinimumX) MinimumX = pos.Longitude;
if (pos.Latitude > MaximumY) MaximumY = pos.Latitude;
if (pos.Latitude < MinimumY) MinimumY = pos.Latitude;
Punten.Add(new Punt(pos.Longitude, pos.Latitude, naam));
}
}
Punten.Reverse();
MaximumX = Punten.Max(punt => punt.X);
MaximumY = Punten.Max(punt => punt.Y);
MinimumX = Punten.Min(punt => punt.X);
MinimumY = Punten.Min(punt => punt.Y);
}
public override string ToString()

View File

@@ -14,8 +14,8 @@ namespace Globals
public Punt(double x, double y, string naam = "")
{
Naam = naam;
X = x;
Y = y;
X = ConvertToRadians(x);
Y = ConvertToRadians(y);
}
public override string ToString()
@@ -23,7 +23,12 @@ namespace Globals
if (string.Equals(Naam, "", StringComparison.Ordinal)) return "UNKNOWN";
else return Naam;
}
public double ConvertToRadians(double angle)
{
return (Math.PI / 180) * angle;
}
public Point ToPoint()
{
return new Point(X, Y);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.