AcDbGeoCoordinateSystem.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846
  1. //
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. #pragma once
  12. #include "acdb.h"
  13. #include "AcString.h"
  14. #include "gepnt3d.h"
  15. #pragma pack (push, 8)
  16. class AcDbGeoCoordinateSystem;
  17. /// <summary>
  18. /// The AcDbGeoDatum struct represents a datum definition of a coordinate reference system.
  19. /// General a datum specifies the relationship of a coordinate system to the earth.
  20. /// </summary>
  21. ///
  22. struct AcDbGeoDatum
  23. {
  24. /// <summary> ID of the datum definition. </summary>
  25. AcString id;
  26. /// <summary> Description of the datum definition. </summary>
  27. AcString desc;
  28. };
  29. /// <summary>
  30. /// The AcDbGeoEllipsoid struct represents a ellipsoid definition of a coordinate reference system.
  31. /// An ellipsoid is a geometric figure that may be used to describe the approximate shape of the earth.
  32. /// </summary>
  33. ///
  34. struct AcDbGeoEllipsoid
  35. {
  36. /// <summary> ID of the ellipsoid definition. </summary>
  37. AcString id;
  38. /// <summary> Description of the ellipsoid definition. </summary>
  39. AcString desc;
  40. /// <summary> Length of the semi-minor axis of the ellipsoid definition. </summary>
  41. double polarRadius;
  42. /// <summary> Eccentricity value of the ellipsoid definition. </summary>
  43. double eccentricity;
  44. };
  45. /// <summary>
  46. /// The AcDbGeoProjectionParameter struct represents projection parameter of
  47. /// a coordinate reference system
  48. /// </summary>
  49. ///
  50. struct AcDbGeoProjectionParameter
  51. {
  52. /// <summary> The name of the projection parameter. </summary>
  53. AcString name;
  54. /// <summary> The value of the projection parameter. </summary>
  55. double value;
  56. };
  57. /// <summary>
  58. /// The AcDbGeoCoordinateSystemCategory class represents a category which holds
  59. /// string identifiers (IDs) referring to a group of coordinate reference systems
  60. /// </summary>
  61. ///
  62. class AcDbGeoCoordinateSystemCategory
  63. {
  64. public:
  65. /// <summary> Destructor. </summary>
  66. virtual ~AcDbGeoCoordinateSystemCategory(){};
  67. /// <summary> Returns the ID of the category. </summary>
  68. ///
  69. /// <param name="categoryId">
  70. /// Input/output AcString object.
  71. /// </param>
  72. /// <returns>Returns Acad::eOk if successful.</returns>
  73. ///
  74. virtual Acad::ErrorStatus getId(AcString& categoryId) const = 0;
  75. /// <summary> Returns number of coordinate systems belonging to this category. </summary>
  76. ///
  77. /// <param name="num">
  78. /// Input/output integer.
  79. /// </param>
  80. /// <returns>Returns Acad::eOk if successful.</returns>
  81. ///
  82. virtual Acad::ErrorStatus getNumOfCoordinateSystem(int& num) const = 0;
  83. /// <summary> Returns the coordinate system at a given index. </summary>
  84. ///
  85. /// <param name="index">
  86. /// Input integer.
  87. /// </param>
  88. /// <param name="pCoordSys">
  89. /// Input/output pointer to AcDbGeoCoordinateSystem object.
  90. /// Caller is responsible for deleting the returned object after use.
  91. /// </param>
  92. /// <returns>Returns Acad::eOk if successful.</returns>
  93. ///
  94. virtual Acad::ErrorStatus getCoordinateSystemAt(int index, AcDbGeoCoordinateSystem*& pCoordSys) const = 0;
  95. /// <summary> Returns all categories in a given array. </summary>
  96. ///
  97. /// <param name="allCoordSys">
  98. /// Input/output array of AcDbGeoCoordinateSystem objects.
  99. /// Caller is responsible for deleting the returned AcDbGeoCoordinateSystem objects after use.
  100. /// </param>
  101. /// <returns>Returns Acad::eOk if successful.</returns>
  102. ///
  103. ACDB_PORT static Acad::ErrorStatus createAll(AcArray<AcDbGeoCoordinateSystemCategory*>& allCategories);
  104. };
  105. /// <summary>
  106. /// the AcDbGeoCoordinateSystem class represents a coordinate reference system (CRS) definition.
  107. /// A CRS is also being referred to as a spatial reference system (SRS).
  108. /// </summary>
  109. ///
  110. class AcDbGeoCoordinateSystem
  111. {
  112. public:
  113. /// <summary>
  114. /// brief Defines enums used to indicate the type of a coordinate reference system.
  115. /// </summary>
  116. ///
  117. enum Type
  118. {
  119. /// <summary> brief Specifies the coordinate system is not set. </summary>
  120. kTypeUnknown = 0,
  121. /// <summary>
  122. /// brief Specifies that the coordinate system is arbitrary. It is not spatially bound to the earth.
  123. /// </summary>
  124. kTypeArbitrary = 1,
  125. /// <summary> brief Specifies that the coordinate system is geographic. </summary>
  126. kTypeGeographic = 2,
  127. /// <summary> brief Specifies that the coordinate system is projected. </summary>
  128. kTypeProjected = 3
  129. };
  130. /// <summary>
  131. /// brief Values that represent the coordinate reference system projection method types.
  132. /// </summary>
  133. ///
  134. enum ProjectionCode
  135. {
  136. /// <summary> Unknown projection code. </summary>
  137. kProjectionCodeUnknown = 0 ,
  138. /// <summary> Albers Equal Area Conic Projection. </summary>
  139. kProjectionCodeAlber = 4,
  140. /// <summary> Azimuthal Equi-Distant; Elevated ellipsoid. </summary>
  141. kProjectionCodeAzede = 59,
  142. /// <summary> Lambert Azimuthal Equal Area Projection. </summary>
  143. kProjectionCodeAzmea = 11,
  144. /// <summary> Lambert Azimuthal Equidistant Projection. </summary>
  145. kProjectionCodeAzmed = 7,
  146. /// <summary> Bipolar Oblique Conformal Conic Projection. </summary>
  147. kProjectionCodeBipolar = 31,
  148. /// <summary> Bonne Pseudo conical Projection. </summary>
  149. kProjectionCodeBonne = 24,
  150. /// <summary> Cassini Projection. </summary>
  151. kProjectionCodeCassini = 22,
  152. /// <summary> Ekert Pseudocylindrical Projection; Number IV. </summary>
  153. kProjectionCodeEckert4 = 25,
  154. /// <summary> Ekert Pseudocylindrical Projection; Number VI. </summary>
  155. kProjectionCodeEckert6 = 26,
  156. /// <summary> Equidistant Conic Projection; aka Simple Conic. </summary>
  157. kProjectionCodeEdcnc = 12,
  158. /// <summary> Equidistant Cylindrical Projection (Spherical only). </summary>
  159. kProjectionCodeEdcyl = 20,
  160. /// <summary> Gauss-Kruger: Transverse Mercator without scale reduction parameter. </summary>
  161. kProjectionCodeGaussK = 46,
  162. /// <summary> Gnomonic Projection. </summary>
  163. kProjectionCodeGnomonic = 19,
  164. /// <summary> Goode Homolosine Projection. </summary>
  165. kProjectionCodeGoode = 28,
  166. /// <summary> Unrectified Hotine Oblique Mercator Projection; Sngl Point Form. </summary>
  167. kProjectionCodeHom1uv = 1281,
  168. /// <summary> Rectified Hotine Oblique Mercator Projection; Single Point Form. </summary>
  169. kProjectionCodeHom1xy = 1282,
  170. /// <summary> Unrectified Hotine Oblique Mercator Projection; Two Point Form. </summary>
  171. kProjectionCodeHom2uv = 1283,
  172. /// <summary> Rectified Hotine Oblique Mercator Projection; Two Point Form. </summary>
  173. kProjectionCodeHom2xy = 1284,
  174. /// <summary> Czech Krovak; original. </summary>
  175. kProjectionCodeKrovak = 47,
  176. /// <summary> Czech Krovak; includes 1995 adjustment. </summary>
  177. kProjectionCodeKrvk95 = 51,
  178. /// <summary> Null Projection; produces/processes Latitude and Longitude. </summary>
  179. kProjectionCodeLL = 1,
  180. /// <summary> Single standard parallel variation of the Lambert Conformal Conic. </summary>
  181. kProjectionCodeLm1sp = 36,
  182. /// <summary> Double standard parallel variation of the Lambert Conformal Conic. </summary>
  183. kProjectionCodeLm2sp = 37,
  184. /// <summary> Belgian variation of the Lambert Conformal Conic Projection. </summary>
  185. kProjectionCodeLmblg = 38,
  186. /// <summary> Lambert Tangential Conformal Conic Projection. </summary>
  187. kProjectionCodeLmtan = 8,
  188. /// <summary> Miller Cylindrical Projection. </summary>
  189. kProjectionCodeMiller = 13,
  190. /// <summary> Minnesota DOT variation of the Lambert Conformal Conic. </summary>
  191. kProjectionCodeMndotl = 41,
  192. /// <summary> Minnesota DOT variation of the Transverse Mercator projection. </summary>
  193. kProjectionCodeMndott = 42,
  194. /// <summary> Lallemand IMW Modified Polyconic Projection. </summary>
  195. kProjectionCodeModpc = 10,
  196. /// <summary> Mollweide Projection. </summary>
  197. kProjectionCodeMollweid = 27,
  198. /// <summary> Mercator Cylindrical Projection. </summary>
  199. kProjectionCodeMrcat = 6,
  200. /// <summary> Standard Mercator with a scale reduction factor instead of a standard parallel. </summary>
  201. kProjectionCodeMrcatK = 49,
  202. /// <summary> Modified Stereographic Projection. </summary>
  203. kProjectionCodeMstero = 15,
  204. /// <summary> Normal Aspect; Equal Area Cylindrical Projection. </summary>
  205. kProjectionCodeNeacyl = 29,
  206. /// <summary> Non-georeferenced coordinate system. Named Non-Earth by Map Info. </summary>
  207. kProjectionCodeNerth = 55,
  208. /// <summary> New Zealand National Grid. </summary>
  209. kProjectionCodeNzealand = 16,
  210. /// <summary> Oblique Mercator (obsolete). </summary>
  211. kProjectionCodeOblqM = 5,
  212. /// <summary> Oblique Cylindrical; a generalized version of the Swiss projection; specifically for Hungary. </summary>
  213. kProjectionCodeObqcyl = 56,
  214. /// <summary> Orthographic Projection. </summary>
  215. kProjectionCodeOrtho = 18,
  216. /// <summary>
  217. /// The Transverse Mercator with specific parameters;
  218. /// with the OSTN02 grid shift tacked on.
  219. /// This is a combination of a projection and a datum shift.
  220. /// </summary>
  221. kProjectionCodeOstn02 = 60,
  222. /// <summary>
  223. /// The Transverse Mercator with specific parameters;
  224. /// with the OSTN97 grid shift tacked on.
  225. /// This is a combination of a projection and a datum shift.
  226. /// </summary>
  227. kProjectionCodeOstn97 = 58,
  228. /// <summary> Oblique Stereographic. </summary>
  229. kProjectionCodeOstro = 34,
  230. /// <summary> Hassler American Polyconic Projection. </summary>
  231. kProjectionCodePlycn = 9,
  232. /// <summary> Polar stereographic. </summary>
  233. kProjectionCodePstro = 33,
  234. /// <summary> Polar stereographic with standard latitude. </summary>
  235. kProjectionCodePstrosl = 53,
  236. /// <summary> cs_PRJCOD_RSKEW. </summary>
  237. kProjectionCodeRskew = 1285,
  238. /// <summary> cs_PRJCOD_RSKEWC. </summary>
  239. kProjectionCodeRskewc = 1286,
  240. /// <summary> cs_PRJCOD_RSKEWO - Rectified Skew Orthomorphic; Skew Azimuth at Rectified Origin. </summary>
  241. kProjectionCodeRskewo = 1287,
  242. /// <summary> Robinson Cylindrical Projection. </summary>
  243. kProjectionCodeRobinson = 23,
  244. /// <summary> Sinusoidal Projection; Optionally Interrupted. </summary>
  245. kProjectionCodeSinus = 17,
  246. /// <summary> South Oriented variation of the Transverse Mercator Projection. </summary>
  247. kProjectionCodeSotrm = 43,
  248. /// <summary> Synder's Oblique Stereographic. </summary>
  249. kProjectionCodeSstro = 35,
  250. /// <summary> "Swiss" Projection. </summary>
  251. kProjectionCodeSwiss = 32,
  252. /// <summary> Combination of Transverse Mercator and a polynomial expansion used in Denmark. </summary>
  253. kProjectionCodeSys34 = 57,
  254. /// <summary>
  255. /// Combination of Transverse Mercator and polynomial expansion used in Denmark.
  256. /// Polynomials are of the 1999 vintage.
  257. /// </summary>
  258. kProjectionCodeSys34_99 = 61,
  259. /// <summary> Transverse Aspect; Equal Area Cylindrical Projection. </summary>
  260. kProjectionCodeTeacyl = 30,
  261. /// <summary> Transverse Mercator or Gauss Kruger Projection. </summary>
  262. kProjectionCodeTm = 3,
  263. /// <summary> Transverse Mercator with affine post-processor. </summary>
  264. kProjectionCodeTrmeraf = 54,
  265. /// <summary> Transverse Mercator using Kruger Formulation. </summary>
  266. kProjectionCodeTrmrkrg = 62,
  267. /// <summary> Transverse Mercator per J. P. Snyder. </summary>
  268. kProjectionCodeTrmrs = 45,
  269. /// <summary> Van Der Grinten Projection. </summary>
  270. kProjectionCodeVdgrntn = 21,
  271. /// <summary> Wisconsin County Coord System variation; Lambert Conformal Conic. </summary>
  272. kProjectionCodeWccsl = 39,
  273. /// <summary> Wisconsin County Coord System variation; Transverse Mercator projection. </summary>
  274. kProjectionCodeWccst = 40,
  275. /// <summary> The UTM direct variation of the Transverse Mercator projection. </summary>
  276. kProjectionCodeUtm = 44,
  277. /// <summary> Winkel-Tripel; variable standard latitude. </summary>
  278. kProjectionCodeWinkl = 63,
  279. /// <summary> Nerth with scale and rotation. </summary>
  280. kProjectionCodeNrthsrt = 64,
  281. /// <summary> Lambert Conformal Conic with affine post-processor. </summary>
  282. kProjectionCodeLmbrtaf = 65,
  283. /// <summary>
  284. /// Combination of Transverse Mercator and polynomial expansion used in Denmark.
  285. /// Polynomials are of the 2001 vintage.
  286. /// </summary>
  287. kProjectionCodeSys34_01 = 66,
  288. /// <summary> Equidistant Cylindrical Projection, Ellipsoidal or Spherical. </summary>
  289. kProjectionCodeEdcylE = 67,
  290. /// <summary> Implementation of Plate Carree as a variation of the Equidistant Cylindrical. </summary>
  291. kProjectionCodePlateCarree = 68,
  292. /// <summary> Popular Visualization Pseudo Mercator (aka Google Earth). </summary>
  293. kProjectionCodePvMercator = 69,
  294. };
  295. /// <summary>
  296. /// brief Values that represent the linear or angular unit.
  297. /// </summary>
  298. ///
  299. enum Unit
  300. {
  301. /// <summary> the unit is not set. </summary>
  302. kUnitUnknown = 0,
  303. kUnitMeter = 1,
  304. kUnitFoot = 2,
  305. kUnitInch = 3,
  306. kUnitIFoot = 4,
  307. kUnitClarkeFoot = 5,
  308. kUnitIInch = 6,
  309. kUnitCentimeter = 7,
  310. kUnitKilometer = 8,
  311. kUnitYard = 9,
  312. kUnitSearsYard = 10,
  313. kUnitMile = 11,
  314. kUnitIYard = 12,
  315. kUnitIMile = 13,
  316. kUnitKnot = 14,
  317. kUnitNautM = 15,
  318. kUnitLat66 = 16,
  319. kUnitLat83 = 17,
  320. kUnitDecimeter = 18,
  321. kUnitMillimeter = 19,
  322. kUnitDekameter = 20,
  323. kUnitHectometer = 21,
  324. kUnitGermanMeter = 22,
  325. kUnitCaGrid = 23,
  326. kUnitClarkeChain = 24,
  327. kUnitGunterChain = 25,
  328. kUnitBenoitChain = 26,
  329. kUnitSearsChain = 27,
  330. kUnitClarkeLink = 28,
  331. kUnitGunterLink = 29,
  332. kUnitBenoitLink = 30,
  333. kUnitSearsLink = 31,
  334. kUnitRod = 32,
  335. kUnitPerch = 33,
  336. kUnitPole = 34,
  337. kUnitFurlong = 35,
  338. kUnitRood = 36,
  339. kUnitCapeFoot = 37,
  340. kUnitBrealey = 38,
  341. kUnitSearsFoot = 39,
  342. kUnitGoldCoastFoot = 40,
  343. kUnitMicroInch = 41,
  344. kUnitIndianYard = 42,
  345. kUnitIndianFoot = 43,
  346. kUnitIndianFt37 = 44,
  347. kUnitIndianFt62 = 45,
  348. kUnitIndianFt75 = 46,
  349. kUnitIndianYd37 = 47,
  350. kUnitDecameter = 48,
  351. kUnitInternationalChain = 49,
  352. kUnitInternationalLink = 50,
  353. kUnitDegree = 1001,
  354. kUnitGrad = 1002,
  355. kUnitGrade = 1003,
  356. kUnitMapInfo = 1004,
  357. kUnitMil = 1005,
  358. kUnitMinute = 1006,
  359. kUnitRadian = 1007,
  360. kUnitSecond = 1008,
  361. kUnitDecisec = 1009,
  362. kUnitCentisec = 1010,
  363. kUnitMillisec = 1011,
  364. };
  365. /// <summary>
  366. /// virtual destructor
  367. /// </summary>
  368. virtual ~AcDbGeoCoordinateSystem() {};
  369. /// <summary>
  370. /// Get this CRS's identifier string, which is also being referred to as a (coordinate system) code.
  371. /// The id returned always belongs to the ADSK namespace and is never prefixed.
  372. /// </summary>
  373. ///
  374. /// <param name="coordSysId">
  375. /// Input/output AcString object.
  376. /// </param>
  377. /// <returns>Returns Acad::eOk if successful.</returns>
  378. ///
  379. virtual Acad::ErrorStatus getId(AcString& coordSysId) const = 0;
  380. /// <summary>
  381. /// Get this CRS's EPSG code.
  382. /// </summary>
  383. ///
  384. /// <param name="epsgCode">
  385. /// Input/output integer.
  386. /// </param>
  387. /// <returns>Returns Acad::eOk if successful.</returns>
  388. ///
  389. virtual Acad::ErrorStatus getEpsgCode(int& epsgCode) const = 0;
  390. /// <summary>
  391. /// Get this CRS's type, e.g. geographic, projected, arbitrary etc.
  392. /// </summary>
  393. ///
  394. /// <param name="type">
  395. /// Input/output AcDbGeoCoordinateSystem::Type.
  396. /// </param>
  397. /// <returns>Returns Acad::eOk if successful.</returns>
  398. ///
  399. virtual Acad::ErrorStatus getType(AcDbGeoCoordinateSystem::Type& type) const = 0;
  400. /// <summary>
  401. /// Get this definition's description, if there's any.
  402. /// </summary>
  403. ///
  404. /// <param name="coordSysDesc">
  405. /// Input/output AcString object.
  406. /// </param>
  407. /// <returns>Returns Acad::eOk if successful.</returns>
  408. ///
  409. virtual Acad::ErrorStatus getDescription(AcString& coordSysDesc) const = 0;
  410. /// <summary>
  411. /// Gets the unit of the coordinate system axis of this CRS.
  412. /// All axis contains the same unit.
  413. /// </summary>
  414. ///
  415. /// <param name="unit">
  416. /// Input/output AcDb::UnitsValue. AcDb::kUnitsUndefined is set if the
  417. /// underlying spatial unit cannot be converted to AcDb::UnitsValue directly.
  418. /// </param>
  419. /// <returns>Returns Acad::eOk if successful.</returns>
  420. ///
  421. virtual Acad::ErrorStatus getUnit(AcDb::UnitsValue& unit) const = 0;
  422. /// <summary>
  423. /// Gets the unit of the coordinate system axis of this CRS.
  424. /// All axis contains the same unit.
  425. /// </summary>
  426. ///
  427. /// <param name="unit">
  428. /// Input/output AcDbGeoCoordinateSystem::Unit.
  429. /// </param>
  430. /// <returns>Returns Acad::eOk if successful.</returns>
  431. ///
  432. virtual Acad::ErrorStatus getUnit(AcDbGeoCoordinateSystem::Unit& unit) const = 0;
  433. /// <summary>
  434. /// Gets a factor, that the length units of this CRS instance must be
  435. /// multiplied with to calculate the equivalent in meters.
  436. /// If the CRS is geographic, this value represents the distance in meters of 1 deg
  437. /// measured along the equatorial great circle of the underlying ellipsoid.
  438. /// </summary>
  439. ///
  440. /// <param name="unitScale">
  441. /// Input/output double.
  442. /// </param>
  443. /// <returns>Returns Acad::eOk if successful.</returns>
  444. ///
  445. virtual Acad::ErrorStatus getUnitScale(double& unitScale) const = 0;
  446. /// <summary>
  447. /// Gets the projection method of this CRS.
  448. /// The projection is the conversion of the CRS..
  449. /// </summary>
  450. ///
  451. /// <param name="prjCode">
  452. /// Input/output AcDbGeoCoordinateSystem::ProjectionCode object.
  453. /// </param>
  454. /// <returns>Returns Acad::eOk if successful.</returns>
  455. ///
  456. virtual Acad::ErrorStatus getProjectionCode(AcDbGeoCoordinateSystem::ProjectionCode& prjCode) const = 0;
  457. /// <summary>
  458. /// Gets the projection parameters of this CRS.
  459. /// </summary>
  460. ///
  461. /// <param name="prjParams">
  462. /// Input/output array of AcDbGeoProjectionParameter object.
  463. /// </param>
  464. /// <param name="includeSpecialParams">
  465. /// Input boolean to indicate if the special projection parameters should be counted.
  466. /// The special projection parameters may include some of the followings:
  467. /// Origin Longitude
  468. /// Origin Latitude
  469. /// False Easting
  470. /// False Northing
  471. /// Scale Reduction
  472. /// </param>
  473. /// <returns>Returns Acad::eOk if successful.</returns>
  474. ///
  475. virtual Acad::ErrorStatus getProjectionParameters(AcArray<AcDbGeoProjectionParameter>& prjParams,
  476. bool includeSpecialParams) const = 0;
  477. /// <summary>
  478. /// Gets the datum, if any, this CRS is reference to.
  479. /// </summary>
  480. ///
  481. /// <param name="datum">
  482. /// Input/output AcDbGeoDatum object.
  483. /// </param>
  484. /// <returns>Returns Acad::eOk if successful.</returns>
  485. ///
  486. virtual Acad::ErrorStatus getDatum(AcDbGeoDatum& datum) const = 0;
  487. /// <summary>
  488. /// Gets the related ellipsoid.
  489. /// Note: When a CRS contains an ellipsoid it will not be geodetic and
  490. /// the datum reference will be nothing..
  491. /// </summary>
  492. ///
  493. /// <param name="ellipsoid">
  494. /// Input/output AcDbGeoEllipsoid object.
  495. /// </param>
  496. /// <returns>Returns Acad::eOk if successful.</returns>
  497. ///
  498. virtual Acad::ErrorStatus getEllipsoid(AcDbGeoEllipsoid& ellipsoid) const = 0;
  499. /// <summary>
  500. /// Gets the projection method parameter offset easting of this CRS.
  501. /// </summary>
  502. ///
  503. /// <param name="offsetVec">
  504. /// Input/output AcGeVector2d object.
  505. /// </param>
  506. /// <returns>Returns Acad::eOk if successful.</returns>
  507. ///
  508. virtual Acad::ErrorStatus getOffset(AcGeVector2d& offsetVec) const = 0;
  509. /// <summary>
  510. /// Get the Cartesian extent of this CRS's.
  511. /// </summary>
  512. ///
  513. /// <param name="exts">
  514. /// Input/output AcDbExtents2d object.
  515. /// </param>
  516. /// <returns>Returns Acad::eOk if successful.</returns>
  517. ///
  518. virtual Acad::ErrorStatus getCartesianExtents(AcDbExtents2d& exts) const = 0;
  519. /// <summary>
  520. /// Get the geodetic extent of this CRS's, the range of longitude and latitude.
  521. /// </summary>
  522. ///
  523. /// <param name="exts">
  524. /// Input/output AcDbExtents2d object.
  525. /// </param>
  526. /// <returns>Returns Acad::eOk if successful.</returns>
  527. ///
  528. virtual Acad::ErrorStatus getGeodeticExtents(AcDbExtents2d& exts) const = 0;
  529. /// <summary>
  530. /// Get the representation string of this CRS's in XML format.
  531. /// </summary>
  532. ///
  533. /// <param name="strXml">
  534. /// Input/output AcString object.
  535. /// </param>
  536. /// <returns>Returns Acad::eOk if successful.</returns>
  537. ///
  538. virtual Acad::ErrorStatus getXmlRepresentation(AcString& strXml) const = 0;
  539. /// <summary>
  540. /// Get the representation string of this CRS's in WKT format.
  541. /// </summary>
  542. ///
  543. /// <param name="strWkt">
  544. /// Input/output AcString object.
  545. /// </param>
  546. /// <returns>Returns Acad::eOk if successful.</returns>
  547. ///
  548. virtual Acad::ErrorStatus getWktRepresentation(AcString& strWkt) const = 0;
  549. /// <summary>
  550. /// Instantiates a new AcDbGeoCoordinateSystem object from the current virtual catalog.
  551. /// If no such CRS definition exists but the input string contains enough information(i.e. WKT or XML)
  552. /// for constructing a temporary AcDbGeoCoordinateSystem instance, this is being returned instead.
  553. /// </summary>
  554. /// <param name="coordSysIdOrFullDef">
  555. /// The ID, WKT or the (proprietary) XML representation of the CRS definition to load. Optionally, the string can be
  556. /// prefixed by the ID's namespace and a colon (:) where the following are supported: ADSK, EPSG, SRID, ORACLE. If no namespace
  557. /// has been specified, the ID is assumed to be a default Autodesk coordinate system identifier. If no definition exists with such a code
  558. /// and if it consists of numbers only, the ID string is considered an EPSG code.
  559. /// Valid examples are:
  560. /// - LL84 > Autodesk identifier (default)
  561. /// - ADSK:LL84 > Autodesk identifier
  562. /// - EPSG:4326 > EPSG identifier
  563. /// - SRID:4326 > Oracle SRID
  564. /// - ORACLE:8307 > Oracle SRID
  565. /// - 4326 > EPSG identifier
  566. /// - GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID[...]]] > WKT
  567. /// </param>
  568. /// <param name="pCoordSys">
  569. /// Input/output pointer to AcDbGeoCoordinateSystem object.
  570. /// Caller is responsible for deleting the returned object after use.
  571. /// </param>
  572. /// <returns>Returns Acad::eOk if successful.</returns>
  573. ///
  574. ACDB_PORT static Acad::ErrorStatus create(const AcString& coordSysIdOrFullDef,
  575. AcDbGeoCoordinateSystem*& pCoordSys);
  576. /// <summary>
  577. /// Instantiates a new AcDbGeoCoordinateSystem object for every existing,
  578. /// persistent project CRS definition from the current virtual catalog,
  579. /// when the passed in geodetic point within the geodetic extents of the CRS.
  580. /// </summary>
  581. ///
  582. /// <param name="geoPt">
  583. /// Input geodetic point in (longitude, latitude, altitude) format.
  584. /// </param>
  585. /// <param name="allCoordSys">
  586. /// Input/output array of AcDbGeoCoordinateSystem objects.
  587. /// Caller is responsible for deleting the returned AcDbGeoCoordinateSystem objects after use.
  588. /// </param>
  589. /// <returns>Returns Acad::eOk if successful.</returns>
  590. ///
  591. ACDB_PORT static Acad::ErrorStatus createAll(const AcGePoint3d& geoPt,
  592. AcArray<AcDbGeoCoordinateSystem*>& allCoordSys);
  593. /// <summary>
  594. /// Instantiates a new AcDbGeoCoordinateSystem object for every existing,
  595. /// persistent CRS definition from the specified catalog.
  596. /// </summary>
  597. ///
  598. /// <param name="allCoordSys">
  599. /// Input/output array of AcDbGeoCoordinateSystem objects.
  600. /// Caller is responsible for deleting the returned AcDbGeoCoordinateSystem objects after use.
  601. /// </param>
  602. /// <param name="pCategory">
  603. /// Input category.
  604. /// All existing and persistent CRS definitions are returned when pGategoery is NULL.
  605. /// </param>
  606. /// <returns>Returns Acad::eOk if successful.</returns>
  607. ///
  608. ACDB_PORT static Acad::ErrorStatus createAll(AcArray<AcDbGeoCoordinateSystem*>& allCoordSys,
  609. const AcDbGeoCoordinateSystemCategory* pCategory = NULL);
  610. };
  611. /// <summary>
  612. /// the AcDbGeoCoordinateSystemTransformer class represents a transformer object
  613. /// which is used to transform points from the source CRS to the target CRS.
  614. /// </summary>
  615. ///
  616. class AcDbGeoCoordinateSystemTransformer
  617. {
  618. public:
  619. /// <summary>
  620. /// virtual destructor
  621. /// </summary>
  622. virtual ~AcDbGeoCoordinateSystemTransformer() {};
  623. /// <summary>
  624. /// get the source CRS id.
  625. /// </summary>
  626. /// <param name="sourceCoordSysId">
  627. /// Input/output source CRS id.
  628. /// </param>
  629. /// <returns>Returns Acad::eOk if successful.</returns>
  630. ///
  631. virtual Acad::ErrorStatus getSourceCoordinateSystemId(AcString& sourceCoordSysId) const = 0;
  632. /// <summary>
  633. /// get the target CRS id.
  634. /// </summary>
  635. /// <param name="targetCoordSysId">
  636. /// Input/output target CRS id.
  637. /// </param>
  638. /// <returns>Returns Acad::eOk if successful.</returns>
  639. ///
  640. virtual Acad::ErrorStatus getTargetCoordinateSystemId(AcString& targetCoordSysId) const = 0;
  641. /// <summary>
  642. /// transform a point from source CRS to target CRS.
  643. /// </summary>
  644. /// <param name="pointIn">
  645. /// Input point in the source CRS.
  646. /// </param>
  647. /// <param name="pointOut">
  648. /// Output point in the target CRS.
  649. /// </param>
  650. /// <returns>Returns Acad::eOk if successful.</returns>
  651. ///
  652. virtual Acad::ErrorStatus transformPoint(const AcGePoint3d& pointIn, AcGePoint3d& pointOut) const = 0;
  653. /// <summary>
  654. /// transform a group of points from source CRS to target CRS.
  655. /// </summary>
  656. /// <param name="pointsIn">
  657. /// Input point array in the source CRS.
  658. /// </param>
  659. /// <param name="pointsOut">
  660. /// Output point array in the target CRS.
  661. /// </param>
  662. /// <returns>Returns Acad::eOk if successful.</returns>
  663. ///
  664. virtual Acad::ErrorStatus transformPoints(const AcGePoint3dArray& pointsIn, AcGePoint3dArray& pointsOut) const = 0;
  665. /// <summary>
  666. /// transform a group of points from source CRS to target CRS.
  667. /// </summary>
  668. /// <param name="sourceCoordSysId">
  669. /// Input source CRS id.
  670. /// </param>
  671. /// <param name="targetCoordSysId">
  672. /// Input target CRS id.
  673. /// </param>
  674. /// <param name="pointIn">
  675. /// Input point in the source CRS.
  676. /// </param>
  677. /// <param name="pointOut">
  678. /// Output point in the target CRS.
  679. /// </param>
  680. /// <returns>Returns Acad::eOk if successful.</returns>
  681. ///
  682. ACDB_PORT static Acad::ErrorStatus transformPoint(const AcString& sourceCoordSysId,
  683. const AcString& targetCoordSysId,
  684. const AcGePoint3d& pointIn,
  685. AcGePoint3d& pointOut);
  686. /// <summary>
  687. /// transform a point from source CRS to target CRS.
  688. /// </summary>
  689. /// <param name="sourceCoordSysId">
  690. /// Input source CRS id.
  691. /// </param>
  692. /// <param name="targetCoordSysId">
  693. /// Input target CRS id.
  694. /// </param>
  695. /// <param name="pointsIn">
  696. /// Input point array in the source CRS.
  697. /// </param>
  698. /// <param name="pointsOut">
  699. /// Output point array in the target CRS.
  700. /// </param>
  701. /// <returns>Returns Acad::eOk if successful.</returns>
  702. ///
  703. ACDB_PORT static Acad::ErrorStatus transformPoints(const AcString& sourceCoordSysId,
  704. const AcString& targetCoordSysId,
  705. const AcGePoint3dArray& pointsIn,
  706. AcGePoint3dArray& pointsOut);
  707. /// <summary>
  708. /// Instantiates a new AcDbGeoCoordinateSystemTransformer object
  709. /// from the source CRS and target CRS.
  710. /// </summary>
  711. /// <param name="sourceCoordSysId">
  712. /// Input source CRS id.
  713. /// </param>
  714. /// <param name="targetCoordSysId">
  715. /// Input target CRS id.
  716. /// </param>
  717. /// <returns>Returns Acad::eOk if successful.</returns>
  718. ///
  719. ACDB_PORT static Acad::ErrorStatus create(const AcString& sourceCoordSysId,
  720. const AcString& targetCoordSysId,
  721. AcDbGeoCoordinateSystemTransformer*& pCoordSysTransformer);
  722. };
  723. #pragma pack (pop)