├── LICENSE
├── LICENSE.meta
├── Runtime.meta
├── Runtime
├── GeocoordinateTransformer.meta
├── GeocoordinateTransformer
│ ├── CoordinateTransformer.cs
│ ├── CoordinateTransformer.cs.meta
│ ├── CoordinateTransformerTest.cs
│ ├── CoordinateTransformerTest.cs.meta
│ ├── GeographicCoordinates.cs
│ ├── GeographicCoordinates.cs.meta
│ ├── UTMCoordinates.cs
│ ├── UTMCoordinates.cs.meta
│ ├── UTMCrs.cs
│ └── UTMCrs.cs.meta
├── ProjNet.meta
├── ProjNet
│ ├── CoordinateSystemServices.cs
│ ├── CoordinateSystemServices.cs.meta
│ ├── CoordinateSystems.meta
│ ├── CoordinateSystems
│ │ ├── AngularUnit.cs
│ │ ├── AngularUnit.cs.meta
│ │ ├── AxisInfo.cs
│ │ ├── AxisInfo.cs.meta
│ │ ├── AxisOrientationEnum.cs
│ │ ├── AxisOrientationEnum.cs.meta
│ │ ├── CoordinateSystem.cs
│ │ ├── CoordinateSystem.cs.meta
│ │ ├── CoordinateSystemFactory.cs
│ │ ├── CoordinateSystemFactory.cs.meta
│ │ ├── Datum.cs
│ │ ├── Datum.cs.meta
│ │ ├── DatumType.cs
│ │ ├── DatumType.cs.meta
│ │ ├── Ellipsoid.cs
│ │ ├── Ellipsoid.cs.meta
│ │ ├── FittedCoordinateSystem.cs
│ │ ├── FittedCoordinateSystem.cs.meta
│ │ ├── GeocentricCoordinateSystem.cs
│ │ ├── GeocentricCoordinateSystem.cs.meta
│ │ ├── GeographicCoordinateSystem.cs
│ │ ├── GeographicCoordinateSystem.cs.meta
│ │ ├── HorizontalCoordinateSystem.cs
│ │ ├── HorizontalCoordinateSystem.cs.meta
│ │ ├── HorizontalDatum.cs
│ │ ├── HorizontalDatum.cs.meta
│ │ ├── IInfo.cs
│ │ ├── IInfo.cs.meta
│ │ ├── IProjection.cs
│ │ ├── IProjection.cs.meta
│ │ ├── IUnit.cs
│ │ ├── IUnit.cs.meta
│ │ ├── Info.cs
│ │ ├── Info.cs.meta
│ │ ├── LinearUnit.cs
│ │ ├── LinearUnit.cs.meta
│ │ ├── Parameter.cs
│ │ ├── Parameter.cs.meta
│ │ ├── ParameterInfo.cs
│ │ ├── ParameterInfo.cs.meta
│ │ ├── PrimeMeridian.cs
│ │ ├── PrimeMeridian.cs.meta
│ │ ├── ProjectedCoordinateSystem.cs
│ │ ├── ProjectedCoordinateSystem.cs.meta
│ │ ├── Projection.cs
│ │ ├── Projection.cs.meta
│ │ ├── ProjectionParameter.cs
│ │ ├── ProjectionParameter.cs.meta
│ │ ├── Projections.meta
│ │ ├── Projections
│ │ │ ├── AlbersProjection.cs
│ │ │ ├── AlbersProjection.cs.meta
│ │ │ ├── CassiniSoldnerProjection.cs
│ │ │ ├── CassiniSoldnerProjection.cs.meta
│ │ │ ├── HotineObliqueMercatorProjection.cs
│ │ │ ├── HotineObliqueMercatorProjection.cs.meta
│ │ │ ├── KrovakProjection.cs
│ │ │ ├── KrovakProjection.cs.meta
│ │ │ ├── LambertAzimuthalEqualAreaProjection.cs
│ │ │ ├── LambertAzimuthalEqualAreaProjection.cs.meta
│ │ │ ├── LambertConformalConic2SP.cs
│ │ │ ├── LambertConformalConic2SP.cs.meta
│ │ │ ├── MapProjection.cs
│ │ │ ├── MapProjection.cs.meta
│ │ │ ├── Mercator.cs
│ │ │ ├── Mercator.cs.meta
│ │ │ ├── ObliqueMercatorProjection.cs
│ │ │ ├── ObliqueMercatorProjection.cs.meta
│ │ │ ├── ObliqueStereographicProjection.cs
│ │ │ ├── ObliqueStereographicProjection.cs.meta
│ │ │ ├── PolyconicProjection.cs
│ │ │ ├── PolyconicProjection.cs.meta
│ │ │ ├── ProjectionParameterSet.cs
│ │ │ ├── ProjectionParameterSet.cs.meta
│ │ │ ├── ProjectionsRegistry.cs
│ │ │ ├── ProjectionsRegistry.cs.meta
│ │ │ ├── PseudoMercator.cs
│ │ │ ├── PseudoMercator.cs.meta
│ │ │ ├── TransverseMercator.cs
│ │ │ └── TransverseMercator.cs.meta
│ │ ├── Transformations.meta
│ │ ├── Transformations
│ │ │ ├── AffineTransform.cs
│ │ │ ├── AffineTransform.cs.meta
│ │ │ ├── ConcatenatedTransform.cs
│ │ │ ├── ConcatenatedTransform.cs.meta
│ │ │ ├── CoordinateTransformation.cs
│ │ │ ├── CoordinateTransformation.cs.meta
│ │ │ ├── CoordinateTransformationFactory.cs
│ │ │ ├── CoordinateTransformationFactory.cs.meta
│ │ │ ├── DatumTransform.cs
│ │ │ ├── DatumTransform.cs.meta
│ │ │ ├── DomainFlags.cs
│ │ │ ├── DomainFlags.cs.meta
│ │ │ ├── GeocentricTransform.cs
│ │ │ ├── GeocentricTransform.cs.meta
│ │ │ ├── GeographicTransform.cs
│ │ │ ├── GeographicTransform.cs.meta
│ │ │ ├── ICoordinateTransformation.cs
│ │ │ ├── ICoordinateTransformation.cs.meta
│ │ │ ├── MathTransform.cs
│ │ │ ├── MathTransform.cs.meta
│ │ │ ├── PrimeMeridianTransform.cs
│ │ │ ├── PrimeMeridianTransform.cs.meta
│ │ │ ├── TransformType.cs
│ │ │ └── TransformType.cs.meta
│ │ ├── Unit.cs
│ │ ├── Unit.cs.meta
│ │ ├── WGS84ConversionInfo.cs
│ │ └── WGS84ConversionInfo.cs.meta
│ ├── Geometries.meta
│ ├── Geometries
│ │ ├── XY.cs
│ │ ├── XY.cs.meta
│ │ ├── XYZ.cs
│ │ └── XYZ.cs.meta
│ ├── IO.meta
│ └── IO
│ │ ├── CoordinateSystems.meta
│ │ └── CoordinateSystems
│ │ ├── CoordinateSystemWktReader.cs
│ │ ├── CoordinateSystemWktReader.cs.meta
│ │ ├── MathTransformWktReader.cs
│ │ ├── MathTransformWktReader.cs.meta
│ │ ├── StreamTokenizer.cs
│ │ ├── StreamTokenizer.cs.meta
│ │ ├── TokenType.cs
│ │ ├── TokenType.cs.meta
│ │ ├── WKTStreamTokenizer.cs
│ │ ├── WKTStreamTokenizer.cs.meta
│ │ ├── WktBracket.cs
│ │ └── WktBracket.cs.meta
├── ProjNet4Unity.Runtime.asmdef
└── ProjNet4Unity.Runtime.asmdef.meta
├── Sample~
├── Materials.meta
├── Materials
│ ├── TerrainTexture.mat
│ ├── TerrainTexture.mat.meta
│ ├── TerrainTexture.png
│ └── TerrainTexture.png.meta
├── Prefabs.meta
├── Prefabs
│ ├── CoordinateTransformer.prefab
│ ├── CoordinateTransformer.prefab.meta
│ ├── CoordinateTransformerTester.prefab
│ ├── CoordinateTransformerTester.prefab.meta
│ ├── Plane.prefab
│ └── Plane.prefab.meta
├── Scenes.meta
└── Scenes
│ ├── SampleScene.unity
│ └── SampleScene.unity.meta
├── docs.meta
├── docs
├── README.md
├── README.md.meta
├── configure_reference_point.gif
├── configure_reference_point.gif.meta
├── documentation.pdf
├── documentation.pdf.meta
├── import_sample.gif
├── import_sample.gif.meta
├── install_via_unity_package_manager.gif
├── install_via_unity_package_manager.gif.meta
├── test_coordiante_transformer.gif
└── test_coordiante_transformer.gif.meta
├── package.json
└── package.json.meta
/LICENSE.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 67cd4075870837f47b674218461a78c6
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Runtime.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7ffb23681fba7fd488f5b67b73b012d1
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Runtime/GeocoordinateTransformer.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e685f8956e8a8aa4a8ae1a2895d02a93
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Runtime/GeocoordinateTransformer/CoordinateTransformer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 55b0209a21a2c1a4c841029162f41f10
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/GeocoordinateTransformer/CoordinateTransformerTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnityEngine;
3 |
4 | namespace GeocoordinateTransformer
5 | {
6 | ///
7 | /// Test class to demonstrate the functionality of CoordinateTransformer. Contains necessary test variables and methods that can be changed and called from Unity's Inspector via the context menu.
8 | ///
9 | public class CoordinateTransformerTest : MonoBehaviour
10 | {
11 | ///
12 | /// Use instead.
13 | ///
14 | [field: SerializeField]
15 | private CoordinateTransformer _coordinateTransformer;
16 |
17 | ///
18 | /// Contains the that was created in the Unity Scene.
19 | ///
20 | /// Thrown when there was no could be found in the Unity Scene.
21 | public CoordinateTransformer CoordinateTransformer
22 | {
23 | get
24 | {
25 | if (!_coordinateTransformer)
26 | {
27 | _coordinateTransformer = GameObject.FindAnyObjectByType();
28 | if (!_coordinateTransformer)
29 | {
30 | throw new ApplicationException("CoordinateTransformer could not be found in scene. Please add one CoordinateTransformer to each szene and provide UTM coordinates for the representing Unity's origin.");
31 | }
32 | }
33 |
34 | return _coordinateTransformer;
35 | }
36 | set => _coordinateTransformer = value;
37 | }
38 |
39 | // Awake is called by Unity
40 | private void Awake()
41 | {
42 | CoordinateTransformer = GameObject.FindAnyObjectByType();
43 | if (!CoordinateTransformer)
44 | {
45 | Debug.LogError("CoordinateTransformer could not be found in scene. Please add one CoordinateTransformer to each szene and provide UTM coordinates for the representing Unity's origin.");
46 | }
47 | }
48 |
49 | ///
50 | /// Predefined and changeable for demonstration purpose.
51 | ///
52 | [SerializeField]
53 | private GeographicCoordinates geographicTestCoordinates = new(latitude: 53.5417104602435, longitude: 10.0051097859429, altitude: 4.25);
54 |
55 | ///
56 | /// Predefined and changeable for demonstration purpose.
57 | ///
58 | [SerializeField]
59 | private UTMCoordinates utmTestCoordinates = new(east: 566605, north: 5933004, altitude: 3);
60 |
61 |
62 | ///
63 | /// Places the GameObject, the component is attached to, according to the definition in the field.
64 | ///
65 | [ContextMenu("PlaceAccordingToGeographicCoordinates")]
66 | private void PlaceAccordingToGeographicCoordinates()
67 | {
68 | Debug.LogFormat("Given Geographic coordinates -- latitude: {0}, longitude: {1} and given altitude: {2}", geographicTestCoordinates.latitude, geographicTestCoordinates.longitude, geographicTestCoordinates.altitude);
69 |
70 | Vector3 unityCoordinates = CoordinateTransformer.GetUnityCoordinates(geographicTestCoordinates);
71 | this.gameObject.transform.position = unityCoordinates;
72 | Debug.LogFormat("Derived Unity coordinates -- x: {0}, y: {1}, z:{2}\nObject placed accordingly.", unityCoordinates.x, unityCoordinates.y, unityCoordinates.z);
73 | }
74 |
75 |
76 | ///
77 | /// Places the GameObject, the component is attached to, according to the definition in the field.
78 | ///
79 | [ContextMenu("PlaceAccordingToUTMCoordinates")]
80 | private void PlaceAccordingToUTMCoordinates()
81 | {
82 | Debug.LogFormat("Given UTM coordinates -- E: {0}, N: {1} and given altitude: {2}", utmTestCoordinates.east, utmTestCoordinates.north, utmTestCoordinates.altitude);
83 |
84 | Vector3 unityCoordinates = CoordinateTransformer.GetUnityCoordinates(utmTestCoordinates);
85 | this.gameObject.transform.position = unityCoordinates;
86 | Debug.LogFormat("Derived Unity coordinates -- x: {0}, y: {1}, z:{2}\nObject placed accordingly.", unityCoordinates.x, unityCoordinates.y, unityCoordinates.z);
87 | }
88 |
89 |
90 | ///
91 | /// Converts the current position in the Unity Scene into and prints them in the Unity Console.
92 | ///
93 | [ContextMenu("GetGeographicCoordinatesOfCurrentPlacement")]
94 | private void GetGeographicCoordinatesOfCurrentPlacement()
95 | {
96 | Vector3 unityCoordinates = this.gameObject.transform.position;
97 | Debug.LogFormat("Given Unity coordinates of placed object -- x: {0}, y: {1}, z:{2}", unityCoordinates.x, unityCoordinates.y, unityCoordinates.z);
98 |
99 | GeographicCoordinates geographicCoordinates = CoordinateTransformer.GetGeographicCoordinates(unityCoordinates);
100 | Debug.LogFormat("Derived GeographicCoordinates coordinates -- latitude: {0}, longitude: {1} and constant altitude: {2}", geographicCoordinates.latitude, geographicCoordinates.longitude, geographicCoordinates.altitude);
101 | }
102 |
103 |
104 | ///
105 | /// Converts the current position in the Unity Scene into and prints them in the Unity Console.
106 | ///
107 | [ContextMenu("GetUTMCoordinatesOfCurrentPlacement")]
108 | private void GetUTMCoordinatesOfCurrentPlacement()
109 | {
110 | Vector3 unityCoordinates = this.gameObject.transform.position;
111 | Debug.LogFormat("Given Unity coordinates of placed object -- x: {0}, y: {1}, z:{2}", unityCoordinates.x, unityCoordinates.y, unityCoordinates.z);
112 |
113 | UTMCoordinates utmCoordinates = CoordinateTransformer.GetUTMCoordinates(unityCoordinates);
114 | Debug.LogFormat("Derived UTM coordinates -- E: {0}, N: {1} and constant altitude: {2}", utmCoordinates.east, utmCoordinates.north, utmCoordinates.altitude);
115 | }
116 | }
117 |
118 | }
--------------------------------------------------------------------------------
/Runtime/GeocoordinateTransformer/CoordinateTransformerTest.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2e8fc8489183e79469eba03bea10326d
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/GeocoordinateTransformer/GeographicCoordinates.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace GeocoordinateTransformer
4 | {
5 | ///
6 | /// Contains a latitude and longitude coordinate tuple and an altitude value in a user chosen height reference system (e.g. DHHN2016 in Germany).
7 | ///
8 | [System.Serializable]
9 | public class GeographicCoordinates
10 | {
11 | ///
12 | /// Latitude value of the coordinate tuple.
13 | ///
14 | public double latitude;
15 |
16 | ///
17 | /// Longitude value of the coordinate tuple.
18 | ///
19 | public double longitude;
20 |
21 | ///
22 | /// Altitude value in a user chosen height reference system (e.g. DHHN2016 in Germany).
23 | /// Note that the altitude value is not associated with the WGS84/UTM coordinate reference system.
24 | ///
25 | public double altitude;
26 |
27 | public GeographicCoordinates(double latitude, double longitude, double altitude)
28 | {
29 | this.latitude = latitude;
30 | this.longitude = longitude;
31 | this.altitude = altitude;
32 | }
33 |
34 |
35 | public override bool Equals(object other)
36 | {
37 | if (other == null || GetType() != other.GetType()) { return false; }
38 |
39 | GeographicCoordinates othergeographicCoordinates = other as GeographicCoordinates;
40 |
41 | return (
42 | this.latitude == othergeographicCoordinates.latitude &&
43 | this.longitude == othergeographicCoordinates.longitude &&
44 | this.altitude == othergeographicCoordinates.altitude
45 | );
46 | }
47 |
48 | public override int GetHashCode()
49 | {
50 | return base.GetHashCode();
51 | }
52 |
53 | public override string ToString()
54 | {
55 | return String.Format("GeographicCoordinates (with latitude: {0}, longitude: {1}, altitude: {2}", latitude, longitude, altitude);
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Runtime/GeocoordinateTransformer/GeographicCoordinates.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 28a8c9c68899e9d46b57b4bd7fcb3925
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/GeocoordinateTransformer/UTMCoordinates.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace GeocoordinateTransformer
4 | {
5 | ///
6 | /// Contains an easting and northing planar coordinate tuple in a WGS84/UTM coordinate reference system and an altitude value in a user chosen height reference system (e.g. DHHN2016 in Germany).
7 | ///
8 | [System.Serializable]
9 | public class UTMCoordinates
10 | {
11 | ///
12 | /// Easting value of the coordinate tuple.
13 | ///
14 | public double east;
15 |
16 | ///
17 | /// Northing value of the coordinate tuple.
18 | ///
19 | public double north;
20 |
21 | ///
22 | /// Altitude value in a user chosen height reference system (e.g. DHHN2016 in Germany).
23 | /// Note that the altitude value is not associated with the WGS84/UTM coordinate reference system.
24 | ///
25 | public double altitude;
26 |
27 |
28 | public UTMCoordinates(double east, double north, double altitude)
29 | {
30 | this.east = east;
31 | this.north = north;
32 | this.altitude = altitude;
33 | }
34 |
35 |
36 | public override bool Equals(object other)
37 | {
38 | if (other == null || GetType() != other.GetType()) { return false; }
39 |
40 | UTMCoordinates otherUTMCoordinates = other as UTMCoordinates;
41 |
42 | return (
43 | this.east == otherUTMCoordinates.east &&
44 | this.north == otherUTMCoordinates.north &&
45 | this.altitude == otherUTMCoordinates.altitude
46 | );
47 | }
48 |
49 | public override int GetHashCode()
50 | {
51 | return base.GetHashCode();
52 | }
53 |
54 | public override string ToString()
55 | {
56 | return String.Format("UTMCoordinates (with east: {0}, north: {1}, altitude: {2})", east, north, altitude);
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/Runtime/GeocoordinateTransformer/UTMCoordinates.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5ac2fe93f4038e64392537da3136ba45
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/GeocoordinateTransformer/UTMCrs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnityEngine;
3 |
4 | namespace GeocoordinateTransformer
5 | {
6 | ///
7 | /// Contains all variables to specify a WGS84/UTM coordinate refernece system.
8 | ///
9 | [System.Serializable]
10 | public class UTMCrs
11 | {
12 | ///
13 | /// Specifies the zone of the WGS84/UTM coordinate system (between 1 and 60).
14 | /// The default WGS84/UTM coordinate system is 32 which is most suitable for Hamburg in Germany.
15 | ///
16 | [SerializeField, Range(1, 60)]
17 | public int UTMZone = 32;
18 |
19 | ///
20 | /// Hemisphere of the region. Choose between the northern or southern hemisphere.
21 | /// The default hemisphere setting is Northern as it is suitable for Hamburg in Germany.
22 | ///
23 | [SerializeField]
24 | public Hemispheres Hemisphere = Hemispheres.Northern;
25 |
26 | public UTMCrs(int utmZone, Hemispheres hemispheres)
27 | {
28 | if (utmZone < 0 || utmZone > 60) { throw new ArgumentException(String.Format("Invalid UTM zone of {0}", utmZone)); }
29 |
30 | this.UTMZone = utmZone;
31 | this.Hemisphere = hemispheres;
32 | }
33 |
34 | ///
35 | /// Returns true if the zone is on the northern hemisphere. Otherwise it returns false.
36 | ///
37 | /// The default value is true.
38 | public bool IsNorthernHemisphere()
39 | {
40 | return Hemisphere switch
41 | {
42 | Hemispheres.Northern => true,
43 | Hemispheres.Southern => false,
44 | _ => true,
45 | };
46 | }
47 |
48 | public override bool Equals(object other)
49 | {
50 | if (other == null || GetType() != other.GetType()) { return false; }
51 |
52 | UTMCrs otherUtmCRS = other as UTMCrs;
53 |
54 | return (
55 | this.UTMZone == otherUtmCRS.UTMZone &&
56 | this.Hemisphere == otherUtmCRS.Hemisphere
57 | );
58 | }
59 |
60 | public override int GetHashCode()
61 | {
62 | return base.GetHashCode();
63 | }
64 |
65 | public override string ToString()
66 | {
67 | return String.Format("UtmCRS (with UTMZone: {0}, Hemisphere: {1})", UTMZone, Hemisphere);
68 | }
69 | }
70 |
71 | public enum Hemispheres
72 | {
73 | Northern,
74 | Southern
75 | }
76 | }
--------------------------------------------------------------------------------
/Runtime/GeocoordinateTransformer/UTMCrs.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1f025ee27699d3a43b420046242b560c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0ff4c0b0d68e07c42a74a201dcf00648
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystemServices.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aa35154675d87e144a5be25284f169e3
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aa14d690665a9b445b6bf861df8f8eaa
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/AngularUnit.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Globalization;
20 | using System.Text;
21 |
22 | namespace ProjNet.CoordinateSystems
23 | {
24 | ///
25 | /// Definition of angular units.
26 | ///
27 | [Serializable]
28 | public class AngularUnit : Info, IUnit
29 | {
30 | ///
31 | /// Equality tolerance value. Values with a difference less than this are considered equal.
32 | ///
33 | private const double EqualityTolerance = 2.0e-17;
34 |
35 | ///
36 | /// Initializes a new instance of a angular unit
37 | ///
38 | /// Radians per unit
39 | public AngularUnit(double radiansPerUnit)
40 | : this(
41 | radiansPerUnit,string.Empty,string.Empty,-1,string.Empty,string.Empty,string.Empty)
42 | {
43 | }
44 |
45 | ///
46 | /// Initializes a new instance of a angular unit
47 | ///
48 | /// Radians per unit
49 | /// Name
50 | /// Authority name
51 | /// Authority-specific identification code.
52 | /// Alias
53 | /// Abbreviation
54 | /// Provider-supplied remarks
55 | internal AngularUnit(double radiansPerUnit, string name, string authority, long authorityCode, string alias, string abbreviation, string remarks)
56 | :
57 | base(name, authority, authorityCode, alias, abbreviation, remarks)
58 | {
59 | _RadiansPerUnit = radiansPerUnit;
60 | }
61 |
62 | #region Predifined units
63 |
64 | ///
65 | /// The angular degrees are PI/180 = 0.017453292519943295769236907684886 radians
66 | ///
67 | public static AngularUnit Degrees
68 | {
69 | get { return new AngularUnit(0.017453292519943295769236907684886, "degree", "EPSG", 9102, "deg", string.Empty, "=pi/180 radians"); }
70 | }
71 |
72 | ///
73 | /// SI standard unit
74 | ///
75 | public static AngularUnit Radian
76 | {
77 | get { return new AngularUnit(1, "radian", "EPSG", 9101, "rad", string.Empty, "SI standard unit."); }
78 | }
79 |
80 | ///
81 | /// Pi / 200 = 0.015707963267948966192313216916398 radians
82 | ///
83 | public static AngularUnit Grad
84 | {
85 | get { return new AngularUnit(0.015707963267948966192313216916398, "grad", "EPSG", 9105, "gr", string.Empty, "=pi/200 radians."); }
86 | }
87 |
88 | ///
89 | /// Pi / 200 = 0.015707963267948966192313216916398 radians
90 | ///
91 | public static AngularUnit Gon
92 | {
93 | get { return new AngularUnit(0.015707963267948966192313216916398, "gon", "EPSG", 9106, "g", string.Empty, "=pi/200 radians."); }
94 | }
95 | #endregion
96 |
97 | #region IAngularUnit Members
98 |
99 | private double _RadiansPerUnit;
100 |
101 | ///
102 | /// Gets or sets the number of radians per .
103 | ///
104 | public double RadiansPerUnit
105 | {
106 | get { return _RadiansPerUnit; }
107 | set { _RadiansPerUnit = value; }
108 | }
109 |
110 | ///
111 | /// Returns the Well-known text for this object
112 | /// as defined in the simple features specification.
113 | ///
114 | public override string WKT
115 | {
116 | get
117 | {
118 | var sb = new StringBuilder();
119 | sb.AppendFormat(CultureInfo.InvariantCulture.NumberFormat,"UNIT[\"{0}\", {1}", Name, RadiansPerUnit);
120 | if (!string.IsNullOrWhiteSpace(Authority) && AuthorityCode > 0)
121 | sb.AppendFormat(", AUTHORITY[\"{0}\", \"{1}\"]", Authority, AuthorityCode);
122 | sb.Append("]");
123 | return sb.ToString();
124 | }
125 | }
126 |
127 | ///
128 | /// Gets an XML representation of this object.
129 | ///
130 | public override string XML
131 | {
132 | get
133 | {
134 | return string.Format(CultureInfo.InvariantCulture.NumberFormat, "{1}", RadiansPerUnit, InfoXml);
135 | }
136 | }
137 |
138 | #endregion
139 |
140 | ///
141 | /// Checks whether the values of this instance is equal to the values of another instance.
142 | /// Only parameters used for coordinate system are used for comparison.
143 | /// Name, abbreviation, authority, alias and remarks are ignored in the comparison.
144 | ///
145 | ///
146 | /// True if equal
147 | public override bool EqualParams(object obj)
148 | {
149 | if (!(obj is AngularUnit))
150 | return false;
151 | return Math.Abs(((AngularUnit)obj).RadiansPerUnit - this.RadiansPerUnit) < EqualityTolerance;
152 | }
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/AngularUnit.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 723d71294bcbb3748979ecbf253701b1
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/AxisInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Globalization;
20 |
21 | namespace ProjNet.CoordinateSystems
22 | {
23 | ///
24 | /// Details of axis. This is used to label axes, and indicate the orientation.
25 | ///
26 | [Serializable]
27 | public class AxisInfo
28 | {
29 | ///
30 | /// Initializes a new instance of an AxisInfo.
31 | ///
32 | /// Name of axis
33 | /// Axis orientation
34 | public AxisInfo(string name, AxisOrientationEnum orientation)
35 | {
36 | _Name = name;
37 | _Orientation = orientation;
38 | }
39 |
40 | private string _Name;
41 |
42 | ///
43 | /// Human readable name for axis. Possible values are X, Y, Long, Lat or any other short string.
44 | ///
45 | public string Name
46 | {
47 | get { return _Name; }
48 | set { _Name = value; }
49 | }
50 |
51 | private AxisOrientationEnum _Orientation;
52 |
53 | ///
54 | /// Gets enumerated value for orientation.
55 | ///
56 | public AxisOrientationEnum Orientation
57 | {
58 | get { return _Orientation; }
59 | set { _Orientation = value; }
60 | }
61 |
62 | ///
63 | /// Returns the Well-known text for this object
64 | /// as defined in the simple features specification.
65 | ///
66 | public string WKT
67 | {
68 | get
69 | {
70 | return $"AXIS[\"{Name}\", {Orientation.ToString().ToUpperInvariant()}]";
71 | }
72 | }
73 |
74 | ///
75 | /// Gets an XML representation of this object
76 | ///
77 | public string XML
78 | {
79 | get
80 | {
81 | return string.Format(CultureInfo.InvariantCulture.NumberFormat,
82 | "", Name, Orientation.ToString()
83 | .ToUpperInvariant());
84 | }
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/AxisInfo.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 118ced00d3d64ff428fd766a1e1206ad
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/AxisOrientationEnum.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | namespace ProjNet.CoordinateSystems
19 | {
20 | ///
21 | /// Orientation of axis. Some coordinate systems use non-standard orientations.
22 | /// For example, the first axis in South African grids usually points West,
23 | /// instead of East. This information is obviously relevant for algorithms
24 | /// converting South African grid coordinates into Lat/Long.
25 | ///
26 | public enum AxisOrientationEnum : short
27 | {
28 | ///
29 | /// Unknown or unspecified axis orientation. This can be used for local or fitted coordinate systems.
30 | ///
31 | Other = 0,
32 |
33 | ///
34 | /// Increasing ordinates values go North. This is usually used for Grid Y coordinates and Latitude.
35 | ///
36 | North = 1,
37 |
38 | ///
39 | /// Increasing ordinates values go South. This is rarely used.
40 | ///
41 | South = 2,
42 |
43 | ///
44 | /// Increasing ordinates values go East. This is rarely used.
45 | ///
46 | East = 3,
47 |
48 | ///
49 | /// Increasing ordinates values go West. This is usually used for Grid X coordinates and Longitude.
50 | ///
51 | West = 4,
52 |
53 | ///
54 | /// Increasing ordinates values go up. This is used for vertical coordinate systems.
55 | ///
56 | Up = 5,
57 |
58 | ///
59 | /// Increasing ordinates values go down. This is used for vertical coordinate systems.
60 | ///
61 | Down = 6
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/AxisOrientationEnum.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4534f5acb961dcf43aed78934394bfae
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/CoordinateSystem.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Collections.Generic;
20 | using System.Globalization;
21 |
22 | namespace ProjNet.CoordinateSystems
23 | {
24 | ///
25 | /// Base interface for all coordinate systems.
26 | ///
27 | ///
28 | /// A coordinate system is a mathematical space, where the elements of the space
29 | /// are called positions. Each position is described by a list of numbers. The length
30 | /// of the list corresponds to the dimension of the coordinate system. So in a 2D
31 | /// coordinate system each position is described by a list containing 2 numbers.
32 | /// However, in a coordinate system, not all lists of numbers correspond to a
33 | /// position - some lists may be outside the domain of the coordinate system. For
34 | /// example, in a 2D Lat/Lon coordinate system, the list (91,91) does not correspond
35 | /// to a position.
36 | /// Some coordinate systems also have a mapping from the mathematical space into
37 | /// locations in the real world. So in a Lat/Lon coordinate system, the mathematical
38 | /// position (lat, long) corresponds to a location on the surface of the Earth. This
39 | /// mapping from the mathematical space into real-world locations is called a Datum.
40 | ///
41 | [Serializable]
42 | public abstract class CoordinateSystem : Info
43 | {
44 | ///
45 | /// Initializes a new instance of a coordinate system.
46 | ///
47 | /// Name
48 | /// Authority name
49 | /// Authority-specific identification code.
50 | /// Alias
51 | /// Abbreviation
52 | /// Provider-supplied remarks
53 | internal CoordinateSystem(string name, string authority, long authorityCode, string alias, string abbreviation, string remarks)
54 | : base (name, authority, authorityCode, alias,abbreviation, remarks) { }
55 |
56 | #region ICoordinateSystem Members
57 |
58 | ///
59 | /// Dimension of the coordinate system.
60 | ///
61 | public int Dimension
62 | {
63 | get { return _AxisInfo.Count; }
64 | }
65 |
66 | ///
67 | /// Gets the units for the dimension within coordinate system.
68 | /// Each dimension in the coordinate system has corresponding units.
69 | ///
70 | public abstract IUnit GetUnits(int dimension);
71 |
72 | private List _AxisInfo;
73 | internal List AxisInfo
74 | {
75 | get { return _AxisInfo; }
76 | set { _AxisInfo = value; }
77 | }
78 |
79 |
80 | ///
81 | /// Gets axis details for dimension within coordinate system.
82 | ///
83 | /// Dimension
84 | /// Axis info
85 | public AxisInfo GetAxis(int dimension)
86 | {
87 | if (dimension >= _AxisInfo.Count || dimension < 0)
88 | throw new ArgumentException("AxisInfo not available for dimension " + dimension.ToString(CultureInfo.InvariantCulture));
89 | return _AxisInfo[dimension];
90 | }
91 |
92 |
93 | private double[] _DefaultEnvelope;
94 |
95 | ///
96 | /// Gets default envelope of coordinate system.
97 | ///
98 | ///
99 | /// Coordinate systems which are bounded should return the minimum bounding box of their domain.
100 | /// Unbounded coordinate systems should return a box which is as large as is likely to be used.
101 | /// For example, a (lon,lat) geographic coordinate system in degrees should return a box from
102 | /// (-180,-90) to (180,90), and a geocentric coordinate system could return a box from (-r,-r,-r)
103 | /// to (+r,+r,+r) where r is the approximate radius of the Earth.
104 | ///
105 | public double[] DefaultEnvelope
106 | {
107 | get { return _DefaultEnvelope; }
108 | set { _DefaultEnvelope = value; }
109 | }
110 |
111 | #endregion
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/CoordinateSystem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5a1c4d40682764149b320a531d6906d1
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/CoordinateSystemFactory.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0b60d3c25842dfd43934798f435dbcc3
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Datum.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 |
20 | namespace ProjNet.CoordinateSystems
21 | {
22 | ///
23 | /// A set of quantities from which other quantities are calculated.
24 | ///
25 | ///
26 | /// For the OGC abstract model, it can be defined as a set of real points on the earth
27 | /// that have coordinates. EG. A datum can be thought of as a set of parameters
28 | /// defining completely the origin and orientation of a coordinate system with respect
29 | /// to the earth. A textual description and/or a set of parameters describing the
30 | /// relationship of a coordinate system to some predefined physical locations (such
31 | /// as center of mass) and physical directions (such as axis of spin). The definition
32 | /// of the datum may also include the temporal behavior (such as the rate of change of
33 | /// the orientation of the coordinate axes).
34 | ///
35 | [Serializable]
36 | public abstract class Datum : Info
37 | {
38 | ///
39 | /// Initializes a new instance of a Datum object
40 | ///
41 | /// Datum type
42 | /// Name
43 | /// Authority name
44 | /// Authority-specific identification code.
45 | /// Alias
46 | /// Abbreviation
47 | /// Provider-supplied remarks
48 | internal Datum(DatumType type,
49 | string name, string authority, long code, string alias,
50 | string remarks, string abbreviation)
51 | : base(name, authority, code, alias, abbreviation, remarks)
52 | {
53 | DatumType = type;
54 | }
55 | #region IDatum Members
56 |
57 |
58 | ///
59 | /// Gets or sets the type of the datum as an enumerated code.
60 | ///
61 | public DatumType DatumType { get; set; }
62 |
63 | #endregion
64 |
65 | ///
66 | /// Checks whether the values of this instance is equal to the values of another instance.
67 | /// Only parameters used for coordinate system are used for comparison.
68 | /// Name, abbreviation, authority, alias and remarks are ignored in the comparison.
69 | ///
70 | ///
71 | /// True if equal
72 | public override bool EqualParams(object obj)
73 | {
74 | if (!(obj is Ellipsoid))
75 | return false;
76 | return (obj as Datum).DatumType == this.DatumType;
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Datum.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 86e9cf34aba6f9a469de17dec5a4a6ae
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/DatumType.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | namespace ProjNet.CoordinateSystems
19 | {
20 | ///
21 | /// A vertical datum of geoid model derived heights, also called GPS-derived heights.
22 | /// These heights are approximations of orthometric heights (H), constructed from the
23 | /// ellipsoidal heights (h) by the use of the given geoid undulation model (N) through
24 | /// the equation: H=h-N.
25 | ///
26 | public enum DatumType : int
27 | {
28 | ///
29 | /// Lowest possible value for horizontal datum types
30 | ///
31 | HD_Min = 1000,
32 |
33 | ///
34 | /// Unspecified horizontal datum type. Horizontal datums with this type should never
35 | /// supply a conversion to WGS84 using Bursa Wolf parameters.
36 | ///
37 | HD_Other = 1000,
38 |
39 | ///
40 | /// These datums, such as ED50, NAD27 and NAD83, have been designed to support
41 | /// horizontal positions on the ellipsoid as opposed to positions in 3-D space. These datums were designed mainly to support a horizontal component of a position in a domain of limited extent, such as a country, a region or a continent.
42 | ///
43 | HD_Classic = 1001,
44 |
45 | ///
46 | /// A geocentric datum is a "satellite age" modern geodetic datum mainly of global
47 | /// extent, such as WGS84 (used in GPS), PZ90 (used in GLONASS) and ITRF. These
48 | /// datums were designed to support both a horizontal component of position and
49 | /// a vertical component of position (through ellipsoidal heights). The regional
50 | /// realizations of ITRF, such as ETRF, are also included in this category.
51 | ///
52 | HD_Geocentric = 1002,
53 |
54 | ///
55 | /// Highest possible value for horizontal datum types.
56 | ///
57 | HD_Max = 1999,
58 |
59 | ///
60 | /// Lowest possible value for vertical datum types.
61 | ///
62 | VD_Min = 2000,
63 |
64 | ///
65 | /// Unspecified vertical datum type.
66 | ///
67 | VD_Other = 2000,
68 |
69 | ///
70 | /// A vertical datum for orthometric heights that are measured along the plumb line.
71 | ///
72 | VD_Orthometric = 2001,
73 |
74 | ///
75 | /// A vertical datum for ellipsoidal heights that are measured along the normal to
76 | /// the ellipsoid used in the definition of horizontal datum.
77 | ///
78 | VD_Ellipsoidal = 2002,
79 |
80 | ///
81 | /// The vertical datum of altitudes or heights in the atmosphere. These are
82 | /// approximations of orthometric heights obtained with the help of a barometer or
83 | /// a barometric altimeter. These values are usually expressed in one of the
84 | /// following units: meters, feet, millibars (used to measure pressure levels), or
85 | /// theta value (units used to measure geopotential height).
86 | ///
87 | VD_AltitudeBarometric = 2003,
88 |
89 | ///
90 | /// A normal height system.
91 | ///
92 | VD_Normal = 2004,
93 |
94 | ///
95 | /// A vertical datum of geoid model derived heights, also called GPS-derived heights.
96 | /// These heights are approximations of orthometric heights (H), constructed from the
97 | /// ellipsoidal heights (h) by the use of the given geoid undulation model (N)
98 | /// through the equation: H=h-N.
99 | ///
100 | VD_GeoidModelDerived = 2005,
101 |
102 | ///
103 | /// This attribute is used to support the set of datums generated for hydrographic
104 | /// engineering projects where depth measurements below sea level are needed. It is
105 | /// often called a hydrographic or a marine datum. Depths are measured in the
106 | /// direction perpendicular (approximately) to the actual equipotential surfaces of
107 | /// the earth's gravity field, using such procedures as echo-sounding.
108 | ///
109 | VD_Depth = 2006,
110 |
111 | ///
112 | /// Highest possible value for vertical datum types.
113 | ///
114 | VD_Max = 2999,
115 |
116 | ///
117 | /// Lowest possible value for local datum types.
118 | ///
119 | LD_Min = 10000,
120 |
121 | ///
122 | /// Highest possible value for local datum types.
123 | ///
124 | LD_Max = 32767
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/DatumType.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 467fc1ffcbfd5f048b8b8cfc189df8a1
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Ellipsoid.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Postert/ProjNet4GeoAPI-For-Unity/e033ddc108295c69af88effebae59370c0ba4001/Runtime/ProjNet/CoordinateSystems/Ellipsoid.cs
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Ellipsoid.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1dffc576eddf4d04ba21413ef3778d29
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/FittedCoordinateSystem.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Collections.Generic;
20 | using System.Globalization;
21 | using System.Text;
22 | using ProjNet.CoordinateSystems.Transformations;
23 |
24 | namespace ProjNet.CoordinateSystems
25 | {
26 | ///
27 | /// A coordinate system which sits inside another coordinate system. The fitted
28 | /// coordinate system can be rotated and shifted, or use any other math transform
29 | /// to inject itself into the base coordinate system.
30 | ///
31 | [Serializable]
32 | public class FittedCoordinateSystem : CoordinateSystem //, IFittedCoordinateSystem
33 | {
34 | ///
35 | /// Creates an instance of FittedCoordinateSystem using the specified parameters
36 | ///
37 | /// Underlying coordinate system.
38 | /// Transformation from fitted coordinate system to the base one
39 | /// Name
40 | /// Authority name
41 | /// Authority-specific identification code.
42 | /// Alias
43 | /// Abbreviation
44 | /// Provider-supplied remarks
45 | protected internal FittedCoordinateSystem (CoordinateSystem baseSystem, MathTransform transform,
46 | string name, string authority, long code, string alias, string remarks, string abbreviation)
47 | : base(name, authority, code, alias, abbreviation, remarks)
48 | {
49 | BaseCoordinateSystem = baseSystem;
50 | ToBaseTransform = transform;
51 | //get axis infos from the source
52 | base.AxisInfo = new List (baseSystem.Dimension);
53 | for (int dim = 0; dim < baseSystem.Dimension; dim++)
54 | {
55 | base.AxisInfo.Add (baseSystem.GetAxis (dim));
56 | }
57 | }
58 |
59 | #region public properties
60 |
61 |
62 | ///
63 | /// Represents math transform that injects itself into the base coordinate system.
64 | ///
65 | public MathTransform ToBaseTransform { get; }
66 | #endregion public properties
67 |
68 | #region FittedCoordinateSystem Members
69 |
70 | ///
71 | /// Gets underlying coordinate system.
72 | ///
73 | public CoordinateSystem BaseCoordinateSystem { get; }
74 |
75 | ///
76 | /// Gets Well-Known Text of a math transform to the base coordinate system.
77 | /// The dimension of this fitted coordinate system is determined by the source
78 | /// dimension of the math transform. The transform should be one-to-one within
79 | /// this coordinate system's domain, and the base coordinate system dimension
80 | /// must be at least as big as the dimension of this coordinate system.
81 | ///
82 | ///
83 | public string ToBase ()
84 | {
85 | return ToBaseTransform.WKT;
86 | }
87 |
88 | #endregion
89 |
90 | #region ICoordinateSystem Members
91 |
92 | ///
93 | /// Returns the Well-known text for this object as defined in the simple features specification.
94 | ///
95 | public override string WKT
96 | {
97 | get
98 | {
99 | // = FITTED_CS["", , ]
100 |
101 | var sb = new StringBuilder();
102 | sb.AppendFormat ("FITTED_CS[\"{0}\", {1}, {2}]", Name, this.ToBaseTransform.WKT, this.BaseCoordinateSystem.WKT);
103 | return sb.ToString();
104 | }
105 | }
106 |
107 | ///
108 | /// Gets an XML representation of this object.
109 | ///
110 | public override string XML
111 | {
112 | get
113 | {
114 | throw new NotImplementedException ();
115 | }
116 | }
117 |
118 | ///
119 | /// Checks whether the values of this instance is equal to the values of another instance.
120 | /// Only parameters used for coordinate system are used for comparison.
121 | /// Name, abbreviation, authority, alias and remarks are ignored in the comparison.
122 | ///
123 | ///
124 | /// True if equal
125 | public override bool EqualParams (object obj)
126 | {
127 | var fcs = obj as FittedCoordinateSystem;
128 | if (fcs != null)
129 | {
130 | if (fcs.BaseCoordinateSystem.EqualParams (this.BaseCoordinateSystem))
131 | {
132 | string fcsToBase = fcs.ToBase ();
133 | string thisToBase = this.ToBase ();
134 | if (string.Equals (fcsToBase, thisToBase))
135 | {
136 | return true;
137 | }
138 | }
139 | }
140 | return false;
141 | }
142 |
143 | ///
144 | /// Gets the units for the dimension within coordinate system.
145 | /// Each dimension in the coordinate system has corresponding units.
146 | ///
147 | public override IUnit GetUnits(int dimension)
148 | {
149 | return BaseCoordinateSystem.GetUnits (dimension);
150 | }
151 |
152 | #endregion
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/FittedCoordinateSystem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1d4e68757933e5840b03684a00b9fc98
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/GeocentricCoordinateSystem.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Collections.Generic;
20 | using System.Globalization;
21 | using System.Runtime.CompilerServices;
22 | using System.Text;
23 |
24 | namespace ProjNet.CoordinateSystems
25 | {
26 | ///
27 | /// A 3D coordinate system, with its origin at the center of the Earth.
28 | ///
29 | [Serializable]
30 | public class GeocentricCoordinateSystem : CoordinateSystem
31 | {
32 | internal GeocentricCoordinateSystem(HorizontalDatum datum, LinearUnit linearUnit, PrimeMeridian primeMeridian, List axisInfo,
33 | string name, string authority, long code, string alias,
34 | string remarks, string abbreviation)
35 | : base(name, authority, code, alias, abbreviation, remarks)
36 | {
37 | HorizontalDatum = datum;
38 | LinearUnit = linearUnit;
39 | PrimeMeridian = primeMeridian;
40 | if (axisInfo.Count != 3)
41 | throw new ArgumentException("Axis info should contain three axes for geocentric coordinate systems");
42 | base.AxisInfo = axisInfo;
43 | }
44 |
45 | #region Predefined geographic coordinate systems
46 |
47 | ///
48 | /// Creates a geocentric coordinate system based on the WGS84 ellipsoid, suitable for GPS measurements
49 | ///
50 | public static GeocentricCoordinateSystem WGS84
51 | {
52 | get
53 | {
54 | return new CoordinateSystemFactory().CreateGeocentricCoordinateSystem("WGS84 Geocentric",
55 | HorizontalDatum.WGS84, LinearUnit.Metre, PrimeMeridian.Greenwich);
56 | }
57 | }
58 |
59 | #endregion
60 |
61 | #region GeocentricCoordinateSystem Members
62 |
63 |
64 | ///
65 | /// Returns the HorizontalDatum. The horizontal datum is used to determine where
66 | /// the centre of the Earth is considered to be. All coordinate points will be
67 | /// measured from the centre of the Earth, and not the surface.
68 | ///
69 | public HorizontalDatum HorizontalDatum { get; set; }
70 |
71 | ///
72 | /// Gets the units used along all the axes.
73 | ///
74 | public LinearUnit LinearUnit { get; set; }
75 |
76 | ///
77 | /// Gets units for dimension within coordinate system. Each dimension in
78 | /// the coordinate system has corresponding units.
79 | ///
80 | /// Dimension
81 | /// Unit
82 | public override IUnit GetUnits(int dimension)
83 | {
84 | return LinearUnit;
85 | }
86 |
87 | ///
88 | /// Returns the PrimeMeridian.
89 | ///
90 | public PrimeMeridian PrimeMeridian { get; set; }
91 |
92 | ///
93 | /// Returns the Well-known text for this object
94 | /// as defined in the simple features specification.
95 | ///
96 | public override string WKT
97 | {
98 | get
99 | {
100 | var sb = new StringBuilder();
101 | sb.AppendFormat("GEOCCS[\"{0}\", {1}, {2}, {3}", Name, HorizontalDatum.WKT, PrimeMeridian.WKT, LinearUnit.WKT);
102 | //Skip axis info if they contain default values
103 | if (AxisInfo.Count != 3 ||
104 | AxisInfo[0].Name != "X" || AxisInfo[0].Orientation != AxisOrientationEnum.Other ||
105 | AxisInfo[1].Name != "Y" || AxisInfo[1].Orientation != AxisOrientationEnum.East ||
106 | AxisInfo[2].Name != "Z" || AxisInfo[2].Orientation != AxisOrientationEnum.North)
107 | for (int i = 0; i < AxisInfo.Count; i++)
108 | sb.AppendFormat(", {0}", GetAxis(i).WKT);
109 | if (!string.IsNullOrWhiteSpace(Authority) && AuthorityCode>0)
110 | sb.AppendFormat(", AUTHORITY[\"{0}\", \"{1}\"]", Authority, AuthorityCode);
111 | sb.Append("]");
112 | return sb.ToString();
113 | }
114 | }
115 |
116 | ///
117 | /// Gets an XML representation of this object
118 | ///
119 | public override string XML
120 | {
121 | get
122 | {
123 | var sb = new StringBuilder();
124 | sb.AppendFormat(CultureInfo.InvariantCulture.NumberFormat,
125 | "{1}",
126 | Dimension, InfoXml);
127 | foreach (var ai in AxisInfo)
128 | sb.Append(ai.XML);
129 | sb.AppendFormat("{0}{1}{2}",
130 | HorizontalDatum.XML, LinearUnit.XML, PrimeMeridian.XML);
131 | return sb.ToString();
132 | }
133 | }
134 |
135 | ///
136 | /// Checks whether the values of this instance is equal to the values of another instance.
137 | /// Only parameters used for coordinate system are used for comparison.
138 | /// Name, abbreviation, authority, alias and remarks are ignored in the comparison.
139 | ///
140 | ///
141 | /// True if equal
142 | public override bool EqualParams(object obj)
143 | {
144 | if (!(obj is GeocentricCoordinateSystem gcc))
145 | return false;
146 | return gcc.HorizontalDatum.EqualParams(HorizontalDatum) &&
147 | gcc.LinearUnit.EqualParams(LinearUnit) &&
148 | gcc.PrimeMeridian.EqualParams(PrimeMeridian);
149 | }
150 |
151 | #endregion
152 | }
153 | }
154 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/GeocentricCoordinateSystem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1cbffd433eda9e74c946795c0a289515
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/GeographicCoordinateSystem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 316cdfe1525e3c745b0071c04f6d7df6
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/HorizontalCoordinateSystem.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Collections.Generic;
20 |
21 | namespace ProjNet.CoordinateSystems
22 | {
23 | ///
24 | /// A 2D coordinate system suitable for positions on the Earth's surface.
25 | ///
26 | [Serializable]
27 | public abstract class HorizontalCoordinateSystem : CoordinateSystem
28 | {
29 | ///
30 | /// Creates an instance of HorizontalCoordinateSystem
31 | ///
32 | /// Horizontal datum
33 | /// Axis information
34 | /// Name
35 | /// Authority name
36 | /// Authority-specific identification code.
37 | /// Alias
38 | /// Abbreviation
39 | /// Provider-supplied remarks
40 | internal HorizontalCoordinateSystem(HorizontalDatum datum, List axisInfo,
41 | string name, string authority, long code, string alias,
42 | string remarks, string abbreviation)
43 | : base(name, authority, code, alias, abbreviation, remarks)
44 | {
45 | HorizontalDatum = datum;
46 | if (axisInfo.Count != 2)
47 | throw new ArgumentException("Axis info should contain two axes for horizontal coordinate systems");
48 | base.AxisInfo = axisInfo;
49 | }
50 |
51 | #region IHorizontalCoordinateSystem Members
52 |
53 |
54 | ///
55 | /// Gets or sets the HorizontalDatum.
56 | ///
57 | public HorizontalDatum HorizontalDatum { get; set; }
58 |
59 | #endregion
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/HorizontalCoordinateSystem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5d824e28f3be2a54b84ad7ba8033730c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/HorizontalDatum.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 348cd798071c46842aadba59b1ae7004
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/IInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | namespace ProjNet.CoordinateSystems
19 | {
20 | ///
21 | /// The ISpatialReferenceInfo interface defines the standard
22 | /// information stored with spatial reference objects. This
23 | /// interface is reused for many of the spatial reference
24 | /// objects in the system.
25 | ///
26 | public interface IInfo
27 | {
28 | ///
29 | /// Gets or sets the name of the object.
30 | ///
31 | string Name { get; }
32 |
33 | ///
34 | /// Gets or sets the authority name for this object, e.g., "EPSG",
35 | /// is this is a standard object with an authority specific
36 | /// identity code. Returns CUSTOM if this is a custom object.
37 | ///
38 | string Authority { get; }
39 |
40 | ///
41 | /// Gets or sets the authority specific identification code of the object
42 | ///
43 | long AuthorityCode { get; }
44 |
45 | ///
46 | /// Gets or sets the alias of the object.
47 | ///
48 | string Alias { get; }
49 |
50 | ///
51 | /// Gets or sets the abbreviation of the object.
52 | ///
53 | string Abbreviation { get; }
54 |
55 | ///
56 | /// Gets or sets the provider-supplied remarks for the object.
57 | ///
58 | string Remarks { get; }
59 |
60 | ///
61 | /// Returns the Well-known text for this spatial reference object
62 | /// as defined in the simple features specification.
63 | ///
64 | string WKT { get; }
65 |
66 | ///
67 | /// Gets an XML representation of this object.
68 | ///
69 | string XML { get; }
70 |
71 | ///
72 | /// Checks whether the values of this instance is equal to the values of another instance.
73 | /// Only parameters used for coordinate system are used for comparison.
74 | /// Name, abbreviation, authority, alias and remarks are ignored in the comparison.
75 | ///
76 | ///
77 | /// True if equal
78 | bool EqualParams(object obj);
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/IInfo.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6e42f7a5437d0ea43ae791f5cf4b7a0f
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/IProjection.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | namespace ProjNet.CoordinateSystems
19 | {
20 | ///
21 | /// The IProjection interface defines the standard information stored with projection
22 | /// objects. A projection object implements a coordinate transformation from a geographic
23 | /// coordinate system to a projected coordinate system, given the ellipsoid for the
24 | /// geographic coordinate system. It is expected that each coordinate transformation of
25 | /// interest, e.g., Transverse Mercator, Lambert, will be implemented as a COM class of
26 | /// coType Projection, supporting the IProjection interface.
27 | ///
28 | public interface IProjection : IInfo
29 | {
30 | ///
31 | /// Gets number of parameters of the projection.
32 | ///
33 | int NumParameters { get; }
34 |
35 | ///
36 | /// Gets the projection classification name (e.g. 'Transverse_Mercator').
37 | ///
38 | string ClassName { get; }
39 |
40 | ///
41 | /// Gets an indexed parameter of the projection.
42 | ///
43 | /// Index of parameter
44 | /// n'th parameter
45 | ProjectionParameter GetParameter(int index);
46 |
47 | ///
48 | /// Gets an named parameter of the projection.
49 | ///
50 | /// The parameter name is case insensitive
51 | /// Name of parameter
52 | /// parameter or null if not found
53 | ProjectionParameter GetParameter(string name);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/IProjection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d3765c802a7bf9645b333368c5a2f616
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/IUnit.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | namespace ProjNet.CoordinateSystems
19 | {
20 | ///
21 | /// The IUnit interface abstracts different kinds of units, it has no methods.
22 | ///
23 | public interface IUnit : IInfo { }
24 | }
25 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/IUnit.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8e8499f443d15f94384e4c8946b85511
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Info.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Postert/ProjNet4GeoAPI-For-Unity/e033ddc108295c69af88effebae59370c0ba4001/Runtime/ProjNet/CoordinateSystems/Info.cs
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Info.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aebd55da2a2c1d742be92aba37fdcbd7
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/LinearUnit.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Globalization;
20 | using System.Text;
21 |
22 | namespace ProjNet.CoordinateSystems
23 | {
24 | ///
25 | /// Definition of linear units.
26 | ///
27 | [Serializable]
28 | public class LinearUnit : Info, IUnit
29 | {
30 | ///
31 | /// Creates an instance of a linear unit
32 | ///
33 | /// Number of meters per
34 | /// Name
35 | /// Authority name
36 | /// Authority-specific identification code.
37 | /// Alias
38 | /// Abbreviation
39 | /// Provider-supplied remarks
40 | public LinearUnit(double metersPerUnit, string name, string authority, long authorityCode, string alias, string abbreviation, string remarks)
41 | :
42 | base(name, authority, authorityCode, alias, abbreviation, remarks)
43 | {
44 | MetersPerUnit = metersPerUnit;
45 | }
46 |
47 | #region Predefined units
48 | ///
49 | /// Returns the meters linear unit.
50 | /// Also known as International metre. SI standard unit.
51 | ///
52 | public static LinearUnit Metre
53 | {
54 | get { return new LinearUnit(1.0,"metre", "EPSG", 9001, "m", string.Empty, "Also known as International metre. SI standard unit."); }
55 | }
56 | ///
57 | /// Returns the foot linear unit (1ft = 0.3048m).
58 | ///
59 | public static LinearUnit Foot
60 | {
61 | get { return new LinearUnit(0.3048, "foot", "EPSG", 9002, "ft", string.Empty, string.Empty); }
62 | }
63 | ///
64 | /// Returns the US Survey foot linear unit (1ftUS = 0.304800609601219m).
65 | ///
66 | public static LinearUnit USSurveyFoot
67 | {
68 | get { return new LinearUnit(0.304800609601219, "US survey foot", "EPSG", 9003, "American foot", "ftUS", "Used in USA."); }
69 | }
70 | ///
71 | /// Returns the Nautical Mile linear unit (1NM = 1852m).
72 | ///
73 | public static LinearUnit NauticalMile
74 | {
75 | get { return new LinearUnit(1852, "nautical mile", "EPSG", 9030, "NM", string.Empty, string.Empty); }
76 | }
77 |
78 | ///
79 | /// Returns Clarke's foot.
80 | ///
81 | ///
82 | /// Assumes Clarke's 1865 ratio of 1 British foot = 0.3047972654 French legal metres applies to the international metre.
83 | /// Used in older Australian, southern African & British West Indian mapping.
84 | ///
85 | public static LinearUnit ClarkesFoot
86 | {
87 | get { return new LinearUnit(0.3047972654, "Clarke's foot", "EPSG", 9005, "Clarke's foot", string.Empty, "Assumes Clarke's 1865 ratio of 1 British foot = 0.3047972654 French legal metres applies to the international metre. Used in older Australian, southern African & British West Indian mapping."); }
88 | }
89 | #endregion
90 |
91 | #region ILinearUnit Members
92 |
93 |
94 | ///
95 | /// Gets or sets the number of meters per .
96 | ///
97 | public double MetersPerUnit { get; set; }
98 |
99 | ///
100 | /// Returns the Well-known text for this object
101 | /// as defined in the simple features specification.
102 | ///
103 | public override string WKT
104 | {
105 | get
106 | {
107 | var sb = new StringBuilder();
108 | sb.AppendFormat(CultureInfo.InvariantCulture.NumberFormat, "UNIT[\"{0}\", {1}", Name, MetersPerUnit);
109 | if (!string.IsNullOrWhiteSpace(Authority) && AuthorityCode > 0)
110 | sb.AppendFormat(", AUTHORITY[\"{0}\", \"{1}\"]", Authority, AuthorityCode);
111 | sb.Append("]");
112 | return sb.ToString();
113 | }
114 | }
115 |
116 | ///
117 | /// Gets an XML representation of this object
118 | ///
119 | public override string XML
120 | {
121 | get
122 | {
123 | return string.Format(CultureInfo.InvariantCulture.NumberFormat, "{1}", MetersPerUnit, InfoXml);
124 | }
125 | }
126 |
127 | #endregion
128 |
129 | ///
130 | /// Checks whether the values of this instance is equal to the values of another instance.
131 | /// Only parameters used for coordinate system are used for comparison.
132 | /// Name, abbreviation, authority, alias and remarks are ignored in the comparison.
133 | ///
134 | ///
135 | /// True if equal
136 | public override bool EqualParams(object obj)
137 | {
138 | if (!(obj is LinearUnit))
139 | return false;
140 | return (obj as LinearUnit).MetersPerUnit == this.MetersPerUnit;
141 | }
142 | }
143 | }
144 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/LinearUnit.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2d04d243394fcff4e9c1abfc989e77fe
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Parameter.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 |
20 | namespace ProjNet.CoordinateSystems
21 | {
22 | ///
23 | /// A named parameter value.
24 | ///
25 | [Serializable]
26 | public class Parameter
27 | {
28 | ///
29 | /// Creates an instance of a parameter
30 | ///
31 | /// Units are always either meters or degrees.
32 | /// Name of parameter
33 | /// Value
34 | public Parameter(string name, double value)
35 | {
36 | Name = name;
37 | Value = value;
38 | }
39 |
40 | ///
41 | /// Parameter name
42 | ///
43 | public string Name { get; set; }
44 |
45 | ///
46 | /// Parameter value
47 | ///
48 | public double Value { get; set; }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Parameter.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b58af0d3b9ebab741a6c75e95597fdb5
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/ParameterInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Collections.Generic;
20 |
21 | namespace ProjNet.CoordinateSystems
22 | {
23 | ///
24 | /// Simple class that implements the IParameterInfo interface for providing general set of the parameters.
25 | /// It allows discovering the names, and for setting and getting parameter values.
26 | ///
27 | [Serializable]
28 | internal class ParameterInfo
29 | {
30 | ///
31 | /// Gets the number of parameters expected.
32 | ///
33 | public int NumParameters
34 | {
35 | get
36 | {
37 | if (Parameters != null)
38 | {
39 | return Parameters.Count;
40 | }
41 | return 0;
42 | }
43 | }
44 |
45 | ///
46 | /// Gets or sets the parameters set for this projection.
47 | ///
48 | public List Parameters
49 | {
50 | get;
51 | set;
52 | }
53 |
54 | ///
55 | /// Returns the default parameters for this projection.
56 | ///
57 | ///
58 | public Parameter[] DefaultParameters ()
59 | {
60 | return new Parameter[0];
61 | }
62 |
63 | ///
64 | /// Gets the parameter by its name
65 | ///
66 | ///
67 | ///
68 | public Parameter GetParameterByName (string name)
69 | {
70 | if (Parameters != null)
71 | {
72 | //search parameter collection by name
73 | foreach (var param in Parameters)
74 | {
75 | if (param != null && param.Name == name)
76 | {
77 | return param;
78 | }
79 | }
80 | }
81 |
82 | return null;
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/ParameterInfo.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a15b43ee5d38ff144b77797ba85a07be
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/PrimeMeridian.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 11f3d8403381f984c880d4e2fe8fc90c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/ProjectedCoordinateSystem.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 582f7cd9acd31724dbd9096d3d0ee13b
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projection.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Collections.Generic;
20 | using System.Globalization;
21 | using System.Text;
22 |
23 | namespace ProjNet.CoordinateSystems
24 | {
25 | ///
26 | /// The Projection class defines the standard information stored with a projection
27 | /// objects. A projection object implements a coordinate transformation from a geographic
28 | /// coordinate system to a projected coordinate system, given the ellipsoid for the
29 | /// geographic coordinate system. It is expected that each coordinate transformation of
30 | /// interest, e.g., Transverse Mercator, Lambert, will be implemented as a class of
31 | /// type Projection, supporting the IProjection interface.
32 | ///
33 | [Serializable]
34 | public class Projection : Info, IProjection
35 | {
36 | internal Projection(string className, List parameters,
37 | string name, string authority, long code, string alias,
38 | string remarks, string abbreviation)
39 | : base(name, authority, code, alias, abbreviation, remarks)
40 | {
41 | _parameters = parameters;
42 | _ClassName = className;
43 | }
44 |
45 | #region Predefined projections
46 | #endregion
47 |
48 | #region IProjection Members
49 |
50 | ///
51 | /// Gets the number of parameters of the projection.
52 | ///
53 | public int NumParameters
54 | {
55 | get { return _parameters.Count; }
56 | }
57 |
58 | private List _parameters;
59 |
60 | ///
61 | /// Gets or sets the parameters of the projection
62 | ///
63 | internal List Parameters
64 | {
65 | get { return _parameters; }
66 | set { _parameters = value; }
67 | }
68 |
69 | ///
70 | /// Gets an indexed parameter of the projection.
71 | ///
72 | /// Index of parameter
73 | /// n'th parameter
74 | public ProjectionParameter GetParameter(int index)
75 | {
76 | return _parameters[index];
77 | }
78 |
79 | ///
80 | /// Gets an named parameter of the projection.
81 | ///
82 | /// The parameter name is case insensitive
83 | /// Name of parameter
84 | /// parameter or null if not found
85 | public ProjectionParameter GetParameter(string name)
86 | {
87 | foreach (ProjectionParameter par in _parameters)
88 | if (par.Name.Equals(name, StringComparison.OrdinalIgnoreCase))
89 | return par;
90 | return null;
91 | }
92 |
93 | private string _ClassName;
94 |
95 | ///
96 | /// Gets the projection classification name (e.g. "Transverse_Mercator").
97 | ///
98 | public string ClassName
99 | {
100 | get { return _ClassName; }
101 | }
102 |
103 | ///
104 | /// Returns the Well-known text for this object
105 | /// as defined in the simple features specification.
106 | ///
107 | public override string WKT
108 | {
109 | get
110 | {
111 | StringBuilder sb = new StringBuilder();
112 | sb.AppendFormat("PROJECTION[\"{0}\"", ClassName);
113 | if (!string.IsNullOrWhiteSpace(Authority) && AuthorityCode > 0)
114 | sb.AppendFormat(", AUTHORITY[\"{0}\", \"{1}\"]", Authority, AuthorityCode);
115 | sb.Append("]");
116 | return sb.ToString();
117 | }
118 | }
119 |
120 | ///
121 | /// Gets an XML representation of this object
122 | ///
123 | public override string XML
124 | {
125 | get
126 | {
127 | StringBuilder sb = new StringBuilder();
128 | sb.AppendFormat(CultureInfo.InvariantCulture.NumberFormat, "{1}", ClassName, InfoXml);
129 | foreach (ProjectionParameter param in Parameters)
130 | sb.Append(param.XML);
131 | sb.Append("");
132 | return sb.ToString();
133 | }
134 | }
135 |
136 | ///
137 | /// Checks whether the values of this instance is equal to the values of another instance.
138 | /// Only parameters used for coordinate system are used for comparison.
139 | /// Name, abbreviation, authority, alias and remarks are ignored in the comparison.
140 | ///
141 | ///
142 | /// True if equal
143 | public override bool EqualParams(object obj)
144 | {
145 | if (!(obj is Projection))
146 | return false;
147 | Projection proj = obj as Projection;
148 | if (proj.NumParameters != this.NumParameters)
149 | return false;
150 | for (int i = 0; i < _parameters.Count; i++)
151 | {
152 | ProjectionParameter param = GetParameter(proj.GetParameter(i).Name);
153 | if (param == null)
154 | return false;
155 | if (param.Value != proj.GetParameter(i).Value)
156 | return false;
157 | }
158 | return true;
159 | }
160 |
161 | #endregion
162 | }
163 | }
164 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 91a74640556374148b1a3297df519cbb
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/ProjectionParameter.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Globalization;
20 |
21 | namespace ProjNet.CoordinateSystems
22 | {
23 | ///
24 | /// A named projection parameter value.
25 | ///
26 | ///
27 | /// The linear units of parameters' values match the linear units of the containing
28 | /// projected coordinate system. The angular units of parameter values match the
29 | /// angular units of the geographic coordinate system that the projected coordinate
30 | /// system is based on. (Notice that this is different from ,
31 | /// where the units are always meters and degrees.)
32 | ///
33 | [Serializable]
34 | public class ProjectionParameter
35 | {
36 | ///
37 | /// Initializes an instance of a ProjectionParameter
38 | ///
39 | /// Name of parameter
40 | /// Parameter value
41 | public ProjectionParameter(string name, double value)
42 | {
43 | _Name = name;
44 | _Value = value;
45 | }
46 |
47 |
48 | private string _Name;
49 |
50 | ///
51 | /// Parameter name.
52 | ///
53 | public string Name
54 | {
55 | get { return _Name; }
56 | set { _Name = value; }
57 | }
58 |
59 | private double _Value;
60 |
61 | ///
62 | /// Parameter value.
63 | /// The linear units of a parameters' values match the linear units of the containing
64 | /// projected coordinate system. The angular units of parameter values match the
65 | /// angular units of the geographic coordinate system that the projected coordinate
66 | /// system is based on.
67 | ///
68 | public double Value
69 | {
70 | get { return _Value; }
71 | set { _Value = value; }
72 | }
73 |
74 | ///
75 | /// Returns the Well-known text for this object
76 | /// as defined in the simple features specification.
77 | ///
78 | public string WKT
79 | {
80 | get => string.Format(CultureInfo.InvariantCulture.NumberFormat, "PARAMETER[\"{0}\", {1}]", Name, Value);
81 |
82 | }
83 |
84 | ///
85 | /// Gets an XML representation of this object
86 | ///
87 | public string XML
88 | {
89 | get
90 | {
91 | return string.Format(CultureInfo.InvariantCulture.NumberFormat, "", Name, Value);
92 | }
93 | }
94 |
95 | ///
96 | /// Function to get a textual representation of this envelope
97 | ///
98 | /// A textual representation of this envelope
99 | public override string ToString()
100 | {
101 | return $"ProjectionParameter '{Name}': {Value}";
102 | }
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/ProjectionParameter.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8bb60057ca8ae2b448bdd4ae4350906b
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 066c1a827b150db45a03ec76089c08f7
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/AlbersProjection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3307504a8c49706408413e1debf5718f
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/CassiniSoldnerProjection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using ProjNet.CoordinateSystems.Transformations;
4 |
5 | namespace ProjNet.CoordinateSystems.Projections
6 | {
7 | internal class CassiniSoldnerProjection : MapProjection
8 | {
9 | // ReSharper disable InconsistentNaming
10 | private const double One6th = 0.16666666666666666666d; //C1
11 | private const double One120th = 0.00833333333333333333d; //C2
12 | private const double One24th = 0.04166666666666666666d; //C3
13 | private const double One3rd = 0.33333333333333333333d; //C4
14 | private const double One15th = 0.06666666666666666666d; //C5
15 | // ReSharper restore InconsistentNaming
16 |
17 | private readonly double _cFactor;
18 | private readonly double _m0;
19 | private readonly double _reciprocalSemiMajor;
20 |
21 | public CassiniSoldnerProjection(IEnumerable parameters) : this(parameters, null)
22 | {
23 | }
24 |
25 | public CassiniSoldnerProjection(IEnumerable parameters, CassiniSoldnerProjection inverse)
26 | : base(parameters, inverse)
27 | {
28 | Authority = "EPSG";
29 | AuthorityCode = 9806;
30 | Name = "Cassini_Soldner";
31 |
32 | _cFactor = _es / (1 - _es);
33 | _m0 = mlfn(lat_origin, Math.Sin(lat_origin), Math.Cos(lat_origin));
34 | _reciprocalSemiMajor = 1d / _semiMajor;
35 | }
36 |
37 | public override MathTransform Inverse()
38 | {
39 | if (_inverse == null)
40 | _inverse = new CassiniSoldnerProjection(_Parameters.ToProjectionParameter(), this);
41 | return _inverse;
42 | }
43 |
44 | //protected override double[] RadiansToMeters(double[] lonlat)
45 | //{
46 | // var lambda = lonlat[0] - central_meridian;
47 | // var phi = lonlat[1];
48 |
49 | // double sinPhi, cosPhi; // sin and cos value
50 | // sincos(phi, out sinPhi, out cosPhi);
51 |
52 | // var y = mlfn(phi, sinPhi, cosPhi);
53 | // var n = 1.0d / Math.Sqrt(1 - _es * sinPhi * sinPhi);
54 | // var tn = Math.Tan(phi);
55 | // var t = tn * tn;
56 | // var a1 = lambda * cosPhi;
57 | // var a2 = a1 * a1;
58 | // var c = _cFactor * Math.Pow(cosPhi, 2.0d);
59 |
60 | // var x = n * a1 * (1.0d - a2 * t * (One6th - (8.0d - t + 8.0d * c) * a2 * One120th));
61 | // y -= _m0 - n * tn * a2 * (0.5d + (5.0d - t + 6.0d * c) * a2 * One24th);
62 |
63 | // return lonlat.Length == 2
64 | // ? new[] {_semiMajor*x, _semiMajor*y}
65 | // : new[] {_semiMajor*x, _semiMajor*y, lonlat[2]};
66 | //}
67 |
68 | protected override void RadiansToMeters(ref double lon, ref double lat)
69 | {
70 | double lambda = lon - central_meridian;
71 | double phi = lat;
72 |
73 | double sinPhi, cosPhi; // sin and cos value
74 | sincos(phi, out sinPhi, out cosPhi);
75 |
76 | double y = mlfn(phi, sinPhi, cosPhi);
77 | double n = 1.0d / Math.Sqrt(1 - _es * sinPhi * sinPhi);
78 | double tn = Math.Tan(phi);
79 | double t = tn * tn;
80 | double a1 = lambda * cosPhi;
81 | double a2 = a1 * a1;
82 | double c = _cFactor * Math.Pow(cosPhi, 2.0d);
83 |
84 | double x = n * a1 * (1.0d - a2 * t * (One6th - (8.0d - t + 8.0d * c) * a2 * One120th));
85 | y -= _m0 - n * tn * a2 * (0.5d + (5.0d - t + 6.0d * c) * a2 * One24th);
86 |
87 | lon = x * _semiMajor;
88 | lat = y * _semiMajor;
89 | }
90 | //protected override double[] MetersToRadians(double[] p)
91 | //{
92 |
93 | // var x = p[0] * _reciprocalSemiMajor;
94 | // var y = p[1] * _reciprocalSemiMajor;
95 | // var phi1 = Phi1(_m0 + y);
96 |
97 | // var tn = Math.Tan(phi1);
98 | // var t = tn * tn;
99 | // var n = Math.Sin(phi1);
100 | // var r = 1.0d / (1.0d - _es * n * n);
101 | // n = Math.Sqrt(r);
102 | // r *= (1.0d - _es) * n;
103 | // var dd = x / n;
104 | // var d2 = dd * dd;
105 |
106 | // var phi = phi1 - (n * tn / r) * d2 * (.5 - (1.0 + 3.0 * t) * d2 * One24th);
107 | // var lambda = dd * (1.0 + t * d2 * (-One3rd + (1.0 + 3.0 * t) * d2 * One15th)) / Math.Cos(phi1);
108 | // lambda = adjust_lon(lambda + central_meridian);
109 |
110 | // return p.Length == 2
111 | // ? new[] {lambda, phi}
112 | // : new[] {lambda, phi, p[2]};
113 | //}
114 | protected override void MetersToRadians(ref double x, ref double y)
115 | {
116 | x *= _reciprocalSemiMajor;
117 | y *= _reciprocalSemiMajor;
118 | double phi1 = Phi1(_m0 + y);
119 |
120 | double tn = Math.Tan(phi1);
121 | double t = tn * tn;
122 | double n = Math.Sin(phi1);
123 | double r = 1.0d / (1.0d - _es * n * n);
124 | n = Math.Sqrt(r);
125 | r *= (1.0d - _es) * n;
126 | double dd = x / n;
127 | double d2 = dd * dd;
128 |
129 | y = phi1 - (n * tn / r) * d2 * (.5 - (1.0 + 3.0 * t) * d2 * One24th);
130 | double lambda = dd * (1.0 + t * d2 * (-One3rd + (1.0 + 3.0 * t) * d2 * One15th)) / Math.Cos(phi1);
131 | x = adjust_lon(lambda + central_meridian);
132 | }
133 |
134 | private double Phi1(double arg)
135 | {
136 | const int maxIter = 10;
137 | const double eps = 1e-11;
138 |
139 | double k = 1.0d / (1.0d - _es);
140 |
141 | double phi = arg;
142 | for (int i = maxIter; i > 0; --i)
143 | { // rarely goes over 2 iterations
144 | double sinPhi = Math.Sin(phi);
145 | double t = 1.0d - _es * sinPhi * sinPhi;
146 | t = (mlfn(phi, sinPhi, Math.Cos(phi)) - arg) * (t * Math.Sqrt(t)) * k;
147 | phi -= t;
148 | if (Math.Abs(t) < eps) return phi;
149 | }
150 | throw new ArgumentException("Convergence error.");
151 | }
152 |
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/CassiniSoldnerProjection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2cfd534707a337846be2dc0c410298cd
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/HotineObliqueMercatorProjection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 20d166465ecba734e83e859bc74729b0
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/KrovakProjection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 695154b44a056d2428c2fd4ed62b3f92
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/LambertAzimuthalEqualAreaProjection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0650c085ed438d34380c27ea4ea3b619
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/LambertConformalConic2SP.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b1f1da039cb4f354d874142b9c9b4935
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/MapProjection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1e710014abf1e2441beab11e9027a4dd
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/Mercator.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3be0deb876c619e4f8218fe07d88b5d1
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/ObliqueMercatorProjection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using ProjNet.CoordinateSystems.Transformations;
4 |
5 | namespace ProjNet.CoordinateSystems.Projections
6 | {
7 | [Serializable]
8 | internal class ObliqueMercatorProjection : HotineObliqueMercatorProjection
9 | {
10 | public ObliqueMercatorProjection(IEnumerable parameters)
11 | : this(parameters, null)
12 | {
13 | }
14 |
15 | public ObliqueMercatorProjection(IEnumerable parameters, ObliqueMercatorProjection inverse)
16 | : base(parameters, inverse)
17 | {
18 | AuthorityCode = 9815;
19 | Name = "Oblique_Mercator";
20 | }
21 |
22 | public override MathTransform Inverse()
23 | {
24 | if (_inverse == null)
25 | _inverse = new ObliqueMercatorProjection(_Parameters.ToProjectionParameter(), this);
26 | return _inverse;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/ObliqueMercatorProjection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5a5fc28ae09d24043b0fcd55aa858ebf
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/ObliqueStereographicProjection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4f8080be982c8c347b521d765c459679
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/PolyconicProjection.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * http://svn.osgeo.org/geotools/tags/2.6.2/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/Polyconic.java
3 | * http://svn.osgeo.org/geotools/tags/2.6.2/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/MapProjection.java
4 | */
5 | using System;
6 | using System.Collections.Generic;
7 | using ProjNet.CoordinateSystems.Transformations;
8 |
9 | namespace ProjNet.CoordinateSystems.Projections
10 | {
11 | ///
12 | ///
13 | ///
14 | [Serializable]
15 | internal class PolyconicProjection : MapProjection
16 | {
17 | ///
18 | /// Maximum difference allowed when comparing real numbers.
19 | ///
20 | private const double Epsilon = 1E-10;
21 |
22 | ///
23 | /// Maximum number of iterations for iterative computations.
24 | ///
25 | private const int MaximumIterations = 20;
26 |
27 | ///
28 | /// Difference allowed in iterative computations.
29 | ///
30 | private const double IterationTolerance = 1E-12;
31 |
32 | ///
33 | /// Meridian distance at the latitude of origin.
34 | /// Used for calculations for the ellipsoid.
35 | ///
36 | private readonly double _ml0;
37 |
38 | private readonly double _reciprocSemiMajorTimesScaleFactor;
39 |
40 | ///
41 | /// Constructs a new map projection from the supplied parameters.
42 | ///
43 | /// The parameter values in standard units
44 | public PolyconicProjection(IEnumerable parameters)
45 | : this(parameters, null)
46 | { }
47 |
48 | ///
49 | /// Constructs a new map projection from the supplied parameters.
50 | ///
51 | /// The parameter values in standard units
52 | /// Defines if Projection is inverse
53 | protected PolyconicProjection(IEnumerable parameters, PolyconicProjection inverse)
54 | : base(parameters, inverse)
55 | {
56 | Name = "Polyconic";
57 |
58 | _ml0 = mlfn(lat_origin, Math.Sin(lat_origin), Math.Cos(lat_origin));
59 | _reciprocSemiMajorTimesScaleFactor = 1 / (_semiMajor * scale_factor);
60 | }
61 |
62 | protected override void RadiansToMeters(ref double lon, ref double lat)
63 | {
64 | double lam = lon;
65 | double phi = lat;
66 |
67 | double delta_lam = adjust_lon(lam - central_meridian);
68 |
69 | double x, y;
70 |
71 | if (Math.Abs(phi) <= Epsilon)
72 | {
73 | x = delta_lam; //lam;
74 | y = -_ml0;
75 | }
76 | else
77 | {
78 | double sp = Math.Sin(phi);
79 | double cp;
80 | double ms = Math.Abs(cp = Math.Cos(phi)) > Epsilon ? msfn(sp, cp) / sp : 0.0;
81 | /*lam =*/
82 | delta_lam *= sp;
83 | x = ms * Math.Sin( /*lam*/delta_lam);
84 | y = (mlfn(phi, sp, cp) - _ml0) + ms * (1.0 - Math.Cos( /*lam*/delta_lam));
85 | }
86 |
87 | lon = scale_factor * _semiMajor * x;
88 | lat = scale_factor * _semiMajor * y;
89 | }
90 |
91 | protected override void MetersToRadians(ref double x, ref double y)
92 | {
93 | x *= _reciprocSemiMajorTimesScaleFactor;
94 | y *= _reciprocSemiMajorTimesScaleFactor;
95 |
96 | double lam, phi;
97 |
98 | y += _ml0;
99 | if (Math.Abs(y) <= Epsilon)
100 | {
101 | lam = x;
102 | phi = 0.0;
103 | }
104 | else
105 | {
106 | double r = y * y + x * x;
107 | phi = y;
108 | int iter = 0;
109 | for (; iter <= MaximumIterations; iter++)
110 | {
111 | double sp = Math.Sin(phi);
112 | double cp = Math.Cos(phi);
113 | if (Math.Abs(cp) < IterationTolerance)
114 | throw new Exception("No Convergence");
115 |
116 | double s2ph = sp * cp;
117 | double mlp = Math.Sqrt(1.0 - _es * sp * sp);
118 | double c = sp * mlp / cp;
119 | double ml = mlfn(phi, sp, cp);
120 | double mlb = ml * ml + r;
121 | mlp = (1.0 - _es) / (mlp * mlp * mlp);
122 | double dPhi = (ml + ml + c * mlb - 2.0 * y * (c * ml + 1.0)) / (
123 | _es * s2ph * (mlb - 2.0 * y * ml) / c +
124 | 2.0 * (y - ml) * (c * mlp - 1.0 / s2ph) - mlp - mlp);
125 | if (Math.Abs(dPhi) <= IterationTolerance)
126 | break;
127 |
128 | phi += dPhi;
129 | }
130 |
131 | if (iter > MaximumIterations)
132 | throw new Exception("No Convergence");
133 | double c2 = Math.Sin(phi);
134 | lam = Math.Asin(x * Math.Tan(phi) * Math.Sqrt(1.0 - _es * c2 * c2)) / Math.Sin(phi);
135 | }
136 |
137 | x = adjust_lon(lam + central_meridian);
138 | y = phi;
139 | }
140 |
141 | ///
142 | /// Returns the inverse of this projection.
143 | ///
144 | /// IMathTransform that is the reverse of the current projection.
145 | public override MathTransform Inverse()
146 | {
147 | if (_inverse == null)
148 | _inverse = new PolyconicProjection(_Parameters.ToProjectionParameter(), this);
149 | return _inverse;
150 | }
151 |
152 | #region Private helpers
153 | ///
154 | /// Computes function f(s,c,e²) = c/sqrt(1 - s²*e²)
needed for the true scale
155 | /// latitude (Snyder 14-15), where s and c are the sine and cosine of
156 | /// the true scale latitude, and e² is the eccentricity squared.
157 | ///
158 | double msfn(double s, double c)
159 | {
160 | return c / Math.Sqrt(1.0 - (s * s) * _es);
161 | }
162 |
163 | #endregion
164 |
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/PolyconicProjection.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0fd91d7846d53b84a84483b3cab4f846
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/ProjectionParameterSet.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4bf4f05fa7ed7044c9ae559ad471840e
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/ProjectionsRegistry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Reflection;
4 | using ProjNet.CoordinateSystems.Transformations;
5 |
6 | namespace ProjNet.CoordinateSystems.Projections
7 | {
8 | ///
9 | /// Registry class for all known s.
10 | ///
11 | public class ProjectionsRegistry
12 | {
13 | private static readonly Dictionary TypeRegistry = new Dictionary();
14 | private static readonly Dictionary ConstructorRegistry = new Dictionary();
15 |
16 | private static readonly object RegistryLock = new object();
17 |
18 | ///
19 | /// Static constructor
20 | ///
21 | static ProjectionsRegistry()
22 | {
23 | Register("mercator", typeof(Mercator));
24 | Register("mercator_1sp", typeof (Mercator));
25 | Register("mercator_2sp", typeof (Mercator));
26 | Register("pseudo-mercator", typeof(PseudoMercator));
27 | Register("popular_visualisation pseudo-mercator", typeof(PseudoMercator));
28 | Register("google_mercator", typeof(PseudoMercator));
29 |
30 | Register("transverse_mercator", typeof(TransverseMercator));
31 | Register("gauss_kruger", typeof(TransverseMercator));
32 |
33 | Register("albers", typeof(AlbersProjection));
34 | Register("albers_conic_equal_area", typeof(AlbersProjection));
35 |
36 | Register("krovak", typeof(KrovakProjection));
37 |
38 | Register("polyconic", typeof(PolyconicProjection));
39 |
40 | Register("lambert_conformal_conic", typeof(LambertConformalConic2SP));
41 | Register("lambert_conformal_conic_2sp", typeof(LambertConformalConic2SP));
42 | Register("lambert_conic_conformal_(2sp)", typeof(LambertConformalConic2SP));
43 |
44 | Register("lambert_azimuthal_equal_area", typeof(LambertAzimuthalEqualAreaProjection));
45 |
46 | Register("cassini_soldner", typeof(CassiniSoldnerProjection));
47 | Register("hotine_oblique_mercator", typeof(HotineObliqueMercatorProjection));
48 | Register("hotine_oblique_mercator_azimuth_center", typeof(HotineObliqueMercatorProjection));
49 | Register("oblique_mercator", typeof(ObliqueMercatorProjection));
50 | Register("oblique_stereographic", typeof(ObliqueStereographicProjection));
51 | }
52 |
53 | ///
54 | /// Method to register a new Map
55 | ///
56 | ///
57 | ///
58 | public static void Register(string name, Type type)
59 | {
60 | if (string.IsNullOrWhiteSpace(name))
61 | throw new ArgumentNullException(nameof(name));
62 |
63 | if (type == null)
64 | throw new ArgumentNullException(nameof(type));
65 |
66 | if (!typeof(MathTransform).IsAssignableFrom(type))
67 | throw new ArgumentException("The provided type does not implement 'GeoAPI.CoordinateSystems.Transformations.IMathTransform'!", nameof(type));
68 |
69 | var ci = CheckConstructor(type);
70 | if (ci == null)
71 | throw new ArgumentException("The provided type is lacking a suitable constructor", nameof(type));
72 |
73 | string key = ProjectionNameToRegistryKey(name);
74 | lock (RegistryLock)
75 | {
76 | if (TypeRegistry.ContainsKey(key))
77 | {
78 | var rt = TypeRegistry[key];
79 | if (ReferenceEquals(type, rt))
80 | return;
81 | throw new ArgumentException("A different projection type has been registered with this name", "name");
82 | }
83 |
84 | TypeRegistry.Add(key, type);
85 | ConstructorRegistry.Add(key, ci);
86 | }
87 | }
88 |
89 | private static string ProjectionNameToRegistryKey(string name)
90 | {
91 | return name.ToLowerInvariant().Replace(' ', '_');
92 | }
93 |
94 | ///
95 | /// Register an alias for an existing Map.
96 | ///
97 | ///
98 | ///
99 | public static void RegisterAlias(string aliasName, string existingName)
100 | {
101 | lock (RegistryLock)
102 | {
103 | if (!TypeRegistry.TryGetValue(ProjectionNameToRegistryKey(existingName), out var existingProjectionType))
104 | {
105 | throw new ArgumentException($"{existingName} is not a registered projection type");
106 | }
107 |
108 | Register(aliasName, existingProjectionType);
109 | }
110 | }
111 |
112 | private static Type CheckConstructor(Type type)
113 | {
114 | // find a constructor that accepts exactly one parameter that's an
115 | // instance of List, and then return the exact
116 | // parameter type so that we can create instances of this type with
117 | // minimal copying in the future, when possible.
118 | foreach (var c in type.GetConstructors())
119 | {
120 | var parameters = c.GetParameters();
121 | if (parameters.Length == 1 && parameters[0].ParameterType.IsAssignableFrom(typeof(List)))
122 | {
123 | return parameters[0].ParameterType;
124 | }
125 | }
126 |
127 | return null;
128 | }
129 |
130 | internal static MathTransform CreateProjection(string className, IEnumerable parameters)
131 | {
132 | string key = ProjectionNameToRegistryKey(className);
133 |
134 | Type projectionType;
135 | Type ci;
136 |
137 | lock (RegistryLock)
138 | {
139 | if (!TypeRegistry.TryGetValue(key, out projectionType))
140 | throw new NotSupportedException($"Projection {className} is not supported.");
141 | ci = ConstructorRegistry[key];
142 | }
143 |
144 | if (!ci.IsInstanceOfType(parameters))
145 | {
146 | parameters = new List(parameters);
147 | }
148 |
149 | var res = (MapProjection)Activator.CreateInstance(projectionType, parameters);
150 | if (!res.Name.Equals(className, StringComparison.InvariantCultureIgnoreCase))
151 | {
152 | res.Alias = res.Name;
153 | res.Name = className;
154 | }
155 | return res;
156 | }
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/ProjectionsRegistry.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6e524717a6c40e3499c0071b32bd57e9
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/PseudoMercator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using ProjNet.CoordinateSystems.Transformations;
4 |
5 | namespace ProjNet.CoordinateSystems.Projections
6 | {
7 | [Serializable]
8 | internal class PseudoMercator : Mercator
9 | {
10 | public PseudoMercator(IEnumerable parameters)
11 | :this(parameters, null)
12 | {
13 |
14 | }
15 | protected PseudoMercator(IEnumerable parameters, Mercator inverse)
16 | :base(VerifyParameters(parameters), inverse)
17 | {
18 | Name = "Pseudo-Mercator";
19 | Authority = "EPSG";
20 | AuthorityCode = 3856;
21 | }
22 |
23 | private static IEnumerable VerifyParameters(IEnumerable parameters)
24 | {
25 | var p = new ProjectionParameterSet(parameters);
26 | double semi_major = p.GetParameterValue("semi_major");
27 | p.SetParameterValue("semi_minor", semi_major);
28 | p.SetParameterValue("scale_factor", 1);
29 |
30 | return p.ToProjectionParameter();
31 | }
32 |
33 | public override MathTransform Inverse()
34 | {
35 | if (_inverse == null)
36 | _inverse = new PseudoMercator(_Parameters.ToProjectionParameter(), this);
37 | return _inverse;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/PseudoMercator.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 649a275ffa8057c41b470f9cfd803e4c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Projections/TransverseMercator.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2f45248ae7063e543bddbd266d125d67
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ced52b41a19040e4d94701a0103bc1f5
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/AffineTransform.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9059d7458fe355c4d9a352f476fc2192
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/ConcatenatedTransform.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Collections.Generic;
20 | using System.Linq;
21 |
22 | namespace ProjNet.CoordinateSystems.Transformations
23 | {
24 | ///
25 | ///
26 | ///
27 | [Serializable]
28 | internal class ConcatenatedTransform : MathTransform, ICoordinateTransformationCore
29 | {
30 | ///
31 | ///
32 | ///
33 | private MathTransform _inverse;
34 | private readonly List _coordinateTransformationList;
35 |
36 | ///
37 | ///
38 | ///
39 | public ConcatenatedTransform()
40 | { _coordinateTransformationList = new List();}
41 |
42 | ///
43 | ///
44 | ///
45 | ///
46 | public ConcatenatedTransform(IEnumerable transformList)
47 | : this()
48 | {
49 | _coordinateTransformationList.AddRange(transformList);
50 | }
51 |
52 |
53 | ///
54 | ///
55 | ///
56 | public IList CoordinateTransformationList
57 | {
58 | get { return _coordinateTransformationList; }
59 | /*
60 | set
61 | {
62 | _coordinateTransformationList = value;
63 | _inverse = null;
64 | }
65 | */
66 | }
67 |
68 |
69 |
70 | public override int DimSource
71 | {
72 | get { return (_coordinateTransformationList[0]).SourceCS.Dimension; }
73 | }
74 |
75 | public override int DimTarget
76 | {
77 | get { return _coordinateTransformationList[_coordinateTransformationList.Count-1].TargetCS.Dimension; }
78 | }
79 |
80 |
81 | ///
82 | public override void Transform(ref double x, ref double y, ref double z)
83 | {
84 | foreach (var ctc in _coordinateTransformationList)
85 | {
86 | if (ctc is CoordinateTransformation ct)
87 | ct.MathTransform.Transform(ref x, ref y, ref z);
88 | else if (ctc is ConcatenatedTransform cct)
89 | cct.Transform(ref x, ref y, ref z);
90 | }
91 | }
92 |
93 | ///
94 | /// Returns the inverse of this conversion.
95 | ///
96 | /// IMathTransform that is the reverse of the current conversion.
97 | public override MathTransform Inverse()
98 | {
99 | if (_inverse == null)
100 | {
101 | _inverse = Clone();
102 | _inverse.Invert();
103 | }
104 | return _inverse;
105 | }
106 |
107 | ///
108 | /// Reverses the transformation
109 | ///
110 | public override void Invert()
111 | {
112 | _coordinateTransformationList.Reverse();
113 | foreach (var ic in _coordinateTransformationList)
114 | {
115 | if (ic is CoordinateTransformation ct)
116 | ct.MathTransform.Invert();
117 | else if (ic is ConcatenatedTransform cct)
118 | cct.Invert();
119 | }
120 | }
121 |
122 | public ConcatenatedTransform Clone()
123 | {
124 | var clonedList = new List(_coordinateTransformationList.Count);
125 | foreach (var ct in _coordinateTransformationList)
126 | clonedList.Add(CloneCoordinateTransformation(ct));
127 | return new ConcatenatedTransform(clonedList);
128 | }
129 |
130 | private static readonly CoordinateTransformationFactory CoordinateTransformationFactory =
131 | new CoordinateTransformationFactory();
132 |
133 | private static ICoordinateTransformationCore CloneCoordinateTransformation(ICoordinateTransformationCore ict)
134 | {
135 | return CoordinateTransformationFactory.CreateFromCoordinateSystems(ict.SourceCS, ict.TargetCS);
136 | }
137 |
138 | ///
139 | /// Gets a Well-Known text representation of this object.
140 | ///
141 | ///
142 | public override string WKT
143 | {
144 | get { throw new NotImplementedException(); }
145 | }
146 |
147 | ///
148 | /// Gets an XML representation of this object.
149 | ///
150 | ///
151 | public override string XML
152 | {
153 | get { throw new NotImplementedException(); }
154 | }
155 |
156 | public CoordinateSystem SourceCS { get => CoordinateTransformationList[0].SourceCS; }
157 |
158 | public CoordinateSystem TargetCS { get => CoordinateTransformationList[CoordinateTransformationList.Count-1].TargetCS; }
159 | }
160 | }
161 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/ConcatenatedTransform.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6ab4687fe1d192e41860341097dea077
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/CoordinateTransformation.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Postert/ProjNet4GeoAPI-For-Unity/e033ddc108295c69af88effebae59370c0ba4001/Runtime/ProjNet/CoordinateSystems/Transformations/CoordinateTransformation.cs
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/CoordinateTransformation.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d7b90d71b83912046b214dac81f7f1c6
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/CoordinateTransformationFactory.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6f0bf936858d27b409244a3a339e5303
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/DatumTransform.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 |
20 | namespace ProjNet.CoordinateSystems.Transformations
21 | {
22 | ///
23 | /// Transformation for applying
24 | ///
25 | [Serializable]
26 | internal class DatumTransform : MathTransform
27 | {
28 | private MathTransform _inverse;
29 | private readonly Wgs84ConversionInfo _toWgs94;
30 | readonly double[] _v;
31 |
32 | private bool _isInverse;
33 |
34 | ///
35 | /// Initializes a new instance of the class.
36 | ///
37 | ///
38 | public DatumTransform(Wgs84ConversionInfo towgs84) : this(towgs84,false)
39 | {
40 | }
41 |
42 | private DatumTransform(Wgs84ConversionInfo towgs84, bool isInverse)
43 | {
44 | _toWgs94 = towgs84;
45 | _v = _toWgs94.GetAffineTransform();
46 | _isInverse = isInverse;
47 | }
48 | ///
49 | /// Gets a Well-Known text representation of this object.
50 | ///
51 | ///
52 | public override string WKT
53 | {
54 | get { throw new NotImplementedException(); }
55 | }
56 |
57 | ///
58 | /// Gets an XML representation of this object.
59 | ///
60 | ///
61 | public override string XML
62 | {
63 | get { throw new NotImplementedException(); }
64 | }
65 |
66 | public override int DimSource
67 | {
68 | get { return 3; }
69 | }
70 |
71 | public override int DimTarget
72 | {
73 | get { return 3; }
74 | }
75 |
76 | ///
77 | /// Creates the inverse transform of this object.
78 | ///
79 | ///
80 | /// This method may fail if the transform is not one to one. However, all cartographic projections should succeed.
81 | public override MathTransform Inverse()
82 | {
83 | if (_inverse == null)
84 | _inverse = new DatumTransform(_toWgs94,!_isInverse);
85 | return _inverse;
86 | }
87 |
88 |
89 | ///
90 | public sealed override void Transform(ref double x, ref double y, ref double z)
91 | {
92 | if (_isInverse)
93 | {
94 | (x, y, z) = ApplyInverted(x, y, z);
95 | }
96 | else
97 | {
98 | (x, y, z) = Apply(x, y, z);
99 | }
100 | }
101 |
102 | private (double x, double y, double z) Apply(double x, double y, double z)
103 | {
104 | return (
105 | x: _v[0] * (x - _v[3] * y + _v[2] * z) + _v[4],
106 | y: _v[0] * (_v[3] * x + y - _v[1] * z) + _v[5],
107 | z: _v[0] * (-_v[2] * x + _v[1] * y + z) + _v[6]);
108 | }
109 |
110 | private (double x, double y, double z) ApplyInverted(double x, double y, double z)
111 | {
112 | return (
113 | x: (1 - (_v[0] - 1)) * (x + _v[3] * y - _v[2] * z) - _v[4],
114 | y: (1 - (_v[0] - 1)) * (-_v[3] * x + y + _v[1] * z) - _v[5],
115 | z: (1 - (_v[0] - 1)) * (_v[2] * x - _v[1] * y + z) - _v[6]);
116 | }
117 |
118 | ///
119 | /// Reverses the transformation
120 | ///
121 | public override void Invert()
122 | {
123 | _isInverse = !_isInverse;
124 | }
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/DatumTransform.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8c4fe5373311ad944b32ad50675bda10
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/DomainFlags.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | namespace ProjNet.CoordinateSystems.Transformations
19 | {
20 | ///
21 | /// Flags indicating parts of domain covered by a convex hull.
22 | ///
23 | ///
24 | /// These flags can be combined. For example, the value 3
25 | /// corresponds to a combination of and ,
26 | /// which means that some parts of the convex hull are inside the
27 | /// domain, and some parts of the convex hull are outside the domain.
28 | ///
29 | public enum DomainFlags : int
30 | {
31 | ///
32 | /// At least one point in a convex hull is inside the transform's domain.
33 | ///
34 | Inside = 1,
35 |
36 | ///
37 | /// At least one point in a convex hull is outside the transform's domain.
38 | ///
39 | Outside = 2,
40 |
41 | ///
42 | /// At least one point in a convex hull is not transformed continuously.
43 | ///
44 | ///
45 | /// As an example, consider a "Longitude_Rotation" transform which adjusts
46 | /// longitude coordinates to take account of a change in Prime Meridian. If
47 | /// the rotation is 5 degrees east, then the point (Lat=175,Lon=0) is not
48 | /// transformed continuously, since it is on the meridian line which will
49 | /// be split at +180/-180 degrees.
50 | ///
51 | Discontinuous = 4
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/DomainFlags.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7166837187023a348bcd00557b193124
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/GeocentricTransform.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f4acc5de913d8324b970abeb7d2841bf
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/GeographicTransform.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 |
20 | namespace ProjNet.CoordinateSystems.Transformations
21 | {
22 | ///
23 | /// The GeographicTransform class is implemented on geographic transformation objects and
24 | /// implements datum transformations between geographic coordinate systems.
25 | ///
26 | [Serializable]
27 | public class GeographicTransform : MathTransform
28 | {
29 | internal GeographicTransform(GeographicCoordinateSystem sourceGCS, GeographicCoordinateSystem targetGCS)
30 | {
31 | SourceGCS = sourceGCS;
32 | TargetGCS = targetGCS;
33 | }
34 |
35 | ///
36 | /// Gets or sets the source geographic coordinate system for the transformation.
37 | ///
38 | public GeographicCoordinateSystem SourceGCS { get; set; }
39 |
40 | ///
41 | /// Gets or sets the target geographic coordinate system for the transformation.
42 | ///
43 | public GeographicCoordinateSystem TargetGCS { get; set; }
44 |
45 | ///
46 | /// Returns the Well-known text for this object
47 | /// as defined in the simple features specification. [NOT IMPLEMENTED].
48 | ///
49 | public override string WKT
50 | {
51 | get
52 | {
53 | throw new NotImplementedException();
54 | }
55 | }
56 |
57 | ///
58 | /// Gets an XML representation of this object [NOT IMPLEMENTED].
59 | ///
60 | public override string XML
61 | {
62 | get
63 | {
64 | throw new NotImplementedException();
65 | }
66 | }
67 |
68 | public override int DimSource
69 | {
70 | get { return SourceGCS.Dimension; }
71 | }
72 |
73 | public override int DimTarget
74 | {
75 | get { return TargetGCS.Dimension; }
76 | }
77 |
78 | ///
79 | /// Creates the inverse transform of this object.
80 | ///
81 | /// This method may fail if the transform is not one to one. However, all cartographic projections should succeed.
82 | ///
83 | public override MathTransform Inverse()
84 | {
85 | throw new NotImplementedException();
86 | }
87 |
88 | ///
89 | public sealed override void Transform(ref double x, ref double y, ref double z)
90 | {
91 | x /= SourceGCS.AngularUnit.RadiansPerUnit;
92 | x -= SourceGCS.PrimeMeridian.Longitude / SourceGCS.PrimeMeridian.AngularUnit.RadiansPerUnit;
93 | x += TargetGCS.PrimeMeridian.Longitude / TargetGCS.PrimeMeridian.AngularUnit.RadiansPerUnit;
94 | x *= SourceGCS.AngularUnit.RadiansPerUnit;
95 | }
96 |
97 | ///
98 | /// Reverses the transformation
99 | ///
100 | public override void Invert()
101 | {
102 | throw new NotImplementedException();
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/GeographicTransform.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9de18fe9caf46eb4eb01f00f5a293c95
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/ICoordinateTransformation.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | namespace ProjNet.CoordinateSystems.Transformations
19 | {
20 | ///
21 | /// Describes core information of a coordinate transformation
22 | ///
23 | public interface ICoordinateTransformationCore
24 | {
25 |
26 | ///
27 | /// Source coordinate system.
28 | ///
29 | CoordinateSystem SourceCS { get; }
30 |
31 | ///
32 | /// Target coordinate system.
33 | ///
34 | CoordinateSystem TargetCS { get; }
35 | }
36 |
37 | ///
38 | /// Describes a coordinate transformation. This interface only describes a
39 | /// coordinate transformation, it does not actually perform the transform
40 | /// operation on points. To transform points you must use a math transform.
41 | ///
42 | public interface ICoordinateTransformation : ICoordinateTransformationCore
43 | {
44 | ///
45 | /// Human readable description of domain in source coordinate system.
46 | ///
47 | string AreaOfUse { get; }
48 |
49 | ///
50 | /// Authority which defined transformation and parameter values.
51 | ///
52 | ///
53 | /// An Authority is an organization that maintains definitions of Authority Codes. For example the European Petroleum Survey Group (EPSG) maintains a database of coordinate systems, and other spatial referencing objects, where each object has a code number ID. For example, the EPSG code for a WGS84 Lat/Lon coordinate system is �4326�
54 | ///
55 | string Authority { get; }
56 |
57 | ///
58 | /// Code used by authority to identify transformation. An empty string is used for no code.
59 | ///
60 | /// The AuthorityCode is a compact string defined by an Authority to reference a particular spatial reference object. For example, the European Survey Group (EPSG) authority uses 32 bit integers to reference coordinate systems, so all their code strings will consist of a few digits. The EPSG code for WGS84 Lat/Lon is �4326�.
61 | long AuthorityCode { get; }
62 |
63 | ///
64 | /// Name of transformation.
65 | ///
66 | string Name { get; }
67 |
68 | ///
69 | /// Gets the provider-supplied remarks.
70 | ///
71 | string Remarks { get; }
72 |
73 | ///
74 | /// Gets math transform.
75 | ///
76 | MathTransform MathTransform { get; }
77 |
78 | ///
79 | /// Semantic type of transform. For example, a datum transformation or a coordinate conversion.
80 | ///
81 | TransformType TransformType { get; }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/ICoordinateTransformation.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0f2e309e1e37ab44a8dc0e28436a1e28
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/MathTransform.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6775fdfa3e9cdb44d8bc73334bcb9386
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/PrimeMeridianTransform.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 |
20 | namespace ProjNet.CoordinateSystems.Transformations
21 | {
22 |
23 | ///
24 | /// Adjusts target Prime Meridian
25 | ///
26 | [Serializable]
27 | internal class PrimeMeridianTransform : MathTransform
28 | {
29 | #region class variables
30 |
31 | private bool _isInverted;
32 | private readonly PrimeMeridian _source;
33 | private readonly PrimeMeridian _target;
34 | #endregion class variables
35 |
36 | #region constructors & finalizers
37 | ///
38 | /// Creates instance prime meridian transform
39 | ///
40 | ///
41 | ///
42 | public PrimeMeridianTransform(PrimeMeridian source, PrimeMeridian target)
43 | {
44 | if (!source.AngularUnit.EqualParams(target.AngularUnit))
45 | {
46 | throw new NotImplementedException("The method or operation is not implemented.");
47 | }
48 | _source = source;
49 | _target = target;
50 | }
51 |
52 |
53 | #endregion constructors & finalizers
54 |
55 | #region public properties
56 | ///
57 | /// Gets a Well-Known text representation of this affine math transformation.
58 | ///
59 | ///
60 | public override string WKT
61 | {
62 | get { throw new NotImplementedException("The method or operation is not implemented."); }
63 | }
64 | ///
65 | /// Gets an XML representation of this affine transformation.
66 | ///
67 | ///
68 | public override string XML
69 | {
70 | get { throw new NotImplementedException("The method or operation is not implemented."); }
71 | }
72 |
73 | ///
74 | /// Gets the dimension of input points.
75 | ///
76 | public override int DimSource { get { return 3; } }
77 |
78 | ///
79 | /// Gets the dimension of output points.
80 | ///
81 | public override int DimTarget { get { return 3; } }
82 | #endregion public properties
83 |
84 | #region public methods
85 |
86 | ///
87 | public override MathTransform Inverse()
88 | {
89 | return new PrimeMeridianTransform(_target, _source);
90 | }
91 |
92 | ///
93 | public sealed override void Transform(ref double x, ref double y, ref double z)
94 | {
95 | if (_isInverted)
96 | x += _target.Longitude - _source.Longitude;
97 | else
98 | x += _source.Longitude - _target.Longitude;
99 | }
100 |
101 | ///
102 | protected sealed override void TransformCore(Span xs, Span ys, Span zs,
103 | int strideX, int strideY, int strideZ)
104 | {
105 | double addend = _isInverted
106 | ? _target.Longitude - _source.Longitude
107 | : _source.Longitude - _target.Longitude;
108 | AddInPlace(xs, strideX, addend);
109 | }
110 |
111 | ///
112 | public override void Invert()
113 | {
114 | _isInverted = !_isInverted;
115 | }
116 |
117 | #endregion public methods
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/PrimeMeridianTransform.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1db08f35a04d7f64aad00f1bf8a9fa07
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/TransformType.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
2 | //
3 | // This file is part of SharpMap.
4 | // SharpMap is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // SharpMap is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with SharpMap; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | namespace ProjNet.CoordinateSystems.Transformations
19 | {
20 | ///
21 | /// Semantic type of transform used in coordinate transformation.
22 | ///
23 | public enum TransformType : int
24 | {
25 | ///
26 | /// Unknown or unspecified type of transform.
27 | ///
28 | Other = 0,
29 |
30 | ///
31 | /// Transform depends only on defined parameters. For example, a cartographic projection.
32 | ///
33 | Conversion = 1,
34 |
35 | ///
36 | /// Transform depends only on empirically derived parameters. For example a datum transformation.
37 | ///
38 | Transformation = 2,
39 |
40 | ///
41 | /// Transform depends on both defined and empirical parameters.
42 | ///
43 | ConversionAndTransformation = 3
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Transformations/TransformType.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4988f1fbc8b00f246b09e2c0a41d8b6d
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Unit.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | using System;
19 | using System.Globalization;
20 | using System.Text;
21 |
22 | namespace ProjNet.CoordinateSystems
23 | {
24 | ///
25 | /// Class for defining units
26 | ///
27 | [Serializable]
28 | public class Unit : Info, IUnit
29 | {
30 | ///
31 | /// Initializes a new unit
32 | ///
33 | /// Conversion factor to base unit
34 | /// Name of unit
35 | /// Authority name
36 | /// Authority-specific identification code.
37 | /// Alias
38 | /// Abbreviation
39 | /// Provider-supplied remarks
40 | internal Unit(double conversionFactor, string name, string authority, long authorityCode, string alias, string abbreviation, string remarks)
41 | :
42 | base(name, authority, authorityCode, alias, abbreviation, remarks)
43 | {
44 | ConversionFactor = conversionFactor;
45 | }
46 |
47 | ///
48 | /// Initializes a new unit
49 | ///
50 | /// Name of unit
51 | /// Conversion factor to base unit
52 | internal Unit(string name, double conversionFactor)
53 | : this(conversionFactor, name, string.Empty, -1, string.Empty, string.Empty, string.Empty)
54 | {
55 | }
56 |
57 | ///
58 | /// Gets or sets the number of units per base-unit.
59 | ///
60 | public double ConversionFactor { get; set; }
61 |
62 | ///
63 | /// Returns the Well-known text for this object
64 | /// as defined in the simple features specification.
65 | ///
66 | public override string WKT
67 | {
68 | get
69 | {
70 | var sb = new StringBuilder();
71 | sb.AppendFormat(CultureInfo.InvariantCulture.NumberFormat, "UNIT[\"{0}\", {1}", Name, ConversionFactor);
72 | if (!string.IsNullOrWhiteSpace(Authority) && AuthorityCode > 0)
73 | sb.AppendFormat(", AUTHORITY[\"{0}\", \"{1}\"]", Authority, AuthorityCode);
74 | sb.Append("]");
75 | return sb.ToString();
76 | }
77 | }
78 |
79 | ///
80 | /// Gets an XML representation of this object [NOT IMPLEMENTED].
81 | ///
82 | public override string XML
83 | {
84 | get
85 | {
86 | throw new NotImplementedException();
87 | }
88 | }
89 |
90 | ///
91 | /// Checks whether the values of this instance is equal to the values of another instance.
92 | /// Only parameters used for coordinate system are used for comparison.
93 | /// Name, abbreviation, authority, alias and remarks are ignored in the comparison.
94 | ///
95 | ///
96 | /// True if equal
97 | public override bool EqualParams(object obj)
98 | {
99 | if (!(obj is Unit))
100 | return false;
101 | return (obj as Unit).ConversionFactor == ConversionFactor;
102 | }
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/Unit.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bef4097394c7b0d478d3436625267f34
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/CoordinateSystems/WGS84ConversionInfo.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 33a930bdbc9d2354fba9904f479271ab
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/Geometries.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5469859e19177d34b953d4308dfd7303
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/Geometries/XY.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace ProjNet.Geometries
5 | {
6 | ///
7 | /// A pair of X- and Y-ordinates, laid out in that order.
8 | ///
9 | [StructLayout(LayoutKind.Sequential)]
10 | public struct XY : IEquatable
11 | {
12 | ///
13 | /// The x-ordinate value
14 | ///
15 | public double X;
16 |
17 | ///
18 | /// The y-ordinate value
19 | ///
20 | public double Y;
21 |
22 | ///
23 | /// Initializes a new instance of the struct.
24 | ///
25 | /// The value for .
26 | /// The value for .
27 | public XY(double x, double y) =>
28 | (X, Y) = (x, y);
29 |
30 | ///
31 | public override bool Equals(object obj) => obj is XY other && Equals(other);
32 |
33 | ///
34 | public bool Equals(XY other) => (X, Y).Equals((other.X, other.Y));
35 |
36 | ///
37 | public override int GetHashCode() => (X, Y).GetHashCode();
38 |
39 | ///
40 | public override string ToString() => $"({X}, {Y})";
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/Geometries/XY.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: db6fcc577abcc3a43907c5906fd4b204
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/Geometries/XYZ.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace ProjNet.Geometries
5 | {
6 | ///
7 | /// A tuple of X-, Y- and Z-ordinate values, laid out in that order.
8 | ///
9 | [StructLayout(LayoutKind.Sequential)]
10 | public struct XYZ : IEquatable
11 | {
12 | ///
13 | /// The X-ordinate value
14 | ///
15 | public double X;
16 |
17 | ///
18 | /// The Y-ordinate value
19 | ///
20 | public double Y;
21 |
22 | ///
23 | /// The Z-ordinate value
24 | ///
25 | public double Z;
26 |
27 | ///
28 | /// Initializes a new instance of the struct.
29 | ///
30 | /// The value for .
31 | /// The value for .
32 | /// The value for .
33 | public XYZ(double x, double y, double z) =>
34 | (X, Y, Z) = (x, y, z);
35 |
36 | ///
37 | public override bool Equals(object obj) => obj is XYZ other && Equals(other);
38 |
39 | ///
40 | public bool Equals(XYZ other) => (X, Y, Z).Equals((other.X, other.Y, other.Z));
41 |
42 | ///
43 | public override int GetHashCode() => (X, Y, Z).GetHashCode();
44 |
45 | ///
46 | public override string ToString() => $"({X}, {Y}, {Z})";
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/Geometries/XYZ.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fa02e584494125e48a8f396a70fe5b1d
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/IO.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7f72a2cc803c32d469a17d51fc898540
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/IO/CoordinateSystems.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5ddb868ac0f6f0247bcbaba6a29b405a
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/IO/CoordinateSystems/CoordinateSystemWktReader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 15fd5821e69581749a4637c93dee2c03
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/IO/CoordinateSystems/MathTransformWktReader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 051b9f17dcc0f084eb842e08d1e6b20a
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/IO/CoordinateSystems/StreamTokenizer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 49749cffb346c064eb986763dd4665c5
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/IO/CoordinateSystems/TokenType.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005 - 2009 - Morten Nielsen (www.sharpgis.net)
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | // SOURCECODE IS MODIFIED FROM ANOTHER WORK AND IS ORIGINALLY BASED ON GeoTools.NET:
19 | /*
20 | * Copyright (C) 2002 Urban Science Applications, Inc.
21 | *
22 | * This library is free software; you can redistribute it and/or
23 | * modify it under the terms of the GNU Lesser General Public
24 | * License as published by the Free Software Foundation; either
25 | * version 2.1 of the License, or (at your option) any later version.
26 | *
27 | * This library is distributed in the hope that it will be useful,
28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30 | * Lesser General Public License for more details.
31 | *
32 | * You should have received a copy of the GNU Lesser General Public
33 | * License along with this library; if not, write to the Free Software
34 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35 | *
36 | */
37 |
38 | #region Using
39 |
40 |
41 |
42 | #endregion
43 |
44 | namespace ProjNet.IO.CoordinateSystems
45 | {
46 | ///
47 | /// Represents the type of token created by the StreamTokenizer class.
48 | ///
49 | internal enum TokenType
50 | {
51 | ///
52 | /// Indicates that the token is a word.
53 | ///
54 | Word,
55 | ///
56 | /// Indicates that the token is a number.
57 | ///
58 | Number,
59 | ///
60 | /// Indicates that the end of line has been read. The field can only have this value if the eolIsSignificant method has been called with the argument true.
61 | ///
62 | Eol,
63 | ///
64 | /// Indicates that the end of the input stream has been reached.
65 | ///
66 | Eof,
67 | ///
68 | /// Indictaes that the token is white space (space, tab, newline).
69 | ///
70 | Whitespace,
71 | ///
72 | /// Characters that are not whitespace, numbers, etc...
73 | ///
74 | Symbol
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/IO/CoordinateSystems/TokenType.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 80c2ac1cfe99af946bf180f89c9e3bdf
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/IO/CoordinateSystems/WKTStreamTokenizer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4a8f4b50e983d3349b5833efe1a0603e
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/IO/CoordinateSystems/WktBracket.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 - NetTopologySuite - Team
2 | //
3 | // This file is part of ProjNet.
4 | // ProjNet is free software; you can redistribute it and/or modify
5 | // it under the terms of the GNU Lesser General Public License as published by
6 | // the Free Software Foundation; either version 2 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // ProjNet is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Lesser General Public License for more details.
13 |
14 | // You should have received a copy of the GNU Lesser General Public License
15 | // along with ProjNet; if not, write to the Free Software
16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | namespace ProjNet.IO.CoordinateSystems
19 | {
20 | ///
21 | /// An enumeration of possible bracket types
22 | ///
23 | internal enum WktBracket
24 | {
25 | ///
26 | /// Bracket type not specified.
27 | ///
28 | DontCare,
29 | ///
30 | /// Opener "(", closer ")"
31 | ///
32 | Round,
33 | ///
34 | /// Opener "[", closer "]"
35 | ///
36 | Square,
37 | //Brace
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Runtime/ProjNet/IO/CoordinateSystems/WktBracket.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 180407c7599d0814c87bcc1fd2b1dc3c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Runtime/ProjNet4Unity.Runtime.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.postert.projnet4unity"
3 | }
4 |
--------------------------------------------------------------------------------
/Runtime/ProjNet4Unity.Runtime.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e92b5971e4c4e6b42822b3887190d8e0
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Sample~/Materials.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4a59c23b2340fcd4db7dd261dc65f154
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Sample~/Materials/TerrainTexture.mat:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!21 &2100000
4 | Material:
5 | serializedVersion: 8
6 | m_ObjectHideFlags: 0
7 | m_CorrespondingSourceObject: {fileID: 0}
8 | m_PrefabInstance: {fileID: 0}
9 | m_PrefabAsset: {fileID: 0}
10 | m_Name: TerrainTexture
11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
12 | m_Parent: {fileID: 0}
13 | m_ModifiedSerializedProperties: 0
14 | m_ValidKeywords: []
15 | m_InvalidKeywords: []
16 | m_LightmapFlags: 4
17 | m_EnableInstancingVariants: 0
18 | m_DoubleSidedGI: 0
19 | m_CustomRenderQueue: -1
20 | stringTagMap: {}
21 | disabledShaderPasses: []
22 | m_LockedProperties:
23 | m_SavedProperties:
24 | serializedVersion: 3
25 | m_TexEnvs:
26 | - _BumpMap:
27 | m_Texture: {fileID: 0}
28 | m_Scale: {x: 1, y: 1}
29 | m_Offset: {x: 0, y: 0}
30 | - _DetailAlbedoMap:
31 | m_Texture: {fileID: 0}
32 | m_Scale: {x: 1, y: 1}
33 | m_Offset: {x: 0, y: 0}
34 | - _DetailMask:
35 | m_Texture: {fileID: 0}
36 | m_Scale: {x: 1, y: 1}
37 | m_Offset: {x: 0, y: 0}
38 | - _DetailNormalMap:
39 | m_Texture: {fileID: 0}
40 | m_Scale: {x: 1, y: 1}
41 | m_Offset: {x: 0, y: 0}
42 | - _EmissionMap:
43 | m_Texture: {fileID: 0}
44 | m_Scale: {x: 1, y: 1}
45 | m_Offset: {x: 0, y: 0}
46 | - _MainTex:
47 | m_Texture: {fileID: 2800000, guid: 9cf3f777f4ad46b42aa7dacf1a7c2dd9, type: 3}
48 | m_Scale: {x: 1, y: 1}
49 | m_Offset: {x: 0, y: 0}
50 | - _MetallicGlossMap:
51 | m_Texture: {fileID: 0}
52 | m_Scale: {x: 1, y: 1}
53 | m_Offset: {x: 0, y: 0}
54 | - _OcclusionMap:
55 | m_Texture: {fileID: 0}
56 | m_Scale: {x: 1, y: 1}
57 | m_Offset: {x: 0, y: 0}
58 | - _ParallaxMap:
59 | m_Texture: {fileID: 0}
60 | m_Scale: {x: 1, y: 1}
61 | m_Offset: {x: 0, y: 0}
62 | m_Ints: []
63 | m_Floats:
64 | - _BumpScale: 1
65 | - _Cutoff: 0.5
66 | - _DetailNormalMapScale: 1
67 | - _DstBlend: 0
68 | - _GlossMapScale: 1
69 | - _Glossiness: 0.5
70 | - _GlossyReflections: 1
71 | - _Metallic: 0
72 | - _Mode: 0
73 | - _OcclusionStrength: 1
74 | - _Parallax: 0.02
75 | - _SmoothnessTextureChannel: 0
76 | - _SpecularHighlights: 1
77 | - _SrcBlend: 1
78 | - _UVSec: 0
79 | - _ZWrite: 1
80 | m_Colors:
81 | - _Color: {r: 1, g: 1, b: 1, a: 1}
82 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
83 | m_BuildTextureStacks: []
84 |
--------------------------------------------------------------------------------
/Sample~/Materials/TerrainTexture.mat.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e6862c70a11d270448af363d179ab5ce
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Sample~/Materials/TerrainTexture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Postert/ProjNet4GeoAPI-For-Unity/e033ddc108295c69af88effebae59370c0ba4001/Sample~/Materials/TerrainTexture.png
--------------------------------------------------------------------------------
/Sample~/Materials/TerrainTexture.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9cf3f777f4ad46b42aa7dacf1a7c2dd9
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 12
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | flipGreenChannel: 0
24 | isReadable: 0
25 | streamingMipmaps: 0
26 | streamingMipmapsPriority: 0
27 | vTOnly: 0
28 | ignoreMipmapLimit: 0
29 | grayScaleToAlpha: 0
30 | generateCubemap: 6
31 | cubemapConvolution: 0
32 | seamlessCubemap: 0
33 | textureFormat: 1
34 | maxTextureSize: 2048
35 | textureSettings:
36 | serializedVersion: 2
37 | filterMode: 1
38 | aniso: 1
39 | mipBias: 0
40 | wrapU: 0
41 | wrapV: 0
42 | wrapW: 0
43 | nPOTScale: 1
44 | lightmap: 0
45 | compressionQuality: 50
46 | spriteMode: 0
47 | spriteExtrude: 1
48 | spriteMeshType: 1
49 | alignment: 0
50 | spritePivot: {x: 0.5, y: 0.5}
51 | spritePixelsToUnits: 100
52 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
53 | spriteGenerateFallbackPhysicsShape: 1
54 | alphaUsage: 1
55 | alphaIsTransparency: 0
56 | spriteTessellationDetail: -1
57 | textureType: 0
58 | textureShape: 1
59 | singleChannelComponent: 0
60 | flipbookRows: 1
61 | flipbookColumns: 1
62 | maxTextureSizeSet: 0
63 | compressionQualitySet: 0
64 | textureFormatSet: 0
65 | ignorePngGamma: 0
66 | applyGammaDecoding: 0
67 | swizzle: 50462976
68 | cookieLightType: 0
69 | platformSettings:
70 | - serializedVersion: 3
71 | buildTarget: DefaultTexturePlatform
72 | maxTextureSize: 2048
73 | resizeAlgorithm: 0
74 | textureFormat: -1
75 | textureCompression: 1
76 | compressionQuality: 50
77 | crunchedCompression: 0
78 | allowsAlphaSplitting: 0
79 | overridden: 0
80 | androidETC2FallbackOverride: 0
81 | forceMaximumCompressionQuality_BC6H_BC7: 0
82 | - serializedVersion: 3
83 | buildTarget: Standalone
84 | maxTextureSize: 2048
85 | resizeAlgorithm: 0
86 | textureFormat: -1
87 | textureCompression: 1
88 | compressionQuality: 50
89 | crunchedCompression: 0
90 | allowsAlphaSplitting: 0
91 | overridden: 0
92 | androidETC2FallbackOverride: 0
93 | forceMaximumCompressionQuality_BC6H_BC7: 0
94 | - serializedVersion: 3
95 | buildTarget: Android
96 | maxTextureSize: 2048
97 | resizeAlgorithm: 0
98 | textureFormat: -1
99 | textureCompression: 1
100 | compressionQuality: 50
101 | crunchedCompression: 0
102 | allowsAlphaSplitting: 0
103 | overridden: 0
104 | androidETC2FallbackOverride: 0
105 | forceMaximumCompressionQuality_BC6H_BC7: 0
106 | spriteSheet:
107 | serializedVersion: 2
108 | sprites: []
109 | outline: []
110 | physicsShape: []
111 | bones: []
112 | spriteID:
113 | internalID: 0
114 | vertices: []
115 | indices:
116 | edges: []
117 | weights: []
118 | secondaryTextures: []
119 | nameFileIdTable: {}
120 | mipmapLimitGroupName:
121 | pSDRemoveMatte: 0
122 | userData:
123 | assetBundleName:
124 | assetBundleVariant:
125 |
--------------------------------------------------------------------------------
/Sample~/Prefabs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7417ea5d87a2f8a48aac71f7849759fe
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Sample~/Prefabs/CoordinateTransformer.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1 &6818671892507243549
4 | GameObject:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | serializedVersion: 6
10 | m_Component:
11 | - component: {fileID: 1554335275296269671}
12 | - component: {fileID: 4247083979762298308}
13 | m_Layer: 0
14 | m_Name: CoordinateTransformer
15 | m_TagString: Untagged
16 | m_Icon: {fileID: 0}
17 | m_NavMeshLayer: 0
18 | m_StaticEditorFlags: 0
19 | m_IsActive: 1
20 | --- !u!4 &1554335275296269671
21 | Transform:
22 | m_ObjectHideFlags: 0
23 | m_CorrespondingSourceObject: {fileID: 0}
24 | m_PrefabInstance: {fileID: 0}
25 | m_PrefabAsset: {fileID: 0}
26 | m_GameObject: {fileID: 6818671892507243549}
27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
28 | m_LocalPosition: {x: 0, y: 0, z: 0}
29 | m_LocalScale: {x: 1, y: 1, z: 1}
30 | m_ConstrainProportionsScale: 0
31 | m_Children: []
32 | m_Father: {fileID: 0}
33 | m_RootOrder: 3
34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
35 | --- !u!114 &4247083979762298308
36 | MonoBehaviour:
37 | m_ObjectHideFlags: 0
38 | m_CorrespondingSourceObject: {fileID: 0}
39 | m_PrefabInstance: {fileID: 0}
40 | m_PrefabAsset: {fileID: 0}
41 | m_GameObject: {fileID: 6818671892507243549}
42 | m_Enabled: 1
43 | m_EditorHideFlags: 0
44 | m_Script: {fileID: 11500000, guid: 55b0209a21a2c1a4c841029162f41f10, type: 3}
45 | m_Name:
46 | m_EditorClassIdentifier:
47 | UTMZone: 32
48 | Hemisphere: 0
49 | SceneOriginUTMCoordinates:
50 | east: 566600
51 | north: 5933000
52 | altitude: 0
53 |
--------------------------------------------------------------------------------
/Sample~/Prefabs/CoordinateTransformer.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: febaa1034a44b02488f8a7e3124392c2
3 | PrefabImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Sample~/Prefabs/CoordinateTransformerTester.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1 &5220968443363197211
4 | GameObject:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | serializedVersion: 6
10 | m_Component:
11 | - component: {fileID: 2975227184521924265}
12 | - component: {fileID: 1393710401428286548}
13 | m_Layer: 0
14 | m_Name: CoordinateTransformerTester
15 | m_TagString: Untagged
16 | m_Icon: {fileID: 0}
17 | m_NavMeshLayer: 0
18 | m_StaticEditorFlags: 0
19 | m_IsActive: 1
20 | --- !u!4 &2975227184521924265
21 | Transform:
22 | m_ObjectHideFlags: 0
23 | m_CorrespondingSourceObject: {fileID: 0}
24 | m_PrefabInstance: {fileID: 0}
25 | m_PrefabAsset: {fileID: 0}
26 | m_GameObject: {fileID: 5220968443363197211}
27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
28 | m_LocalPosition: {x: 5, y: 4.25, z: 4}
29 | m_LocalScale: {x: 1, y: 1, z: 1}
30 | m_ConstrainProportionsScale: 0
31 | m_Children: []
32 | m_Father: {fileID: 0}
33 | m_RootOrder: 4
34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
35 | --- !u!114 &1393710401428286548
36 | MonoBehaviour:
37 | m_ObjectHideFlags: 0
38 | m_CorrespondingSourceObject: {fileID: 0}
39 | m_PrefabInstance: {fileID: 0}
40 | m_PrefabAsset: {fileID: 0}
41 | m_GameObject: {fileID: 5220968443363197211}
42 | m_Enabled: 1
43 | m_EditorHideFlags: 0
44 | m_Script: {fileID: 11500000, guid: 2e8fc8489183e79469eba03bea10326d, type: 3}
45 | m_Name:
46 | m_EditorClassIdentifier:
47 | _coordinateTransformer: {fileID: 0}
48 | geographicTestCoordinates:
49 | latitude: 53.5417104602435
50 | longitude: 10.0051097859429
51 | altitude: 4.25
52 | utmTestCoordinates:
53 | east: 566605
54 | north: 5933004
55 | altitude: 3
56 |
--------------------------------------------------------------------------------
/Sample~/Prefabs/CoordinateTransformerTester.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 185799516c5792f4087b29daee52e0e9
3 | PrefabImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Sample~/Prefabs/Plane.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1 &722403234263683088
4 | GameObject:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | serializedVersion: 6
10 | m_Component:
11 | - component: {fileID: 839833868036953069}
12 | - component: {fileID: 5437198148159701027}
13 | - component: {fileID: 1424135012231576427}
14 | - component: {fileID: 1271241210820229071}
15 | m_Layer: 0
16 | m_Name: Plane
17 | m_TagString: Untagged
18 | m_Icon: {fileID: 0}
19 | m_NavMeshLayer: 0
20 | m_StaticEditorFlags: 0
21 | m_IsActive: 1
22 | --- !u!4 &839833868036953069
23 | Transform:
24 | m_ObjectHideFlags: 0
25 | m_CorrespondingSourceObject: {fileID: 0}
26 | m_PrefabInstance: {fileID: 0}
27 | m_PrefabAsset: {fileID: 0}
28 | m_GameObject: {fileID: 722403234263683088}
29 | m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
30 | m_LocalPosition: {x: 500, y: 0, z: 500}
31 | m_LocalScale: {x: 100, y: 1, z: 100}
32 | m_ConstrainProportionsScale: 0
33 | m_Children: []
34 | m_Father: {fileID: 0}
35 | m_RootOrder: 2
36 | m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
37 | --- !u!33 &5437198148159701027
38 | MeshFilter:
39 | m_ObjectHideFlags: 0
40 | m_CorrespondingSourceObject: {fileID: 0}
41 | m_PrefabInstance: {fileID: 0}
42 | m_PrefabAsset: {fileID: 0}
43 | m_GameObject: {fileID: 722403234263683088}
44 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
45 | --- !u!23 &1424135012231576427
46 | MeshRenderer:
47 | m_ObjectHideFlags: 0
48 | m_CorrespondingSourceObject: {fileID: 0}
49 | m_PrefabInstance: {fileID: 0}
50 | m_PrefabAsset: {fileID: 0}
51 | m_GameObject: {fileID: 722403234263683088}
52 | m_Enabled: 1
53 | m_CastShadows: 1
54 | m_ReceiveShadows: 1
55 | m_DynamicOccludee: 1
56 | m_StaticShadowCaster: 0
57 | m_MotionVectors: 1
58 | m_LightProbeUsage: 1
59 | m_ReflectionProbeUsage: 1
60 | m_RayTracingMode: 2
61 | m_RayTraceProcedural: 0
62 | m_RenderingLayerMask: 1
63 | m_RendererPriority: 0
64 | m_Materials:
65 | - {fileID: 2100000, guid: e6862c70a11d270448af363d179ab5ce, type: 2}
66 | m_StaticBatchInfo:
67 | firstSubMesh: 0
68 | subMeshCount: 0
69 | m_StaticBatchRoot: {fileID: 0}
70 | m_ProbeAnchor: {fileID: 0}
71 | m_LightProbeVolumeOverride: {fileID: 0}
72 | m_ScaleInLightmap: 1
73 | m_ReceiveGI: 1
74 | m_PreserveUVs: 0
75 | m_IgnoreNormalsForChartDetection: 0
76 | m_ImportantGI: 0
77 | m_StitchLightmapSeams: 1
78 | m_SelectedEditorRenderState: 3
79 | m_MinimumChartSize: 4
80 | m_AutoUVMaxDistance: 0.5
81 | m_AutoUVMaxAngle: 89
82 | m_LightmapParameters: {fileID: 0}
83 | m_SortingLayerID: 0
84 | m_SortingLayer: 0
85 | m_SortingOrder: 0
86 | m_AdditionalVertexStreams: {fileID: 0}
87 | --- !u!64 &1271241210820229071
88 | MeshCollider:
89 | m_ObjectHideFlags: 0
90 | m_CorrespondingSourceObject: {fileID: 0}
91 | m_PrefabInstance: {fileID: 0}
92 | m_PrefabAsset: {fileID: 0}
93 | m_GameObject: {fileID: 722403234263683088}
94 | m_Material: {fileID: 0}
95 | m_IncludeLayers:
96 | serializedVersion: 2
97 | m_Bits: 0
98 | m_ExcludeLayers:
99 | serializedVersion: 2
100 | m_Bits: 0
101 | m_LayerOverridePriority: 0
102 | m_IsTrigger: 0
103 | m_ProvidesContacts: 0
104 | m_Enabled: 1
105 | serializedVersion: 5
106 | m_Convex: 0
107 | m_CookingOptions: 30
108 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
109 |
--------------------------------------------------------------------------------
/Sample~/Prefabs/Plane.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7806aa18e72fb1b48ae8315ba194d076
3 | PrefabImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Sample~/Scenes.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 79b68f9596e987a4c91fe732ad2db71d
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Sample~/Scenes/SampleScene.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dd4f37fb9be1bd946abc2cd4f7fdd2a4
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/docs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 02e36ecbd4528494eb948ccd7ed6af43
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # ProjNet4GeoAPI-For-Unity
2 |
3 | ## Synopsis
4 |
5 | This library allows processing geo-coordinates in Unity. It is based on [NetTopologySuite](https://github.com/NetTopologySuite/)'s [ProjNet4GeoAPI](https://github.com/NetTopologySuite/ProjNet4GeoAPI) which is an extended port of [ProjNet](http://projnet.codeplex.com).
6 |
7 | ## Motivation
8 |
9 | As Unity relies on float-based coordinate reference system. Thus, the immediate processing of geo-coordinates (double) in Unity induces a significant loss of precision. To address this issue, this library provides methods for ad-hoc coordinate transformation.
10 |
11 | ```mermaid
12 | flowchart LR
13 | id1{{Geographic Coordinates}}
14 | id2{{WGS84/UTM Coordinates}}
15 | id3{{Unity Coordinates}}
16 |
17 | id1-->id2
18 | id2-->id1
19 | id2-->id3
20 | id3-->id2
21 | ```
22 |
23 | ## Installation
24 |
25 | To add this library to your project, you can use the Package Manager:
26 |
27 | Go to the package manager and click on “Install package from git URL” and add this URL:
28 |
29 | ```
30 | https://github.com/postert/ProjNet4GeoAPI-For-Unity.git
31 | ```
32 |
33 | 
34 |
35 | ## Configuration
36 |
37 | For the transformation into Unity coordinates, the library requires the specification of a projected reference point, which corresponds to the origin of Unity's coordinate system and the point's WGS84/UTM coordinate reference system (CRS). Geo-coordinates are placed relative to this point in Unity's *Scene*. The point and CRS must be specified in the `CoordinateTransformer` script.
38 |
39 | #### Required Parameters and examples
40 |
41 | 1. WGS84/UTM coordinate reference system for your location (e.g. via [mangomap.com](https://mangomap.com/robertyoung/maps/69585/what-utm-zone-am-i-in-#))
42 | 1. Estimate the ***UTM Zone*** (e.g. *32* for Hamburg in Germany)
43 | 2. Estimate the ***Hemisphere*** whether your location is in the *Northern Hemisphere* or *Southern Hemisphere* (e.g. *Northern* Hemisphere for Hamburg)
44 | 2. UTM coordinates of the projected reference point (e.g. via [coordinates-converter.com](https://coordinates-converter.com/en/decimal/53.541675,10.005033?karte=OpenStreetMap&zoom=18))
45 | 1. Estimate the ***East*** value of the projected reference point (e.g. *566600 E* for the Lohsepark in Hamburg)
46 | 2. Estimate the ***North*** value of the projected reference point (e.g. *5933000 N* for the Lohsepark in Hamburg)
47 | 3. Provide the ***Altitude*** value of the projected reference point (e.g. 0 in the German altitude reference system [DHHN2016](https://de.wikipedia.org/wiki/Deutsches_Haupthöhennetz))
48 |
49 | ```geojson
50 | {
51 | "type": "FeatureCollection",
52 | "features": [
53 | {
54 | "type": "Feature",
55 | "id": 1,
56 | "properties": {
57 | "ID": 0
58 | },
59 | "geometry": {
60 | "type": "Polygon",
61 | "coordinates": [
62 | [
63 | [10.0050334941202,53.5416751454004],
64 | [10.0065422978258,53.541662455265],
65 | [10.0065636189796,53.5425611772512],
66 | [10.0050547833268,53.5425738678005],
67 | [10.0050334941202,53.5416751454004]
68 | ]
69 | ]
70 | }
71 | }
72 | ]
73 | }
74 | ```
75 |
76 | #### Apply Parameters
77 |
78 | To apply the parameters, add **one** `CoordinateTransformer` script to the Unity *Scene* and provide the previously described reference point and its WGS84/UTM coordinate reference system accordingly. (The script can be added to an arbitrary GameObject (GO). It is not necessary to reset the GO's transform to the default values.)
79 |
80 | 
81 |
82 | ### Example of Coordinate Transformation Execution
83 |
84 | Coordinate transformations can be executed via the `CoordinateTransformer`, which is defined in the `GeocoordinateTransformer` namespace. `CoordinateTransformer` provides the following six methods for immediate coordinate conversion.
85 |
86 | ```C#
87 | // 1. Import the library's namespace
88 | using GeocoordinateTransformer;
89 |
90 | // ...
91 |
92 | // 2. Define example coordinates to transform
93 | private GeographicCoordinates geographicTestCoordinates = new(latitude: 53.5417104602435, longitude: 10.0051097859429, altitude: 4.25);
94 | private UTMCoordinates utmTestCoordinates = new(east: 566605, north: 5933004, altitude: 3);
95 | private Vector3 unityTestCoordinates = new(x: 1, y: 4, z: 5);
96 |
97 | // ...
98 |
99 | // 3. Find CoordinateTransformer with associated parameters in the Unity Scene
100 | CoordinateTransformer coordinateTransformer = GameObject.FindAnyObjectByType();
101 |
102 | // 4. Execute coordinate transformation
103 |
104 | // 4.1 GeographicCoordinates ⇄ Vector3 (Unity)
105 | Vector3 unityCoordinates1 = CoordinateTransformer.GetUnityCoordinates(geographicTestCoordinates);
106 | GeographicCoordinates geographicCoordinates1 = CoordinateTransformer.GetGeographicCoordinates(unityCoordinates);
107 |
108 | // 4.2 UTMCoordinates ⇄ Vector3 (Unity)
109 | Vector3 unityCoordinates2 = CoordinateTransformer.GetUnityCoordinates(utmTestCoordinates);
110 | UTMCoordinates utmCoordinates2 = CoordinateTransformer.GetUTMCoordinates(unityCoordinates);
111 |
112 | // 4.3 GeographicCoordinates ⇄ UTMCoordinates
113 | GeographicCoordinates geographicCoordinates3 = CoordinateTransformer.GetGeographicCoordinates(utmTestCoordinates);
114 | UTMCoordinates utmCoordinates3 = CoordinateTransformer.GetUTMCoordinates(geographicTestCoordinates);
115 | ```
116 |
117 | For a more comprehensive overview, have a look at the [documentation](documentation.pdf) and use the [Sample Scene](#sample-scene-included-in-library) as a starting point.
118 |
119 | # Sample Scene (included in Library)
120 |
121 | A sample Unity *Scene* is included in the library and can be added to the *Assets* folder via an import in Unity's Package Manager:
122 |
123 | 
124 |
125 | *SampleScene* contains a *Plane*, a *CoordinateTransformer*, and a *CoordinateTransformerTest* GameObject. The *Plane* visualizes the geo-coordinates associated with Unity's coordinate system's origin. The *CoordinateTransformer* GO contains the `CoordinateTransformer` component, described in the [Apply Parameters](#apply-parameters) section. The *CoordinateTransformerTest* GO provides test functionality to either place the latter GO according to the provided coordinates or to print the GO's current location as geo-coordinates.
126 |
127 | 
128 |
129 | ## Limitations
130 |
131 | The current implementation does not support [floating origins](https://gamedev.stackexchange.com/questions/110349/is-a-custom-coordinate-system-possible-in-unity/110369#110369). Thus, the float-induced limited spatial extent of Unity's scene is not immediately addressed in this library. However, the library can still serve a foundation of these approaches, as the `CoordinateTransformer` can be updated and the *Scene*'s content be moved within the *Scene* accordingly.
132 |
--------------------------------------------------------------------------------
/docs/README.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fb639f8cbc86c4140b9dd3b32d4ca142
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/docs/configure_reference_point.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Postert/ProjNet4GeoAPI-For-Unity/e033ddc108295c69af88effebae59370c0ba4001/docs/configure_reference_point.gif
--------------------------------------------------------------------------------
/docs/configure_reference_point.gif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d832fb1652494423f8fed426010b4c61
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 12
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | flipGreenChannel: 0
24 | isReadable: 0
25 | streamingMipmaps: 0
26 | streamingMipmapsPriority: 0
27 | vTOnly: 0
28 | ignoreMipmapLimit: 0
29 | grayScaleToAlpha: 0
30 | generateCubemap: 6
31 | cubemapConvolution: 0
32 | seamlessCubemap: 0
33 | textureFormat: 1
34 | maxTextureSize: 2048
35 | textureSettings:
36 | serializedVersion: 2
37 | filterMode: 1
38 | aniso: 1
39 | mipBias: 0
40 | wrapU: 0
41 | wrapV: 0
42 | wrapW: 0
43 | nPOTScale: 1
44 | lightmap: 0
45 | compressionQuality: 50
46 | spriteMode: 0
47 | spriteExtrude: 1
48 | spriteMeshType: 1
49 | alignment: 0
50 | spritePivot: {x: 0.5, y: 0.5}
51 | spritePixelsToUnits: 100
52 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
53 | spriteGenerateFallbackPhysicsShape: 1
54 | alphaUsage: 1
55 | alphaIsTransparency: 0
56 | spriteTessellationDetail: -1
57 | textureType: 0
58 | textureShape: 1
59 | singleChannelComponent: 0
60 | flipbookRows: 1
61 | flipbookColumns: 1
62 | maxTextureSizeSet: 0
63 | compressionQualitySet: 0
64 | textureFormatSet: 0
65 | ignorePngGamma: 0
66 | applyGammaDecoding: 0
67 | swizzle: 50462976
68 | cookieLightType: 0
69 | platformSettings:
70 | - serializedVersion: 3
71 | buildTarget: DefaultTexturePlatform
72 | maxTextureSize: 2048
73 | resizeAlgorithm: 0
74 | textureFormat: -1
75 | textureCompression: 1
76 | compressionQuality: 50
77 | crunchedCompression: 0
78 | allowsAlphaSplitting: 0
79 | overridden: 0
80 | androidETC2FallbackOverride: 0
81 | forceMaximumCompressionQuality_BC6H_BC7: 0
82 | - serializedVersion: 3
83 | buildTarget: Standalone
84 | maxTextureSize: 2048
85 | resizeAlgorithm: 0
86 | textureFormat: -1
87 | textureCompression: 1
88 | compressionQuality: 50
89 | crunchedCompression: 0
90 | allowsAlphaSplitting: 0
91 | overridden: 0
92 | androidETC2FallbackOverride: 0
93 | forceMaximumCompressionQuality_BC6H_BC7: 0
94 | - serializedVersion: 3
95 | buildTarget: Android
96 | maxTextureSize: 2048
97 | resizeAlgorithm: 0
98 | textureFormat: -1
99 | textureCompression: 1
100 | compressionQuality: 50
101 | crunchedCompression: 0
102 | allowsAlphaSplitting: 0
103 | overridden: 0
104 | androidETC2FallbackOverride: 0
105 | forceMaximumCompressionQuality_BC6H_BC7: 0
106 | - serializedVersion: 3
107 | buildTarget: iPhone
108 | maxTextureSize: 2048
109 | resizeAlgorithm: 0
110 | textureFormat: -1
111 | textureCompression: 1
112 | compressionQuality: 50
113 | crunchedCompression: 0
114 | allowsAlphaSplitting: 0
115 | overridden: 0
116 | androidETC2FallbackOverride: 0
117 | forceMaximumCompressionQuality_BC6H_BC7: 0
118 | spriteSheet:
119 | serializedVersion: 2
120 | sprites: []
121 | outline: []
122 | physicsShape: []
123 | bones: []
124 | spriteID:
125 | internalID: 0
126 | vertices: []
127 | indices:
128 | edges: []
129 | weights: []
130 | secondaryTextures: []
131 | nameFileIdTable: {}
132 | mipmapLimitGroupName:
133 | pSDRemoveMatte: 0
134 | userData:
135 | assetBundleName:
136 | assetBundleVariant:
137 |
--------------------------------------------------------------------------------
/docs/documentation.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Postert/ProjNet4GeoAPI-For-Unity/e033ddc108295c69af88effebae59370c0ba4001/docs/documentation.pdf
--------------------------------------------------------------------------------
/docs/documentation.pdf.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7c41548a8d3a4a7469df2d1a86614228
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/docs/import_sample.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Postert/ProjNet4GeoAPI-For-Unity/e033ddc108295c69af88effebae59370c0ba4001/docs/import_sample.gif
--------------------------------------------------------------------------------
/docs/import_sample.gif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0a5e616636f8a4e45a468b3896a1ad82
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 12
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | flipGreenChannel: 0
24 | isReadable: 0
25 | streamingMipmaps: 0
26 | streamingMipmapsPriority: 0
27 | vTOnly: 0
28 | ignoreMipmapLimit: 0
29 | grayScaleToAlpha: 0
30 | generateCubemap: 6
31 | cubemapConvolution: 0
32 | seamlessCubemap: 0
33 | textureFormat: 1
34 | maxTextureSize: 2048
35 | textureSettings:
36 | serializedVersion: 2
37 | filterMode: 1
38 | aniso: 1
39 | mipBias: 0
40 | wrapU: 0
41 | wrapV: 0
42 | wrapW: 0
43 | nPOTScale: 1
44 | lightmap: 0
45 | compressionQuality: 50
46 | spriteMode: 0
47 | spriteExtrude: 1
48 | spriteMeshType: 1
49 | alignment: 0
50 | spritePivot: {x: 0.5, y: 0.5}
51 | spritePixelsToUnits: 100
52 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
53 | spriteGenerateFallbackPhysicsShape: 1
54 | alphaUsage: 1
55 | alphaIsTransparency: 0
56 | spriteTessellationDetail: -1
57 | textureType: 0
58 | textureShape: 1
59 | singleChannelComponent: 0
60 | flipbookRows: 1
61 | flipbookColumns: 1
62 | maxTextureSizeSet: 0
63 | compressionQualitySet: 0
64 | textureFormatSet: 0
65 | ignorePngGamma: 0
66 | applyGammaDecoding: 0
67 | swizzle: 50462976
68 | cookieLightType: 0
69 | platformSettings:
70 | - serializedVersion: 3
71 | buildTarget: DefaultTexturePlatform
72 | maxTextureSize: 2048
73 | resizeAlgorithm: 0
74 | textureFormat: -1
75 | textureCompression: 1
76 | compressionQuality: 50
77 | crunchedCompression: 0
78 | allowsAlphaSplitting: 0
79 | overridden: 0
80 | androidETC2FallbackOverride: 0
81 | forceMaximumCompressionQuality_BC6H_BC7: 0
82 | - serializedVersion: 3
83 | buildTarget: Standalone
84 | maxTextureSize: 2048
85 | resizeAlgorithm: 0
86 | textureFormat: -1
87 | textureCompression: 1
88 | compressionQuality: 50
89 | crunchedCompression: 0
90 | allowsAlphaSplitting: 0
91 | overridden: 0
92 | androidETC2FallbackOverride: 0
93 | forceMaximumCompressionQuality_BC6H_BC7: 0
94 | - serializedVersion: 3
95 | buildTarget: Android
96 | maxTextureSize: 2048
97 | resizeAlgorithm: 0
98 | textureFormat: -1
99 | textureCompression: 1
100 | compressionQuality: 50
101 | crunchedCompression: 0
102 | allowsAlphaSplitting: 0
103 | overridden: 0
104 | androidETC2FallbackOverride: 0
105 | forceMaximumCompressionQuality_BC6H_BC7: 0
106 | - serializedVersion: 3
107 | buildTarget: iPhone
108 | maxTextureSize: 2048
109 | resizeAlgorithm: 0
110 | textureFormat: -1
111 | textureCompression: 1
112 | compressionQuality: 50
113 | crunchedCompression: 0
114 | allowsAlphaSplitting: 0
115 | overridden: 0
116 | androidETC2FallbackOverride: 0
117 | forceMaximumCompressionQuality_BC6H_BC7: 0
118 | spriteSheet:
119 | serializedVersion: 2
120 | sprites: []
121 | outline: []
122 | physicsShape: []
123 | bones: []
124 | spriteID:
125 | internalID: 0
126 | vertices: []
127 | indices:
128 | edges: []
129 | weights: []
130 | secondaryTextures: []
131 | nameFileIdTable: {}
132 | mipmapLimitGroupName:
133 | pSDRemoveMatte: 0
134 | userData:
135 | assetBundleName:
136 | assetBundleVariant:
137 |
--------------------------------------------------------------------------------
/docs/install_via_unity_package_manager.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Postert/ProjNet4GeoAPI-For-Unity/e033ddc108295c69af88effebae59370c0ba4001/docs/install_via_unity_package_manager.gif
--------------------------------------------------------------------------------
/docs/install_via_unity_package_manager.gif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b0c39d9fb0dd7464d9bd83d6627cdc9d
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 12
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | flipGreenChannel: 0
24 | isReadable: 0
25 | streamingMipmaps: 0
26 | streamingMipmapsPriority: 0
27 | vTOnly: 0
28 | ignoreMipmapLimit: 0
29 | grayScaleToAlpha: 0
30 | generateCubemap: 6
31 | cubemapConvolution: 0
32 | seamlessCubemap: 0
33 | textureFormat: 1
34 | maxTextureSize: 2048
35 | textureSettings:
36 | serializedVersion: 2
37 | filterMode: 1
38 | aniso: 1
39 | mipBias: 0
40 | wrapU: 0
41 | wrapV: 0
42 | wrapW: 0
43 | nPOTScale: 1
44 | lightmap: 0
45 | compressionQuality: 50
46 | spriteMode: 0
47 | spriteExtrude: 1
48 | spriteMeshType: 1
49 | alignment: 0
50 | spritePivot: {x: 0.5, y: 0.5}
51 | spritePixelsToUnits: 100
52 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
53 | spriteGenerateFallbackPhysicsShape: 1
54 | alphaUsage: 1
55 | alphaIsTransparency: 0
56 | spriteTessellationDetail: -1
57 | textureType: 0
58 | textureShape: 1
59 | singleChannelComponent: 0
60 | flipbookRows: 1
61 | flipbookColumns: 1
62 | maxTextureSizeSet: 0
63 | compressionQualitySet: 0
64 | textureFormatSet: 0
65 | ignorePngGamma: 0
66 | applyGammaDecoding: 0
67 | swizzle: 50462976
68 | cookieLightType: 0
69 | platformSettings:
70 | - serializedVersion: 3
71 | buildTarget: DefaultTexturePlatform
72 | maxTextureSize: 2048
73 | resizeAlgorithm: 0
74 | textureFormat: -1
75 | textureCompression: 1
76 | compressionQuality: 50
77 | crunchedCompression: 0
78 | allowsAlphaSplitting: 0
79 | overridden: 0
80 | androidETC2FallbackOverride: 0
81 | forceMaximumCompressionQuality_BC6H_BC7: 0
82 | - serializedVersion: 3
83 | buildTarget: Standalone
84 | maxTextureSize: 2048
85 | resizeAlgorithm: 0
86 | textureFormat: -1
87 | textureCompression: 1
88 | compressionQuality: 50
89 | crunchedCompression: 0
90 | allowsAlphaSplitting: 0
91 | overridden: 0
92 | androidETC2FallbackOverride: 0
93 | forceMaximumCompressionQuality_BC6H_BC7: 0
94 | - serializedVersion: 3
95 | buildTarget: Android
96 | maxTextureSize: 2048
97 | resizeAlgorithm: 0
98 | textureFormat: -1
99 | textureCompression: 1
100 | compressionQuality: 50
101 | crunchedCompression: 0
102 | allowsAlphaSplitting: 0
103 | overridden: 0
104 | androidETC2FallbackOverride: 0
105 | forceMaximumCompressionQuality_BC6H_BC7: 0
106 | - serializedVersion: 3
107 | buildTarget: iPhone
108 | maxTextureSize: 2048
109 | resizeAlgorithm: 0
110 | textureFormat: -1
111 | textureCompression: 1
112 | compressionQuality: 50
113 | crunchedCompression: 0
114 | allowsAlphaSplitting: 0
115 | overridden: 0
116 | androidETC2FallbackOverride: 0
117 | forceMaximumCompressionQuality_BC6H_BC7: 0
118 | spriteSheet:
119 | serializedVersion: 2
120 | sprites: []
121 | outline: []
122 | physicsShape: []
123 | bones: []
124 | spriteID:
125 | internalID: 0
126 | vertices: []
127 | indices:
128 | edges: []
129 | weights: []
130 | secondaryTextures: []
131 | nameFileIdTable: {}
132 | mipmapLimitGroupName:
133 | pSDRemoveMatte: 0
134 | userData:
135 | assetBundleName:
136 | assetBundleVariant:
137 |
--------------------------------------------------------------------------------
/docs/test_coordiante_transformer.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Postert/ProjNet4GeoAPI-For-Unity/e033ddc108295c69af88effebae59370c0ba4001/docs/test_coordiante_transformer.gif
--------------------------------------------------------------------------------
/docs/test_coordiante_transformer.gif.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f2363f1b088eb41b0949ed8e1adbfd14
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 12
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | flipGreenChannel: 0
24 | isReadable: 0
25 | streamingMipmaps: 0
26 | streamingMipmapsPriority: 0
27 | vTOnly: 0
28 | ignoreMipmapLimit: 0
29 | grayScaleToAlpha: 0
30 | generateCubemap: 6
31 | cubemapConvolution: 0
32 | seamlessCubemap: 0
33 | textureFormat: 1
34 | maxTextureSize: 2048
35 | textureSettings:
36 | serializedVersion: 2
37 | filterMode: 1
38 | aniso: 1
39 | mipBias: 0
40 | wrapU: 0
41 | wrapV: 0
42 | wrapW: 0
43 | nPOTScale: 1
44 | lightmap: 0
45 | compressionQuality: 50
46 | spriteMode: 0
47 | spriteExtrude: 1
48 | spriteMeshType: 1
49 | alignment: 0
50 | spritePivot: {x: 0.5, y: 0.5}
51 | spritePixelsToUnits: 100
52 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
53 | spriteGenerateFallbackPhysicsShape: 1
54 | alphaUsage: 1
55 | alphaIsTransparency: 0
56 | spriteTessellationDetail: -1
57 | textureType: 0
58 | textureShape: 1
59 | singleChannelComponent: 0
60 | flipbookRows: 1
61 | flipbookColumns: 1
62 | maxTextureSizeSet: 0
63 | compressionQualitySet: 0
64 | textureFormatSet: 0
65 | ignorePngGamma: 0
66 | applyGammaDecoding: 0
67 | swizzle: 50462976
68 | cookieLightType: 0
69 | platformSettings:
70 | - serializedVersion: 3
71 | buildTarget: DefaultTexturePlatform
72 | maxTextureSize: 2048
73 | resizeAlgorithm: 0
74 | textureFormat: -1
75 | textureCompression: 1
76 | compressionQuality: 50
77 | crunchedCompression: 0
78 | allowsAlphaSplitting: 0
79 | overridden: 0
80 | androidETC2FallbackOverride: 0
81 | forceMaximumCompressionQuality_BC6H_BC7: 0
82 | - serializedVersion: 3
83 | buildTarget: Standalone
84 | maxTextureSize: 2048
85 | resizeAlgorithm: 0
86 | textureFormat: -1
87 | textureCompression: 1
88 | compressionQuality: 50
89 | crunchedCompression: 0
90 | allowsAlphaSplitting: 0
91 | overridden: 0
92 | androidETC2FallbackOverride: 0
93 | forceMaximumCompressionQuality_BC6H_BC7: 0
94 | - serializedVersion: 3
95 | buildTarget: Android
96 | maxTextureSize: 2048
97 | resizeAlgorithm: 0
98 | textureFormat: -1
99 | textureCompression: 1
100 | compressionQuality: 50
101 | crunchedCompression: 0
102 | allowsAlphaSplitting: 0
103 | overridden: 0
104 | androidETC2FallbackOverride: 0
105 | forceMaximumCompressionQuality_BC6H_BC7: 0
106 | - serializedVersion: 3
107 | buildTarget: iPhone
108 | maxTextureSize: 2048
109 | resizeAlgorithm: 0
110 | textureFormat: -1
111 | textureCompression: 1
112 | compressionQuality: 50
113 | crunchedCompression: 0
114 | allowsAlphaSplitting: 0
115 | overridden: 0
116 | androidETC2FallbackOverride: 0
117 | forceMaximumCompressionQuality_BC6H_BC7: 0
118 | spriteSheet:
119 | serializedVersion: 2
120 | sprites: []
121 | outline: []
122 | physicsShape: []
123 | bones: []
124 | spriteID:
125 | internalID: 0
126 | vertices: []
127 | indices:
128 | edges: []
129 | weights: []
130 | secondaryTextures: []
131 | nameFileIdTable: {}
132 | mipmapLimitGroupName:
133 | pSDRemoveMatte: 0
134 | userData:
135 | assetBundleName:
136 | assetBundleVariant:
137 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.postert.projnetforgeoapiforunity",
3 | "version": "1.0.2",
4 | "displayName": "ProjNet4GeoAPI-For-Unity",
5 | "description": "The ProjNet4GeoAPI-For-Unity library is based on the ProjNet4GeoAPI which is an extended port of ProjNet. It allows processing geo-coordinates in Unity.",
6 | "unity": "2019.1",
7 | "unityRelease": "0b5",
8 | "documentationUrl": "https://github.com/Postert/ProjNet4GeoAPI-For-Unity",
9 | "licensesUrl": "https://github.com/Postert/ProjNet4GeoAPI-For-Unity/blob/main/LICENSE",
10 | "keywords": [
11 | "geocoordinates",
12 | "geo-coordinates",
13 | "Unity",
14 | "Unity3D",
15 | "Geographic coordinates",
16 | "GPS coordinates",
17 | "Geographic coordinate system",
18 | "latitude",
19 | "longitude",
20 | "UTM coordinates",
21 | "Universal Transverse Mercator coordinate system",
22 | "UTM coordinate system",
23 | "ETRS89/UTM coordinate system"
24 | ],
25 | "author": {
26 | "name": "Patrick Postert"
27 | },
28 | "samples": [
29 | {
30 | "displayName": "CoordinateTransformer",
31 | "description": "Contains a sample scene for immediate testing.",
32 | "path": "Sample~"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/package.json.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7a273612adf224f4ca295ba6b1939f56
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------