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

      `OAO_Down, OAO_East, OAO_North, OAO_Other, OAO_South, OAO_Up, OAO_West, 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`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static CoordinateTransformation` | `CreateCoordinateTransformation​(SpatialReference src, SpatialReference dst)` | Create transformation object.
    `static void` | `DontUseExceptions​()` | Use return code instead of exceptions.
    `static java.lang.String[]` | `GetProjectionMethodParameterList​(java.lang.String method, java.lang.String[] username)` |
    `static void` | `GetProjectionMethodParamInfo​(java.lang.String method, java.lang.String param, java.lang.String[] usrname, java.lang.String[] type, double[] defaultval)` |
    `static java.util.Vector` | `GetProjectionMethods​()` |
    `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 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 behaviour : 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

    - #### 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)

    - #### GetProjectionMethods

          public static java.util.Vector GetProjectionMethods​()

    - #### GetProjectionMethodParameterList

          public static java.lang.String[] GetProjectionMethodParameterList​(java.lang.String method,
                                                                            java.lang.String[] username)

    - #### GetProjectionMethodParamInfo

          public static void GetProjectionMethodParamInfo​(java.lang.String method,
                                                          java.lang.String param,
                                                          java.lang.String[] usrname,
                                                          java.lang.String[] type,
                                                          double[] defaultval)

    - #### 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