mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
EPSG Codes & CRS IDs
This commit is contained in:
parent
ce6f190bf1
commit
03c18d5126
9 changed files with 66 additions and 72 deletions
|
|
@ -19,18 +19,28 @@ namespace MapControl.Projections
|
|||
return factory;
|
||||
}
|
||||
|
||||
public Dictionary<int, string> CoordinateSystemWkts { get; } = new Dictionary<int, string>();
|
||||
public override MapProjection GetProjection(string crsId)
|
||||
{
|
||||
switch (crsId)
|
||||
{
|
||||
case MapControl.WebMercatorProjection.DefaultCrsId:
|
||||
return new WebMercatorProjection();
|
||||
|
||||
case MapControl.WorldMercatorProjection.DefaultCrsId:
|
||||
return new WorldMercatorProjection();
|
||||
|
||||
case MapControl.Wgs84AutoUtmProjection.DefaultCrsId:
|
||||
return new Wgs84AutoUtmProjection();
|
||||
|
||||
default:
|
||||
return base.GetProjection(crsId);
|
||||
}
|
||||
}
|
||||
|
||||
public override MapProjection GetProjection(int epsgCode)
|
||||
{
|
||||
switch (epsgCode)
|
||||
{
|
||||
case WorldMercatorProjection.EpsgCode:
|
||||
return new WorldMercatorProjection();
|
||||
|
||||
case WebMercatorProjection.EpsgCode:
|
||||
return new WebMercatorProjection();
|
||||
|
||||
case int c when c >= Ed50UtmProjection.FirstZoneEpsgCode && c <= Ed50UtmProjection.LastZoneEpsgCode:
|
||||
return new Ed50UtmProjection(epsgCode % 100);
|
||||
|
||||
|
|
@ -56,16 +66,6 @@ namespace MapControl.Projections
|
|||
}
|
||||
}
|
||||
|
||||
public override MapProjection GetProjection(string crsId)
|
||||
{
|
||||
switch (crsId)
|
||||
{
|
||||
case Wgs84AutoUtmProjection.DefaultCrsId:
|
||||
return new Wgs84AutoUtmProjection();
|
||||
|
||||
default:
|
||||
return base.GetProjection(crsId);
|
||||
}
|
||||
}
|
||||
public Dictionary<int, string> CoordinateSystemWkts { get; } = new Dictionary<int, string>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ namespace MapControl.Projections
|
|||
/// </summary>
|
||||
public class WebMercatorProjection : GeoApiProjection
|
||||
{
|
||||
public const int EpsgCode = 3857;
|
||||
|
||||
public WebMercatorProjection()
|
||||
{
|
||||
CoordinateSystem = ProjectedCoordinateSystem.WebMercator;
|
||||
|
|
|
|||
|
|
@ -45,11 +45,9 @@ namespace MapControl.Projections
|
|||
/// </summary>
|
||||
public class Wgs84AutoUtmProjection : Wgs84UtmProjection
|
||||
{
|
||||
public const string DefaultCrsId = "AUTO2:42001";
|
||||
|
||||
private readonly string autoCrsId;
|
||||
|
||||
public Wgs84AutoUtmProjection(string crsId = DefaultCrsId)
|
||||
public Wgs84AutoUtmProjection(string crsId = MapControl.Wgs84AutoUtmProjection.DefaultCrsId)
|
||||
: base(31, true)
|
||||
{
|
||||
autoCrsId = crsId;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ namespace MapControl.Projections
|
|||
/// </summary>
|
||||
public class WorldMercatorProjection : GeoApiProjection
|
||||
{
|
||||
public const int EpsgCode = 3395;
|
||||
|
||||
public WorldMercatorProjection()
|
||||
{
|
||||
CoordinateSystemWkt
|
||||
|
|
@ -43,7 +41,7 @@ namespace MapControl.Projections
|
|||
+ "AUTHORITY[\"EPSG\",\"9001\"]],"
|
||||
+ "AXIS[\"Easting\",EAST],"
|
||||
+ "AXIS[\"Northing\",NORTH],"
|
||||
+ $"AUTHORITY[\"EPSG\",\"{EpsgCode}\"]]";
|
||||
+ "AUTHORITY[\"EPSG\",\"3395\"]]";
|
||||
}
|
||||
|
||||
public override Point GetRelativeScale(Location location)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue