mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-09 00:14:51 +00:00
New TransverseMercatorProjection implementation
This commit is contained in:
parent
caa25cb471
commit
9c69deb782
9 changed files with 357 additions and 23 deletions
|
|
@ -35,6 +35,9 @@ namespace MapControl
|
|||
case UpsSouthProjection.DefaultCrsId:
|
||||
return new UpsSouthProjection();
|
||||
|
||||
case Wgs84AutoUtmProjection.DefaultCrsId:
|
||||
return new Wgs84AutoUtmProjection();
|
||||
|
||||
case OrthographicProjection.DefaultCrsId:
|
||||
return new OrthographicProjection();
|
||||
|
||||
|
|
@ -50,6 +53,29 @@ namespace MapControl
|
|||
case AzimuthalEquidistantProjection.DefaultCrsId:
|
||||
return new AzimuthalEquidistantProjection();
|
||||
|
||||
default:
|
||||
return crsId.StartsWith("EPSG:") && int.TryParse(crsId.Substring(5), out int epsgCode)
|
||||
? GetProjection(epsgCode)
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual MapProjection GetProjection(int epsgCode)
|
||||
{
|
||||
switch (epsgCode)
|
||||
{
|
||||
case var c when c >= Etrs89UtmProjection.FirstZoneEpsgCode && c <= Etrs89UtmProjection.LastZoneEpsgCode:
|
||||
return new Etrs89UtmProjection(epsgCode % 100);
|
||||
|
||||
case var c when c >= Nad83UtmProjection.FirstZoneEpsgCode && c <= Nad83UtmProjection.LastZoneEpsgCode:
|
||||
return new Nad83UtmProjection(epsgCode % 100);
|
||||
|
||||
case var c when c >= Wgs84UtmProjection.FirstZoneNorthEpsgCode && c <= Wgs84UtmProjection.LastZoneNorthEpsgCode:
|
||||
return new Wgs84UtmProjection(epsgCode % 100, true);
|
||||
|
||||
case var c when c >= Wgs84UtmProjection.FirstZoneSouthEpsgCode && c <= Wgs84UtmProjection.LastZoneSouthEpsgCode:
|
||||
return new Wgs84UtmProjection(epsgCode % 100, false);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue