1

I am trying to add rotation to a NetCDF File

One Idea was to add a additional parameter to my current grid mapping that describes the rotation point and the rotation:

PROJCS["Hotine_Oblique_Mercator_Azimuth_Center", 
  GEOGCS["GCS_WGS_1984", 
    DATUM["D_unknown", 
      SPHEROID["WGS84", 6378137.0, 298.257223563]], 
    PRIMEM["Greenwich", 0.0], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Longitude", EAST], 
    AXIS["Latitude", NORTH]], 
  PROJECTION["Oblique_Mercator"], 
  PARAMETER["longitude_of_center", 7.0], 
  PARAMETER["latitude_of_center", 51.4], 
  PARAMETER["azimuth", -10.0], 
  PARAMETER["scale_factor", 1.0], 
  PARAMETER["false_easting", 0.0], 
  PARAMETER["false_northing", 0.0], 
  PARAMETER["rectified_grid_angle", -10.0], 
  UNIT["m", 1.0], 
  AXIS["x", EAST], 
  AXIS["y", NORTH], 
  AUTHORITY["EPSG","8011112"]]

Another try with Affine Rotation:

FITTED_CS["BPAF", 
  PARAM_MT["Affine", 
    PARAMETER["num_row", 3], 
    PARAMETER["num_col", 3], 
    PARAMETER["elt_0_0", 0.16867854068466956], 
    PARAMETER["elt_0_1", -0.2699420929659323], 
    PARAMETER["elt_0_2", 918079.626281209], 
    PARAMETER["elt_1_0", 0.2699420929659323], 
    PARAMETER["elt_1_1", 0.16867854068466956], 
    PARAMETER["elt_1_2", 6445039.217828758]], 
  PROJCS["WGS84 / Google Mercator", 
    GEOGCS["WGS 84", 
      DATUM["World Geodetic System 1984", 
        SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
        AUTHORITY["EPSG","6326"]], 
      PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
      UNIT["degree", 0.017453292519943295], 
      AXIS["Longitude", EAST], 
      AXIS["Latitude", NORTH], 
      AUTHORITY["EPSG","4326"]], 
    PROJECTION["Mercator_1SP"], 
    PARAMETER["semi_minor", 6378137.0], 
    PARAMETER["latitude_of_origin", 0.0], 
    PARAMETER["central_meridian", 0.0], 
    PARAMETER["scale_factor", 1.0], 
    PARAMETER["false_easting", 0.0], 
    PARAMETER["false_northing", 0.0], 
    UNIT["m", 1.0], 
    AXIS["x", EAST], 
    AXIS["y", NORTH], 
    AUTHORITY["EPSG","900913"]], 
  AUTHORITY["EPSG","8011113"]]

Another idea was to use two dimensional coordinates that are pointing directly to the georeferenced coordinates:

netcdf test {
dimensions:
        time = UNLIMITED ; // (3 currently)
        y = 10 ;
        x = 27 ;
        z = 2 ;
variables:
        double time(time) ;
                time:long_name = "time" ;
                time:units = "hours since 2018-06-23T05:00:00Z" ;
                time:calendar = "standard" ;
                time:axis = "T" ;
        double lat(y, x) ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_north" ;
        double lon(y, x) ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;
        double TSurf(time, y, x) ;
                TSurf:_FillValue = -999. ;
                TSurf:valid_min = -50.f ;
                TSurf:valid_max = 150.f ;
                TSurf:long_name = "Surface Temperature" ;
                TSurf:units = "degree Celsius" ;

// global attributes:
                :Conventions = "CF-1.7" ;
}

All three methods don't seem to work properly in QGis or Geoserver

Anyone has already some practice with NetCDF raster data that is not north up oriented?

1 Answer 1

0

fixed by editing the code from this topic: Using customized Coordinate System in ArcGIS Desktop?

My used grid_mapping:

def addGridMappingVars(var,locationLat,locationLon,rotation):
    var.grid_mapping_name= "mercator"
    var.standard_parallel= 0.0
    var._CoordinateTransformType= "Projection"
    var._CoordinateAxisTypes= "GeoX GeoY"
    var.spatial_ref= 'PROJCS["Hotine_Oblique_Mercator_Azimuth_Center",GEOGCS["GCS_WGS_1984",DATUM["D_unknown",SPHEROID["WGS84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Hotine_Oblique_Mercator_Azimuth_Center"],PARAMETER["latitude_of_center",'+str(locationLat)+'],PARAMETER["longitude_of_center",'+str(locationLon)+'],PARAMETER["rectified_grid_angle",'+str(-rotation)+'],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["m",1.0], AUTHORITY["EPSG","8011112"]]'
    return var

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.