mirror of
https://github.com/bvanroll/cs-map-project.git
synced 2025-08-29 20:02:43 +00:00
ik ben braindead. long en lat zijn graden fml
This commit is contained in:
@@ -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()
|
||||
|
@@ -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.
Binary file not shown.
Reference in New Issue
Block a user