[GRASS-user] seeking advice on importing "unprojected" data

Hi GRASS list,

I'm trying to compare two data sets and need to import them into the same location. One is a GeoTIFF in WGS84 lon,lat coordinates. When I create a new GRASS location using "-c file.tif" everything appears to work, and

$ g.region -p
projection: 99 (unnamed)
zone: 0
datum: wgs84
ellipsoid: wgs84
etc...

And from gdalinfo:

Coordinate System is:
PROJCS["unnamed",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Polar_Stereographic"],
    PARAMETER["latitude_of_origin",70],
    PARAMETER["central_meridian",-45],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",1],
    PARAMETER["false_northing",1],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (107900.000000000000000,-655550.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)

I have a second data set that I would like to co-locate with this one. That data comes in a NetCDF file but the projection is a custom rotated-pole projection. I have three variables in the NetCDF file: lon, lat, and the data.

What is the best method to convert on data set to the other? My first approach might be to convert the NetCDF to lon,lat,data ASCII file, import as points with m.proj, then convert to raster. I'm wondering if this is what the experts on this list would do. Note that I have one TIF, and 50,000 NetCDF time steps, so it may be more efficient to convert the TIF to the custom NetCDF projection, but it is not a requirement.

Thanks for any advice you may have,

  -k.
  

It seems that my suggested approach might be the right one based on this thread from 2012: https://lists.osgeo.org/pipermail/grass-dev/2012-March/058179.html

-k.

···

On Tue, Aug 15, 2017 at 1:59 PM, Ken Mankoff <mankoff@gmail.com> wrote:

Hi GRASS list,

I’m trying to compare two data sets and need to import them into the same location. One is a GeoTIFF in WGS84 lon,lat coordinates. When I create a new GRASS location using “-c file.tif” everything appears to work, and

$ g.region -p
projection: 99 (unnamed)
zone: 0
datum: wgs84
ellipsoid: wgs84
etc…

And from gdalinfo:

Coordinate System is:
PROJCS[“unnamed”,
GEOGCS[“WGS 84”,
DATUM[“WGS_1984”,
SPHEROID[“WGS 84”,6378137,298.257223563,
AUTHORITY[“EPSG”,“7030”]],
AUTHORITY[“EPSG”,“6326”]],
PRIMEM[“Greenwich”,0],
UNIT[“degree”,0.0174532925199433],
AUTHORITY[“EPSG”,“4326”]],
PROJECTION[“Polar_Stereographic”],
PARAMETER[“latitude_of_origin”,70],
PARAMETER[“central_meridian”,-45],
PARAMETER[“scale_factor”,1],
PARAMETER[“false_easting”,1],
PARAMETER[“false_northing”,1],
UNIT[“metre”,1,
AUTHORITY[“EPSG”,“9001”]]]
Origin = (107900.000000000000000,-655550.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)

I have a second data set that I would like to co-locate with this one. That data comes in a NetCDF file but the projection is a custom rotated-pole projection. I have three variables in the NetCDF file: lon, lat, and the data.

What is the best method to convert on data set to the other? My first approach might be to convert the NetCDF to lon,lat,data ASCII file, import as points with m.proj, then convert to raster. I’m wondering if this is what the experts on this list would do. Note that I have one TIF, and 50,000 NetCDF time steps, so it may be more efficient to convert the TIF to the custom NetCDF projection, but it is not a requirement.

Thanks for any advice you may have,

-k.

Hi Ken,
I have had to compare lonlat data with ncdf rotated pole data before and also chose to import the centroids of the rotated grid into a vector. To fill the cells I actually converted the points to much smaller resolution (e.g. you could use the 30m of your other dataset) raster cells with an ID and used r.grow.distance to create an ID grid. I could then just reclass this ID grid for each timestep, meaning no excess data in the grass db. At the time it seemed like a bit of a workaround, but reading the thread below makes me think this is the way to go.

Regards,
Michel

···

On 15.08.2017 14:38, Ken Mankoff wrote:

It seems that my suggested approach might be the right one based on this thread from 2012: https://lists.osgeo.org/pipermail/grass-dev/2012-March/058179.html

-k.

On Tue, Aug 15, 2017 at 1:59 PM, Ken Mankoff <mankoff@gmail.com> wrote:

Hi GRASS list,

I’m trying to compare two data sets and need to import them into the same location. One is a GeoTIFF in WGS84 lon,lat coordinates. When I create a new GRASS location using “-c file.tif” everything appears to work, and

$ g.region -p
projection: 99 (unnamed)
zone: 0
datum: wgs84
ellipsoid: wgs84
etc…

And from gdalinfo:

Coordinate System is:
PROJCS[“unnamed”,
GEOGCS[“WGS 84”,
DATUM[“WGS_1984”,
SPHEROID[“WGS 84”,6378137,298.257223563,
AUTHORITY[“EPSG”,“7030”]],
AUTHORITY[“EPSG”,“6326”]],
PRIMEM[“Greenwich”,0],
UNIT[“degree”,0.0174532925199433],
AUTHORITY[“EPSG”,“4326”]],
PROJECTION[“Polar_Stereographic”],
PARAMETER[“latitude_of_origin”,70],
PARAMETER[“central_meridian”,-45],
PARAMETER[“scale_factor”,1],
PARAMETER[“false_easting”,1],
PARAMETER[“false_northing”,1],
UNIT[“metre”,1,
AUTHORITY[“EPSG”,“9001”]]]
Origin = (107900.000000000000000,-655550.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)

I have a second data set that I would like to co-locate with this one. That data comes in a NetCDF file but the projection is a custom rotated-pole projection. I have three variables in the NetCDF file: lon, lat, and the data.

What is the best method to convert on data set to the other? My first approach might be to convert the NetCDF to lon,lat,data ASCII file, import as points with m.proj, then convert to raster. I’m wondering if this is what the experts on this list would do. Note that I have one TIF, and 50,000 NetCDF time steps, so it may be more efficient to convert the TIF to the custom NetCDF projection, but it is not a requirement.

Thanks for any advice you may have,

-k.

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[https://lists.osgeo.org/mailman/listinfo/grass-user](https://lists.osgeo.org/mailman/listinfo/grass-user)

Hi Michel, list,

I’ve come across a different method - using the CDO tools to remap the rotated pole data set.

See thread here: https://code.mpimet.mpg.de/boards/2/topics/96
The answer there uses a simple ASCII “mygrid” as the target grid, but the command can be “cdo remapbil,file.nc ifile ofile” where “file.nc” is a netcdf file that represents the target grid. It has specific format requirements discussed here: https://earthscience.stackexchange.com/questions/8086/interpolate-gaussian-grids-to-regular-fixed-grids-using-bilinear-interpolation

I’m trying to figure out this CDO method, and having trouble converting my GRASS GIS projection information (and the longitude and latitude coordinates for each grid cell) to the correct NetCDF file… work is in progress.

If I can’t do it this way I’ll hand-code it as you suggested in your reply. I’m not totally clear on your method yet, so I may write and ask for more details.

Thanks,

-k.

···

On Thu, Aug 17, 2017 at 12:49 PM, Michel Wortmann <wortmann@pik-potsdam.de> wrote:

Hi Ken,
I have had to compare lonlat data with ncdf rotated pole data before and also chose to import the centroids of the rotated grid into a vector. To fill the cells I actually converted the points to much smaller resolution (e.g. you could use the 30m of your other dataset) raster cells with an ID and used r.grow.distance to create an ID grid. I could then just reclass this ID grid for each timestep, meaning no excess data in the grass db. At the time it seemed like a bit of a workaround, but reading the thread below makes me think this is the way to go.

Regards,
Michel

On 15.08.2017 14:38, Ken Mankoff wrote:

It seems that my suggested approach might be the right one based on this thread from 2012: https://lists.osgeo.org/pipermail/grass-dev/2012-March/058179.html

-k.

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[https://lists.osgeo.org/mailman/listinfo/grass-user](https://lists.osgeo.org/mailman/listinfo/grass-user)

grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

On Tue, Aug 15, 2017 at 1:59 PM, Ken Mankoff <mankoff@gmail.com> wrote:

Hi GRASS list,

I’m trying to compare two data sets and need to import them into the same location. One is a GeoTIFF in WGS84 lon,lat coordinates. When I create a new GRASS location using “-c file.tif” everything appears to work, and

$ g.region -p
projection: 99 (unnamed)
zone: 0
datum: wgs84
ellipsoid: wgs84
etc…

And from gdalinfo:

Coordinate System is:
PROJCS[“unnamed”,
GEOGCS[“WGS 84”,
DATUM[“WGS_1984”,
SPHEROID[“WGS 84”,6378137,298.257223563,
AUTHORITY[“EPSG”,“7030”]],
AUTHORITY[“EPSG”,“6326”]],
PRIMEM[“Greenwich”,0],
UNIT[“degree”,0.0174532925199433],
AUTHORITY[“EPSG”,“4326”]],
PROJECTION[“Polar_Stereographic”],
PARAMETER[“latitude_of_origin”,70],
PARAMETER[“central_meridian”,-45],
PARAMETER[“scale_factor”,1],
PARAMETER[“false_easting”,1],
PARAMETER[“false_northing”,1],
UNIT[“metre”,1,
AUTHORITY[“EPSG”,“9001”]]]
Origin = (107900.000000000000000,-655550.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)

I have a second data set that I would like to co-locate with this one. That data comes in a NetCDF file but the projection is a custom rotated-pole projection. I have three variables in the NetCDF file: lon, lat, and the data.

What is the best method to convert on data set to the other? My first approach might be to convert the NetCDF to lon,lat,data ASCII file, import as points with m.proj, then convert to raster. I’m wondering if this is what the experts on this list would do. Note that I have one TIF, and 50,000 NetCDF time steps, so it may be more efficient to convert the TIF to the custom NetCDF projection, but it is not a requirement.

Thanks for any advice you may have,

-k.

Hi Ken,
I see. This way you will have to resample your data into the other coordinate system tho. That might indeed be a bit tricky with a Polar projection.
Hit me up if you need any info on the workaround.
Michel

···

On 17.08.2017 23:11, Ken Mankoff wrote:

Hi Michel, list,

I’ve come across a different method - using the CDO tools to remap the rotated pole data set.

See thread here: https://code.mpimet.mpg.de/boards/2/topics/96
The answer there uses a simple ASCII “mygrid” as the target grid, but the command can be “cdo remapbil,file.nc ifile ofile” where “file.nc” is a netcdf file that represents the target grid. It has specific format requirements discussed here: https://earthscience.stackexchange.com/questions/8086/interpolate-gaussian-grids-to-regular-fixed-grids-using-bilinear-interpolation

I’m trying to figure out this CDO method, and having trouble converting my GRASS GIS projection information (and the longitude and latitude coordinates for each grid cell) to the correct NetCDF file… work is in progress.

If I can’t do it this way I’ll hand-code it as you suggested in your reply. I’m not totally clear on your method yet, so I may write and ask for more details.

Thanks,

-k.

On Thu, Aug 17, 2017 at 12:49 PM, Michel Wortmann <wortmann@pik-potsdam.de> wrote:

Hi Ken,
I have had to compare lonlat data with ncdf rotated pole data before and also chose to import the centroids of the rotated grid into a vector. To fill the cells I actually converted the points to much smaller resolution (e.g. you could use the 30m of your other dataset) raster cells with an ID and used r.grow.distance to create an ID grid. I could then just reclass this ID grid for each timestep, meaning no excess data in the grass db. At the time it seemed like a bit of a workaround, but reading the thread below makes me think this is the way to go.

Regards,
Michel

On 15.08.2017 14:38, Ken Mankoff wrote:

It seems that my suggested approach might be the right one based on this thread from 2012: https://lists.osgeo.org/pipermail/grass-dev/2012-March/058179.html

-k.

On Tue, Aug 15, 2017 at 1:59 PM, Ken Mankoff <mankoff@gmail.com> wrote:

Hi GRASS list,

I’m trying to compare two data sets and need to import them into the same location. One is a GeoTIFF in WGS84 lon,lat coordinates. When I create a new GRASS location using “-c file.tif” everything appears to work, and

$ g.region -p
projection: 99 (unnamed)
zone: 0
datum: wgs84
ellipsoid: wgs84
etc…

And from gdalinfo:

Coordinate System is:
PROJCS[“unnamed”,
GEOGCS[“WGS 84”,
DATUM[“WGS_1984”,
SPHEROID[“WGS 84”,6378137,298.257223563,
AUTHORITY[“EPSG”,“7030”]],
AUTHORITY[“EPSG”,“6326”]],
PRIMEM[“Greenwich”,0],
UNIT[“degree”,0.0174532925199433],
AUTHORITY[“EPSG”,“4326”]],
PROJECTION[“Polar_Stereographic”],
PARAMETER[“latitude_of_origin”,70],
PARAMETER[“central_meridian”,-45],
PARAMETER[“scale_factor”,1],
PARAMETER[“false_easting”,1],
PARAMETER[“false_northing”,1],
UNIT[“metre”,1,
AUTHORITY[“EPSG”,“9001”]]]
Origin = (107900.000000000000000,-655550.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)

I have a second data set that I would like to co-locate with this one. That data comes in a NetCDF file but the projection is a custom rotated-pole projection. I have three variables in the NetCDF file: lon, lat, and the data.

What is the best method to convert on data set to the other? My first approach might be to convert the NetCDF to lon,lat,data ASCII file, import as points with m.proj, then convert to raster. I’m wondering if this is what the experts on this list would do. Note that I have one TIF, and 50,000 NetCDF time steps, so it may be more efficient to convert the TIF to the custom NetCDF projection, but it is not a requirement.

Thanks for any advice you may have,

-k.

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[https://lists.osgeo.org/mailman/listinfo/grass-user](https://lists.osgeo.org/mailman/listinfo/grass-user)

grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user