/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _OD_DB_GEOCOORDINATESYSTEM_ #define _OD_DB_GEOCOORDINATESYSTEM_ #include "Ge/GeExtents2d.h" #include "DbDatabase.h" #include "Ge/GePoint3dArray.h" #include "TD_PackPush.h" class OdDbGeoCoordinateSystemCategory; class OdDbGeoCoordinateSystem; class OdDbGeoVerticalCoordinateSystem; class OdDbGeoCompoundCoordinateSystem; class OdDbGeoCoordinateSystemTransformer; typedef OdSmartPtr OdDbGeoCoordinateSystemCategoryPtr; typedef OdSmartPtr OdDbGeoCoordinateSystemPtr; typedef OdSmartPtr OdDbGeoVerticalCoordinateSystemPtr; typedef OdSmartPtr OdDbGeoCompoundCoordinateSystemPtr; typedef OdSmartPtr OdDbGeoCoordinateSystemTransformerPtr; struct OdDbGeoDatum { OdString id; OdString desc; }; struct OdDbGeoEllipsoid { OdString id; OdString desc; double polarRadius; double eccentricity; }; struct OdDbGeoProjectionParameter { OdString name; double value; }; /** \details This abstract class represents a category which holds string identifiers referring to a group of coordinate reference systems. */ class TOOLKIT_EXPORT OdDbGeoCoordinateSystemCategory : public OdRxObject { ODRX_DECLARE_MEMBERS(OdDbGeoCoordinateSystemCategory); public: /** \details Default constructor. */ OdDbGeoCoordinateSystemCategory(); /** \details Virtual destructor. */ virtual ~OdDbGeoCoordinateSystemCategory(); /** \details Returns the category's ID. \param sCategoryId [out] Category ID. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getId(OdString& sCategoryId) const = 0; /** \details Returns the number of coordinate systems that belong to this category. \param nNum [out] Number of coordinate systems. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getNumOfCoordinateSystem(int& nNum) const = 0; /** \details Returns the coordinate system at the specified index. \param nIndex [in] Index. \param pCoordSys [out] Pointer to an OdDbGeoCoordinateSystem object. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getCoordinateSystemAt(int nIndex, OdDbGeoCoordinateSystemPtr& pCoordSys) const = 0; /** \details Returns all coordinate system ids in a given array. \param arrIds [out] Array of coordinate system ids. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getCoordinateSystemIds(OdStringArray& arrIds) const = 0; /** \details Returns the number of vertical coordinate systems that belong to this category. \param nNum [out] Number of vertical coordinate systems. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getNumOfVerticalCoordinateSystem(int& nNum) const = 0; /** \details Returns the vertical coordinate system at the specified index. \param nIndex [in] Index. \param pCoordSys [out] Pointer to an OdDbGeoVerticalCoordinateSystem object. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getVerticalCoordinateSystemAt(int nIndex, OdDbGeoVerticalCoordinateSystemPtr& pCoordSys) const = 0; /** \details Returns all vertical coordinate system ids in a given array. \param arrIds [out] Array of vertical coordinate system ids. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getVerticalCoordinateSystemIds(OdStringArray& arrIds) const = 0; /** \details Creates and returns all coordinate system categories. \param arrCategories [out] Array of pointers to returned categories. \returns Returns eOK if successful, or an appropriate error code if not. */ static OdResult createAll(OdArray& arrCategories); }; /** \details This abstract class represents a coordinate reference system (CRS) definition. */ class TOOLKIT_EXPORT OdDbGeoCoordinateSystem : public OdRxObject { ODRX_DECLARE_MEMBERS(OdDbGeoCoordinateSystem); public: /** \details This enumeration indicates the type of a coordinate reference system. */ enum Type { kTypeUnknown = 0, // The coordinate system is not set. kTypeArbitrary = 1, // The coordinate system is arbitrary. kTypeGeographic = 2, // The coordinate system is geographic. kTypeProjected = 3 // The coordinate system is projected. }; /** \details This enumeration represents the coordinate reference system projection method types. */ enum ProjectionCode { kProjectionCodeUnknown = 0, // Unknown projection code. kProjectionCodeAlber = 4, // Albers equal-area conic projection. kProjectionCodeAzede = 59, // Azimuthal equidistant projection (elevated ellipsoid). kProjectionCodeAzmea = 11, // Lambert azimuthal equal-area projection. kProjectionCodeAzmed = 7, // Lambert azimuthal equidistant projection. kProjectionCodeBipolar = 31, // Bipolar oblique conformal conic projection. kProjectionCodeBonne = 24, // Bonne Pseudo Conical projection. kProjectionCodeCassini = 22, // Cassini projection. kProjectionCodeEckert4 = 25, // Eckert pseudocylindrical projection (number IV). kProjectionCodeEckert6 = 26, // Eckert pseudocylindrical projection (number VI). kProjectionCodeEdcnc = 12, // Equidistant conic projection (conic projection). kProjectionCodeEdcyl = 20, // Equidistant cylindrical projection (spherical only). kProjectionCodeGaussK = 46, // Gauss-Kruger: Transverse Mercator projection without scale reduction parameter. kProjectionCodeGnomonic = 19, // Gnomonic projection. kProjectionCodeGoode = 28, // Goode homolosine projection. kProjectionCodeHom1uv = 1281, // Unrectified Hotine Oblique Mercator Projection. Single point form. kProjectionCodeHom1xy = 1282, // Rectified Hotine Oblique Mercator Projection. Single poin form. kProjectionCodeHom2uv = 1283, // Unrectified Hotine Oblique Mercator Projection. Two point form. kProjectionCodeHom2xy = 1284, // Rectified Hotine Oblique Mercator Projection. Two point form. kProjectionCodeKrovak = 47, // Original Krovak projection. kProjectionCodeKrvk95 = 51, // Krovak projection includes 1995 adjustment. kProjectionCodeLL = 1, // Produces (processes) latitude and longitude. kProjectionCodeLm1sp = 36, // Single standard parallel variation of the Lambert Conformal Conic projection. kProjectionCodeLm2sp = 37, // Double standard parallel variation of the Lambert Conformal Conic projection. kProjectionCodeLmblg = 38, // Belgian variation of the Lambert Conformal Conic projection. kProjectionCodeLmtan = 8, // Lambert Tangential Conformal Conic projection. kProjectionCodeMiller = 13, // Miller cylindrical projection. kProjectionCodeMndotl = 41, // Minnesota DOT variation of the Lambert Conformal Conic projection. kProjectionCodeMndott = 42, // Minnesota DOT variation of the Transverse Mercator projection. kProjectionCodeModpc = 10, // Lallemand IMW Modified Polyconic projection. kProjectionCodeMollweid = 27, // Mollweide projection. kProjectionCodeMrcat = 6, // Mercator Cylindrical projection. kProjectionCodeMrcatK = 49, // Standard Mercator projection with a scale reduction factor instead of a standard parallel. kProjectionCodeMstero = 15, // Modified Stereographic projection. kProjectionCodeNeacyl = 29, // Normal aspect. Equal-area Cylindrical projection. kProjectionCodeNerth = 55, // Non-Earth projection. kProjectionCodeNzealand = 16, // New Zealand National Grid. kProjectionCodeOblqM = 5, // Oblique Mercator projection. kProjectionCodeObqcyl = 56, // Oblique Cylindrical projection. kProjectionCodeOrtho = 18, // Orthographic projection. kProjectionCodeOstn02 = 60, // Transverse Mercator projection with the OSTN02 grid shift tacked on. kProjectionCodeOstn97 = 58, // Transverse Mercator projection with the OSTN97 grid shift tacked on. kProjectionCodeOstro = 34, // Oblique Stereographic projection. kProjectionCodePlycn = 9, // Hassler American Polyconic projection. kProjectionCodePstro = 33, // Polar Stereographic projection. kProjectionCodePstrosl = 53, // Polar Stereographic projection with standard latitude. kProjectionCodeRskew = 1285, // Hotine Oblique Mercator (variant B) projection. kProjectionCodeRskewc = 1286, // Rectified Skew Orthomorphic projection, false origin and azimuth at center. kProjectionCodeRskewo = 1287, // Rectified Skew Orthomorphic projection. kProjectionCodeRobinson = 23, // Robinson Cylindrical projection. kProjectionCodeSinus = 17, // Sinusoidal projection. kProjectionCodeSotrm = 43, // Transverse Mercator south oriented projection. kProjectionCodeSstro = 35, // Synder's Oblique Stereographic projection. kProjectionCodeSwiss = 32, // Swiss projection. kProjectionCodeSys34 = 57, // Combination of Transverse Mercator projection and a polynomial expansion used in Denmark. kProjectionCodeSys34_99 = 61, // Combination of Transverse Mercator projection and a polynomial expansion used in Denmark. Polynomials are of the 1999 vintage. kProjectionCodeTeacyl = 30, // Transverse aspect. Equal-area Cylindrical projection. kProjectionCodeTm = 3, // Gauss-Kruger or Transverse Mercator Projection. kProjectionCodeTrmeraf = 54, // Transverse Mercator projection with affine post-processor. kProjectionCodeTrmrkrg = 62, // Transverse Mercator projection using Kruger formulation. kProjectionCodeTrmrs = 45, // Transverse Mercator projection per J. P. Snyder. kProjectionCodeVdgrntn = 21, // Van der Grinten projection. kProjectionCodeWccsl = 39, // Wisconsin County Coordinate System variation; Lambert Conformal Conic projection. kProjectionCodeWccst = 40, // Wisconsin County Coordinate System variation; Transverse Mercator projection. kProjectionCodeUtm = 44, // The UTM direct variation of the Transverse Mercator projection. kProjectionCodeWinkl = 63, // Winkel Tripel projection. kProjectionCodeNrthsrt = 64, // North with scale and rotation projection. kProjectionCodeLmbrtaf = 65, // Lambert Conformal Conic projection with affine post-processor. kProjectionCodeSys34_01 = 66, // Combination of Transverse Mercator projection and polynomial expansion used in Denmark. kProjectionCodeEdcylE = 67, // Equidistant Cylindrical projection, Ellipsoidal or Spherical. kProjectionCodePlateCarree = 68, // Plate Carré projection. kProjectionCodePvMercator = 69, // Popular Visualisation Pseudo Mercator projection (Google Earth). kProjectionCodeLmMich = 70, // Lambert Conic Conformal (2SP Michigan) projection. }; /** \details This enumeration represents the linear or angular unit. */ enum Unit { kUnitUnknown = 0, kUnitMeter = 1, kUnitFoot = 2, kUnitInch = 3, kUnitIFoot = 4, kUnitClarkeFoot = 5, kUnitIInch = 6, kUnitCentimeter = 7, kUnitKilometer = 8, kUnitYard = 9, kUnitSearsYard = 10, kUnitMile = 11, kUnitIYard = 12, kUnitIMile = 13, kUnitKnot = 14, kUnitNautM = 15, kUnitLat66 = 16, kUnitLat83 = 17, kUnitDecimeter = 18, kUnitMillimeter = 19, kUnitDekameter = 20, kUnitHectometer = 21, kUnitGermanMeter = 22, kUnitCaGrid = 23, kUnitClarkeChain = 24, kUnitGunterChain = 25, kUnitBenoitChain = 26, kUnitSearsChain = 27, kUnitClarkeLink = 28, kUnitGunterLink = 29, kUnitBenoitLink = 30, kUnitSearsLink = 31, kUnitRod = 32, kUnitPerch = 33, kUnitPole = 34, kUnitFurlong = 35, kUnitRood = 36, kUnitCapeFoot = 37, kUnitBrealey = 38, kUnitSearsFoot = 39, kUnitGoldCoastFoot = 40, kUnitMicroInch = 41, kUnitIndianYard = 42, kUnitIndianFoot = 43, kUnitIndianFt37 = 44, kUnitIndianFt62 = 45, kUnitIndianFt75 = 46, kUnitIndianYd37 = 47, kUnitDecameter = 48, kUnitInternationalChain = 49, kUnitInternationalLink = 50, kUnitBrFootTrunc = 51, kUnitBrChainTrunc = 52, kUnitBrLinkTrunc = 53, kUnitDegree = 1001, kUnitGrad = 1002, kUnitGrade = 1003, kUnitMapInfo = 1004, kUnitMil = 1005, kUnitMinute = 1006, kUnitRadian = 1007, kUnitSecond = 1008, kUnitDecisec = 1009, kUnitCentisec = 1010, kUnitMillisec = 1011, }; /** \details This enumeration represents the status of a coordinate reference system. */ enum StatusType { kStatusTypeOutOfDate = 1, // The coordinate system is out of date. kStatusTypeUpToDate = 2, // The coordinate system is up to date. kStatusTypeUserDefined = 3 // The coordinate system is user defined. }; /** \details Default constructor. */ OdDbGeoCoordinateSystem(); /** \details Virtual destructor. */ virtual ~OdDbGeoCoordinateSystem(); /** \details Returns the coordinate reference system's identifier string. \param sCoordSysId [out] Coordinate reference system's identifier. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getId(OdString& sCoordSysId) const = 0; /** \details Returns this CRS's EPSG code. \param nEpsgCode [out] EPSG code. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getEpsgCode(int& nEpsgCode) const = 0; /** \details Returns this CRS's type. \param eType [out] CRS's type. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getType(OdDbGeoCoordinateSystem::Type& eType) const = 0; /** \details Returns the description of this CRS. \param sDescription [out] CRS's description. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getDescription(OdString& sDescription) const = 0; /** \details Returns the source of this CRS. \param sSource [out] CRS's source. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getSource(OdString& sSource) const = 0; /** \details Returns the unit of the coordinate system axis of this CRS. \param eUnitsValue [out] Unit value. \returns Returns eOK if successful, or an appropriate error code if not. \remarks All axis contains the same unit. */ virtual OdResult getUnit(OdDb::UnitsValue& eUnitsValue) const = 0; /** \details Returns the unit of the coordinate system axis of this CRS. \param eUnit [out] Unit value. \returns Returns eOK if successful, or an appropriate error code if not. \remarks Each axis contains the same unit. */ virtual OdResult getUnit(OdDbGeoCoordinateSystem::Unit& eUnit) const = 0; /** \details Returns the unit of the coordinate system axis of this CRS. \param sUnit [out] Unit value. \returns Returns eOK if successful, or an appropriate error code if not. \remarks Each axis contains the same unit. */ virtual OdResult getUnit(OdString& sUnit) const = 0; /** \details Returns the factor that is used for multiplying the length units of this CRS for calculating the equivalent in meters. \param dUnitScale [out] Scale factor. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getUnitScale(double& dUnitScale) const = 0; /** \details Returns the projection method of this CRS. \param ePrjCode [out] Projection method. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getProjectionCode(OdDbGeoCoordinateSystem::ProjectionCode& ePrjCode) const = 0; /** \details Returns the projection parameters of this CRS. \param arrPrjParams [out] Projection parameters. \param bIncludeSpecialParams [in] Boolean flag that indicates if the special projection parameters should be counted. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getProjectionParameters(OdArray& arrPrjParams, bool bIncludeSpecialParams) const = 0; /** \details Returns the datum of this CRS. \param datum [out] Datum value. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getDatum(OdDbGeoDatum& datum) const = 0; /** \details Returns the datum id, if any, this CRS is reference to. \param sDatumId [out] Datum id. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getDatumId(OdString& sDatumId) const = 0; /** \details Returns the ellipsoid related to this CRS. \param ellipsoid [out] Ellipsoid. \returns Returns eOK if successful, or an appropriate error code if not. \remarks If the CRS contains an ellipsoid, it will not be geodetic and the datum reference will not have a value. */ virtual OdResult getEllipsoid(OdDbGeoEllipsoid& ellipsoid) const = 0; /** \details Returns the projection method parameter offset easting of this CRS. \param vOffset [out] Offset vector. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getOffset(OdGeVector2d& vOffset) const = 0; /** \details Returns the cartesian extents of this CRS. \param exts [out] Extents. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getCartesianExtents(OdGeExtents2d& exts) const = 0; /** \details Returns the geodetic extents of this CRS, the range of longitude and latitude. \param exts [out] Extents. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getGeodeticExtents(OdGeExtents2d& exts) const = 0; /** \details Returns the string in XML format that represents this CRS. \param sXml [out] CRS's representation in XML format. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getXmlRepresentation(OdString& sXml) const = 0; /** \details Returns the string in WKT format that represents this CRS. \param sWkt [out] CRS's representation in WKT format. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getWktRepresentation(OdString& sWkt) const = 0; /** \details Returns the status of the coordinate system. \param eStatusType [out] status. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getStatus(OdDbGeoCoordinateSystem::StatusType& eStatusType) const = 0; /** \details Creates and returns a new OdDbGeoCoordinateSystem object from the current virtual catalog. \param sCoordSysIdOrFullDef [in] ID, WKT or XML representation of the CRS definition to load. \param pCoordSys [out] New CRS. \returns Returns eOK if successful, or an appropriate error code if not. */ static OdResult create(const OdString& sCoordSysIdOrFullDef, OdDbGeoCoordinateSystemPtr& pCoordSys); /** \details Creates and returns a new OdDbGeoCoordinateSystem object for every existing, persistent projected CRS definition from the current virtual catalog when the passed in geodetic point is within the geodetic extents of the CRS. \param ptGeo [in] Geodetic point (Longitude, Latitude, Altitude). \param arrCoordSys [out] Array of pointers to the new CRS objects. \returns Returns eOK if successful, or an appropriate error code if not. */ static OdResult createAll(const OdGePoint3d& ptGeo, OdArray& arrCoordSys); /** \details Creates and returns a new OdDbGeoCoordinateSystem object for every existing, persistent CRS definition from the specified catalog. \param arrCoordSys [out] Array of pointers to the new CRS objects. \param pCategory [in] Category. \returns Returns eOK if successful, or an appropriate error code if not. \remarks If pCategory is NULL, all existing and persistent CRS definitions are returned. */ static OdResult createAll(OdArray& arrCoordSys, const OdDbGeoCoordinateSystemCategory* pCategory = NULL); }; /** \details This abstract class represents a vertical coordinate reference system (vertical CRS) definition. A vertical CRS is also being referred to as a spatial reference system (SRS). */ class TOOLKIT_EXPORT OdDbGeoVerticalCoordinateSystem : public OdRxObject { ODRX_DECLARE_MEMBERS(OdDbGeoVerticalCoordinateSystem); public: /** \details This enumeration indicates the type of a vertical coordinate reference system. */ enum Type { kTypeUnknown = 0, // The coordinate system is not set. kTypeEllipsoidal = 1, // The coordinate system is ellipsoidal. kTypeGeoidModelDerived = 2 // The coordinate system is geoid model derived. }; /** \details This enumeration indicates the axis direction of a vertical coordinate reference system. */ enum AxisDirection { kAxisDirectionUnknown = 0, // The axis direction is not set. kAxisDirectionUp = 1, // The positive direction of the axis is up. kAxisDirectionDown = 2 // the positive direction of the axis is down. }; /** \details Default constructor. */ OdDbGeoVerticalCoordinateSystem(); /** \details Virtual destructor. */ virtual ~OdDbGeoVerticalCoordinateSystem(); /** \details Returns the vertical CRS's identifier string. \param sCoordSysId [out] Coordinate reference system's identifier. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getId(OdString& sCoordSysId) const = 0; /** \details Returns this vertical CRS's EPSG code. \param nEpsgCode [out] EPSG code. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getEpsgCode(int& nEpsgCode) const = 0; /** \details Returns this vertical CRS's type. \param eType [out] vertical CRS's type. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getType(OdDbGeoVerticalCoordinateSystem::Type& eType) const = 0; /** \details Returns the description of this vertical CRS. \param sDescription [out] Description. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getDescription(OdString& sDescription) const = 0; /** \details Returns the direction of the axis of this vertical CRS. \param eAxisDirection [out] Axis direction. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getAxisDirection(OdDbGeoVerticalCoordinateSystem::AxisDirection& eAxisDirection) const = 0; /** \details Returns the unit of the axis of this vertical CRS. \param eUnitsValue [out] Unit value. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getUnit(OdDb::UnitsValue& eUnitsValue) const = 0; /** \details Returns the unit of the axis of this vertical CRS. \param eUnit [out] Unit value. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getUnit(OdDbGeoCoordinateSystem::Unit& eUnit) const = 0; /** \details Returns the factor that is used for multiplying the length units of this vertical CRS for calculating the equivalent in meters. \param dUnitScale [out] Scale factor. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getUnitScale(double& dUnitScale) const = 0; /** \details Returns the datum of this vertical CRS. \param datum [out] Datum value. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getDatum(OdDbGeoDatum& datum) const = 0; /** \details Returns the datum id, if any, this vertical CRS is reference to. \param sDatumId [out] Datum id. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getDatumId(OdString& sDatumId) const = 0; /** \details Returns the geodetic extents of this vertical CRS, the range of longitude and latitude. \param exts [out] Extents. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getGeodeticExtents(OdGeExtents2d& exts) const = 0; /** \details Returns the string in XML format that represents this vertical CRS. \param sXml [out] Vertical CRS's representation in XML format. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getXmlRepresentation(OdString& sXml) const = 0; /** \details Returns the status of the coordinate system. \param eStatusType [out] status. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getStatus(OdDbGeoCoordinateSystem::StatusType& eStatusType) const = 0; /** \details Creates and returns a new OdDbGeoVerticalCoordinateSystem object from the current virtual catalog. \param sCoordSysIdOrFullDef [in] ID, WKT or XML representation of the CRS definition to load. \param pCoordSys [out] New CRS. \returns Returns eOK if successful, or an appropriate error code if not. */ static OdResult create(const OdString& sCoordSysIdOrFullDef, OdDbGeoVerticalCoordinateSystemPtr& pCoordSys); /** \details Creates and returns a new OdDbGeoVerticalCoordinateSystem object for every existing, persistent verical CRS definition from the current virtual catalog. \param arrCoordSys [out] Array of pointers to the new CRS objects. \param pCategory [in] Category. \returns Returns eOK if successful, or an appropriate error code if not. \remarks If pCategory is NULL, all existing and persistent CRS definitions are returned. */ static OdResult createAll(OdArray& arrCoordSys, const OdDbGeoCoordinateSystemCategory* pCategory = NULL); }; /** \details This abstract class represents a compound coordinate reference system. Compound CRS consists of a horizontal geodetic coordinate system and a vertical coordinate system. */ class TOOLKIT_EXPORT OdDbGeoCompoundCoordinateSystem : public OdRxObject { ODRX_DECLARE_MEMBERS(OdDbGeoCompoundCoordinateSystem); public: /** \details Default constructor. */ OdDbGeoCompoundCoordinateSystem(); /** \details Virtual destructor. */ virtual ~OdDbGeoCompoundCoordinateSystem(); /** \details Returns the geodetic coordinate system. \param pCoordSys [out] Geodetic CRS. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getGeodeticCoordinateSystem(OdDbGeoCoordinateSystemPtr& pCoordSys) const = 0; /** \details Returns the vertical coordinate system. \param pCoordSys [out] Vertical CRS. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getVerticalCoordinateSystem(OdDbGeoVerticalCoordinateSystemPtr& pCoordSys) const = 0; /** \details Returns the string in XML format that represents this compound CRS. \param sXml [out] compaund CRS's representation in XML format. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getXmlRepresentation(OdString& sXml) const = 0; /** \details Returns the string in WKT format that represents this compound CRS. \param sWkt [out] compound CRS's representation in WKT format. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getWktRepresentation(OdString& sWkt) const = 0; /** \details Creates and returns a new OdDbGeoCompoundCoordinateSystem object from the current virtual catalog. The ID - is either only a geodetic CRS or contains geodetic and vertical CRS delimited by the plus sign (+). The WKT - for vertical CRS is not supported yet. The XML - must contain a geodetic CRS, vertical CRS is optional. If the vertical CRS is provided, but it is not valid, creation will fall. Valid examples: - LL84+EGM2008_height - LL84 \param sCoordSysIdOrFullDef [in] ID, WKT or XML representation of the CRS definition to load. \param pCoordSys [out] New CRS. \returns Returns eOK if successful, or an appropriate error code if not. */ static OdResult create(const OdString& sCoordSysIdOrFullDef, OdDbGeoCompoundCoordinateSystemPtr& pCoordSys); /** \details Checks if the geodetic CRS and vertical CRS can be compound together. \param sCoordSysId [in] Geodetic CRS. \param sVerticalCoordSysId [in] Vertical CRS. \returns Returns eOK if successful, or an appropriate error code if not. \remarks If pCategory is NULL, all existing and persistent CRS definitions are returned. */ static OdResult verify(const OdString& sCoordSysId, const OdString& sVerticalCoordSysId); }; /** \details This abstract class represents a transformer object which is used to transform points from the source CRS to the target CRS. */ class TOOLKIT_EXPORT OdDbGeoCoordinateSystemTransformer : public OdRxObject { ODRX_DECLARE_MEMBERS(OdDbGeoCoordinateSystemTransformer); public: /** \details Default constructor. */ OdDbGeoCoordinateSystemTransformer(); /** \details Virtual destructor. */ virtual ~OdDbGeoCoordinateSystemTransformer(); /** \details Returns the source CRS's ID. \param sSourceCoordSysId [out] Source CRS's ID. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getSourceCoordinateSystemId(OdString& sSourceCoordSysId) const = 0; /** \details Returns the target CRS's ID. \param sTargetCoordSysId [out] Target CRS's ID. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult getTargetCoordinateSystemId(OdString& sTargetCoordSysId) const = 0; /** \details Transforms the point from the source CRS to the target CRS. \param ptIn [in] Point in the source CRS. \param ptOut [out] Point in the target CRS. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult transformPoint(const OdGePoint3d& ptIn, OdGePoint3d& ptOut) const = 0; /** \details Transforms the array of points from the source CRS to the target CRS. \param arrPtIn [in] Point array in the source CRS. \param arrPtOut [out] Point array in the target CRS. \returns Returns eOK if successful, or an appropriate error code if not. */ virtual OdResult transformPoints(const OdGePoint3dArray& arrPtIn, OdGePoint3dArray& arrPtOut) const = 0; /** \details Transforms the point from the source CRS to the target CRS. \param sSourceCoordSysId [in] Source CRS's ID. \param sTargetCoordSysId [in] Target CRS's ID. \param ptIn [in] Point in the source CRS. \param ptOut [out] Point in the target CRS. \returns Returns eOK if successful, or an appropriate error code if not. */ static OdResult transformPoint(const OdString& sSourceCoordSysId, const OdString& sTargetCoordSysId, const OdGePoint3d& ptIn, OdGePoint3d& ptOut); /** \details Transforms the array of points from the source CRS to the target CRS. \param sSourceCoordSysId [in] Source CRS's ID. \param sTargetCoordSysId [in] Target CRS's ID. \param arrPtIn [in] Point array in the source CRS. \param arrPtOut [out] Point array in the target CRS. \returns Returns eOK if successful, or an appropriate error code if not. */ static OdResult transformPoints(const OdString& sSourceCoordSysId, const OdString& sTargetCoordSysId, const OdGePoint3dArray& arrPtIn, OdGePoint3dArray& arrPtOut); /** \details Creates a new OdDbGeoCoordinateSystemTransformer object from the source CRS and target CRS. \param sSourceCoordSysId [in] Source CRS's ID. \param sTargetCoordSysId [in] Target CRS's ID. \param pCoordSysTransformer [out] New OdDbGeoCoordinateSystemTransformer object. \returns Returns eOK if successful, or an appropriate error code if not. */ static OdResult create(const OdString& sSourceCoordSysId, const OdString& sTargetCoordSysId, OdDbGeoCoordinateSystemTransformerPtr& pCoordSysTransformer); }; #include "TD_PackPop.h" #endif //_OD_DB_GEOCOORDINATESYSTEM_