Package org.gdal.osr

## Class osr

- java.lang.Object
- - org.gdal.osr.osr

- All Implemented Interfaces:
    `osrConstants`

      public class osr
      extends java.lang.Object
      implements osrConstants

  Class with static methods for utility functions.

- - ### Field Summary

    - ### Fields inherited from interface org.gdal.osr.osrConstants

      `OAMS_AUTHORITY_COMPLIANT, OAMS_CUSTOM, OAMS_TRADITIONAL_GIS_ORDER, OAO_Down, OAO_East, OAO_North, OAO_Other, OAO_South, OAO_Up, OAO_West, PROJ_ERR_COORD_TRANSFM, PROJ_ERR_COORD_TRANSFM_GRID_AT_NODATA, PROJ_ERR_COORD_TRANSFM_INVALID_COORD, PROJ_ERR_COORD_TRANSFM_NO_OPERATION, PROJ_ERR_COORD_TRANSFM_OUTSIDE_GRID, PROJ_ERR_COORD_TRANSFM_OUTSIDE_PROJECTION_DOMAIN, PROJ_ERR_INVALID_OP, PROJ_ERR_INVALID_OP_FILE_NOT_FOUND_OR_INVALID, PROJ_ERR_INVALID_OP_ILLEGAL_ARG_VALUE, PROJ_ERR_INVALID_OP_MISSING_ARG, PROJ_ERR_INVALID_OP_MUTUALLY_EXCLUSIVE_ARGS, PROJ_ERR_INVALID_OP_WRONG_SYNTAX, PROJ_ERR_OTHER, PROJ_ERR_OTHER_API_MISUSE, PROJ_ERR_OTHER_NETWORK_ERROR, PROJ_ERR_OTHER_NO_INVERSE_OP, SRS_DN_NAD27, SRS_DN_NAD83, SRS_DN_WGS72, SRS_DN_WGS84, SRS_PM_GREENWICH, SRS_PP_AZIMUTH, SRS_PP_CENTRAL_MERIDIAN, SRS_PP_FALSE_EASTING, SRS_PP_FALSE_NORTHING, SRS_PP_FIPSZONE, SRS_PP_LANDSAT_NUMBER, SRS_PP_LATITUDE_OF_1ST_POINT, SRS_PP_LATITUDE_OF_2ND_POINT, SRS_PP_LATITUDE_OF_CENTER, SRS_PP_LATITUDE_OF_ORIGIN, SRS_PP_LATITUDE_OF_POINT_1, SRS_PP_LATITUDE_OF_POINT_2, SRS_PP_LATITUDE_OF_POINT_3, SRS_PP_LONGITUDE_OF_1ST_POINT, SRS_PP_LONGITUDE_OF_2ND_POINT, SRS_PP_LONGITUDE_OF_CENTER, SRS_PP_LONGITUDE_OF_ORIGIN, SRS_PP_LONGITUDE_OF_POINT_1, SRS_PP_LONGITUDE_OF_POINT_2, SRS_PP_LONGITUDE_OF_POINT_3, SRS_PP_PATH_NUMBER, SRS_PP_PEG_POINT_HEADING, SRS_PP_PEG_POINT_HEIGHT, SRS_PP_PEG_POINT_LATITUDE, SRS_PP_PEG_POINT_LONGITUDE, SRS_PP_PERSPECTIVE_POINT_HEIGHT, SRS_PP_PSEUDO_STD_PARALLEL_1, SRS_PP_RECTIFIED_GRID_ANGLE, SRS_PP_SATELLITE_HEIGHT, SRS_PP_SCALE_FACTOR, SRS_PP_STANDARD_PARALLEL_1, SRS_PP_STANDARD_PARALLEL_2, SRS_PP_ZONE, SRS_PT_AITOFF, SRS_PT_ALBERS_CONIC_EQUAL_AREA, SRS_PT_AZIMUTHAL_EQUIDISTANT, SRS_PT_BONNE, SRS_PT_CASSINI_SOLDNER, SRS_PT_CRASTER_PARABOLIC, SRS_PT_CYLINDRICAL_EQUAL_AREA, SRS_PT_ECKERT_I, SRS_PT_ECKERT_II, SRS_PT_ECKERT_III, SRS_PT_ECKERT_IV, SRS_PT_ECKERT_V, SRS_PT_ECKERT_VI, SRS_PT_EQUIDISTANT_CONIC, SRS_PT_EQUIRECTANGULAR, SRS_PT_GALL_STEREOGRAPHIC, SRS_PT_GAUSSSCHREIBERTMERCATOR, SRS_PT_GEOSTATIONARY_SATELLITE, SRS_PT_GNOMONIC, SRS_PT_GOODE_HOMOLOSINE, SRS_PT_HOTINE_OBLIQUE_MERCATOR, SRS_PT_HOTINE_OBLIQUE_MERCATOR_AZIMUTH_CENTER, SRS_PT_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN, SRS_PT_IGH, SRS_PT_IMW_POLYCONIC, SRS_PT_KROVAK, SRS_PT_LABORDE_OBLIQUE_MERCATOR, SRS_PT_LAMBERT_AZIMUTHAL_EQUAL_AREA, SRS_PT_LAMBERT_CONFORMAL_CONIC_1SP, SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP, SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP_BELGIUM, SRS_PT_LOXIMUTHAL, SRS_PT_MERCATOR_1SP, SRS_PT_MERCATOR_2SP, SRS_PT_MERCATOR_AUXILIARY_SPHERE, SRS_PT_MILLER_CYLINDRICAL, SRS_PT_MOLLWEIDE, SRS_PT_NEW_ZEALAND_MAP_GRID, SRS_PT_OBLIQUE_STEREOGRAPHIC, SRS_PT_ORTHOGRAPHIC, SRS_PT_POLAR_STEREOGRAPHIC, SRS_PT_POLYCONIC, SRS_PT_QSC, SRS_PT_QUARTIC_AUTHALIC, SRS_PT_ROBINSON, SRS_PT_SCH, SRS_PT_SINUSOIDAL, SRS_PT_STEREOGRAPHIC, SRS_PT_SWISS_OBLIQUE_CYLINDRICAL, SRS_PT_TRANSVERSE_MERCATOR, SRS_PT_TRANSVERSE_MERCATOR_MI_21, SRS_PT_TRANSVERSE_MERCATOR_MI_22, SRS_PT_TRANSVERSE_MERCATOR_MI_23, SRS_PT_TRANSVERSE_MERCATOR_MI_24, SRS_PT_TRANSVERSE_MERCATOR_MI_25, SRS_PT_TRANSVERSE_MERCATOR_SOUTH_ORIENTED, SRS_PT_TUNISIA_MINING_GRID, SRS_PT_TWO_POINT_EQUIDISTANT, SRS_PT_VANDERGRINTEN, SRS_PT_WAGNER_I, SRS_PT_WAGNER_II, SRS_PT_WAGNER_III, SRS_PT_WAGNER_IV, SRS_PT_WAGNER_V, SRS_PT_WAGNER_VI, SRS_PT_WAGNER_VII, SRS_PT_WINKEL_I, SRS_PT_WINKEL_II, SRS_PT_WINKEL_TRIPEL, SRS_UA_DEGREE, SRS_UA_DEGREE_CONV, SRS_UA_RADIAN, SRS_UL_CENTIMETER, SRS_UL_CENTIMETER_CONV, SRS_UL_CHAIN, SRS_UL_CHAIN_CONV, SRS_UL_DECIMETER, SRS_UL_DECIMETER_CONV, SRS_UL_FOOT, SRS_UL_FOOT_CONV, SRS_UL_INDIAN_CHAIN, SRS_UL_INDIAN_CHAIN_CONV, SRS_UL_INDIAN_FOOT, SRS_UL_INDIAN_FOOT_CONV, SRS_UL_INDIAN_YARD, SRS_UL_INDIAN_YARD_CONV, SRS_UL_INTL_CHAIN, SRS_UL_INTL_CHAIN_CONV, SRS_UL_INTL_FATHOM, SRS_UL_INTL_FATHOM_CONV, SRS_UL_INTL_FOOT, SRS_UL_INTL_FOOT_CONV, SRS_UL_INTL_INCH, SRS_UL_INTL_INCH_CONV, SRS_UL_INTL_LINK, SRS_UL_INTL_LINK_CONV, SRS_UL_INTL_NAUT_MILE, SRS_UL_INTL_NAUT_MILE_CONV, SRS_UL_INTL_STAT_MILE, SRS_UL_INTL_STAT_MILE_CONV, SRS_UL_INTL_YARD, SRS_UL_INTL_YARD_CONV, SRS_UL_KILOMETER, SRS_UL_KILOMETER_CONV, SRS_UL_LINK, SRS_UL_LINK_Clarke, SRS_UL_LINK_Clarke_CONV, SRS_UL_LINK_CONV, SRS_UL_METER, SRS_UL_MILLIMETER, SRS_UL_MILLIMETER_CONV, SRS_UL_NAUTICAL_MILE, SRS_UL_NAUTICAL_MILE_CONV, SRS_UL_ROD, SRS_UL_ROD_CONV, SRS_UL_US_CHAIN, SRS_UL_US_CHAIN_CONV, SRS_UL_US_FOOT, SRS_UL_US_FOOT_CONV, SRS_UL_US_INCH, SRS_UL_US_INCH_CONV, SRS_UL_US_STAT_MILE, SRS_UL_US_STAT_MILE_CONV, SRS_UL_US_YARD, SRS_UL_US_YARD_CONV, SRS_WGS84_INVFLATTENING, SRS_WGS84_SEMIMAJOR, SRS_WKT_WGS84_LAT_LONG`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static CoordinateTransformation` | `CreateCoordinateTransformation​(SpatialReference src, SpatialReference dst)` | Create transformation object.
    `static CoordinateTransformation` | `CreateCoordinateTransformation​(SpatialReference src, SpatialReference dst, CoordinateTransformationOptions options)` |
    `static void` | `DontUseExceptions()` | Use return code instead of exceptions.
    `static java.util.Vector` | `GetAuthorityListFromDatabase()` |
    `static java.util.Vector` | `GetPROJAuxDbPaths()` |
    `static boolean` | `GetPROJEnableNetwork()` |
    `static java.util.Vector` | `GetPROJSearchPaths()` |
    `static int` | `GetPROJVersionMajor()` |
    `static int` | `GetPROJVersionMicro()` |
    `static int` | `GetPROJVersionMinor()` |
    `static boolean` | `GetUseExceptions()` |
    `static java.lang.String` | `GetUserInputAsWKT​(java.lang.String definition)` | Utility function that returns the WKT definition of the SRS expressed as a user input.
    `static int` | `GetUserInputAsWKT​(java.lang.String name, java.lang.String[] argout)` |
    `static java.lang.String` | `GetWellKnownGeogCSAsWKT​(java.lang.String definition)` | Utility function that returns the WKT definition of the SRS expressed as a well known Geog CS.
    `static int` | `GetWellKnownGeogCSAsWKT​(java.lang.String name, java.lang.String[] argout)` |
    `static double` | `OSRAreaOfUse_east_lon_degree_get​(AreaOfUse area)` |
    `static java.lang.String` | `OSRAreaOfUse_name_get​(AreaOfUse area)` |
    `static double` | `OSRAreaOfUse_north_lat_degree_get​(AreaOfUse area)` |
    `static double` | `OSRAreaOfUse_south_lat_degree_get​(AreaOfUse area)` |
    `static double` | `OSRAreaOfUse_west_lon_degree_get​(AreaOfUse area)` |
    `static void` | `SetPROJAuxDbPath​(java.lang.String utf8_path)` |
    `static void` | `SetPROJAuxDbPaths​(java.util.Vector paths)` |
    `static void` | `SetPROJEnableNetwork​(boolean enabled)` |
    `static void` | `SetPROJSearchPath​(java.lang.String utf8_path)` |
    `static void` | `SetPROJSearchPaths​(java.util.Vector paths)` |
    `static void` | `UseExceptions()` | Use exceptions instead of error return codes.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### UseExceptions

          public static void UseExceptions()

      Use exceptions instead of error return codes.

      This is the default behavior : methods that in C/C++ return an OGRErr return code would throw a RuntimeException() in case the code it is different from ogr.OGRERR_NONE. By calling this method, you can get back to that original state if DontUseExceptions() was called in-between. This will only apply to the org.gdal.osr.* package.

      Since:
        Java bindings 1.7.0

    - #### DontUseExceptions

          public static void DontUseExceptions()

      Use return code instead of exceptions.

      By default, methods that in C/C++ return an OGRErr return code would throw a RuntimeException() in case the code is different from ogr.OGRERR_NONE. By calling this method, you can prevent the exception to be thrown and get the original error code (ogr.OGRERR_* codes) This will only apply to the org.gdal.osr.* package.

      Since:
        Java bindings 1.7.0

    - #### GetUseExceptions

          public static boolean GetUseExceptions()

    - #### GetWellKnownGeogCSAsWKT

          public static java.lang.String GetWellKnownGeogCSAsWKT​(java.lang.String definition)

      Utility function that returns the WKT definition of the SRS expressed as a well known Geog CS.

      Such a user input is what can be passed in to SpatialReference.SetWellKnownGeogCS().

      Parameters:
        `definition` - text definition to try to deduce SRS from.
      Returns:
        WKT definition

    - #### GetUserInputAsWKT

          public static java.lang.String GetUserInputAsWKT​(java.lang.String definition)

      Utility function that returns the WKT definition of the SRS expressed as a user input.

      Such a user input is what can be passed in to SpatialReference.SetFromUserInput().

      Parameters:
        `definition` - text definition to try to deduce SRS from.
      Returns:
        WKT definition

    - #### GetWellKnownGeogCSAsWKT

          public static int GetWellKnownGeogCSAsWKT​(java.lang.String name,
                                                    java.lang.String[] argout)

    - #### GetUserInputAsWKT

          public static int GetUserInputAsWKT​(java.lang.String name,
                                              java.lang.String[] argout)

    - #### OSRAreaOfUse_west_lon_degree_get

          public static double OSRAreaOfUse_west_lon_degree_get​(AreaOfUse area)

    - #### OSRAreaOfUse_south_lat_degree_get

          public static double OSRAreaOfUse_south_lat_degree_get​(AreaOfUse area)

    - #### OSRAreaOfUse_east_lon_degree_get

          public static double OSRAreaOfUse_east_lon_degree_get​(AreaOfUse area)

    - #### OSRAreaOfUse_north_lat_degree_get

          public static double OSRAreaOfUse_north_lat_degree_get​(AreaOfUse area)

    - #### OSRAreaOfUse_name_get

          public static java.lang.String OSRAreaOfUse_name_get​(AreaOfUse area)

    - #### CreateCoordinateTransformation

          public static CoordinateTransformation CreateCoordinateTransformation​(SpatialReference src,
                                                                                SpatialReference dst,
                                                                                CoordinateTransformationOptions options)

    - #### CreateCoordinateTransformation

          public static CoordinateTransformation CreateCoordinateTransformation​(SpatialReference src,
                                                                                SpatialReference dst)

      Create transformation object.
      Parameters:
        `src` - source spatial reference system.
        `dst` - target spatial reference system.
      Returns:
        a new CoordinateTransformation object, or null in case of failure
      Since:
        GDAL 1.10
      See Also:
        CoordinateTransformation.CreateCoordinateTransformation(org.gdal.osr.SpatialReference, org.gdal.osr.SpatialReference

    - #### GetAuthorityListFromDatabase

          public static java.util.Vector GetAuthorityListFromDatabase()

    - #### SetPROJSearchPath

          public static void SetPROJSearchPath​(java.lang.String utf8_path)

    - #### SetPROJSearchPaths

          public static void SetPROJSearchPaths​(java.util.Vector paths)

    - #### GetPROJSearchPaths

          public static java.util.Vector GetPROJSearchPaths()

    - #### GetPROJVersionMajor

          public static int GetPROJVersionMajor()

    - #### GetPROJVersionMinor

          public static int GetPROJVersionMinor()

    - #### GetPROJVersionMicro

          public static int GetPROJVersionMicro()

    - #### GetPROJEnableNetwork

          public static boolean GetPROJEnableNetwork()

    - #### SetPROJEnableNetwork

          public static void SetPROJEnableNetwork​(boolean enabled)

    - #### SetPROJAuxDbPath

          public static void SetPROJAuxDbPath​(java.lang.String utf8_path)

    - #### SetPROJAuxDbPaths

          public static void SetPROJAuxDbPaths​(java.util.Vector paths)

    - #### GetPROJAuxDbPaths

          public static java.util.Vector GetPROJAuxDbPaths()