You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 29 Next »

Service Recipe For:

FiletypeStorage Location

NETCDF

S3

Note

This workflow used ArcGIS Server 10.8 and a CF v1.6 compliant NetCDF. For adding raster using MDCS, ArcGIS Server 10.7.1 is used.

Step 1:

  • Convert a sample NetCDF to a MRF to get the MRF XML structure
gdal_translate.exe -of MRF -co NOCOPY=TRUE -co COMPRESS=LERC -co CACHEDSOURCE=NETCDF:"/vsicurl/http://sdt-data.s3.amazonaws.com/gmao/merra2/MERRA2_400.tavg1_2d_slv_Nx.20190101.nc4":T2M:1 NETCDF:"/vsicurl/http://sdt-data.s3.amazonaws.com/gmao/merra2/MERRA2_400.tavg1_2d_slv_Nx.20190101.nc4":T2M:1 c:\temp\rr3.mrf

Step 2:

  • Open .MRF and add in <DataFile>, <IndexFile>, and <CachedSource> to MRF file. This will make it a Raster Proxy pointing to the real NetCDF file.
    • <DataFile> 
      • Location on the ArcGIS Server where the cache file will be created and stored
    • <IndexFile>
      • Location on the ArcGIS Server where the cache file will be created and stored
    • <CachedSource><Source>


MRF with Added Tags
<MRF_META>
  <CachedSource>
    <Source>NETCDF:"/vsicurl/https://sdt-data.s3.amazonaws.com/gmao/merra2/MERRA2_400.tavg1_2d_slv_Nx.20190101.nc4":T2M:1</Source>
  </CachedSource>
  <Raster>
    <Size x="576" y="361" c="1" />
    <PageSize x="576" y="361" c="1" />
    <Compression>LERC</Compression>
    <DataType>Float32</DataType>
    <DataValues NoData="999999986991104.00000000" />
    <DataFile>c:/temp/tavg1_2d_slv_Nx.20190101_nc4_T2M_1.mrfcache</DataFile>
    <IndexFile>c:/temp/tavg1_2d_slv_Nx.20190101_nc4_T2M_1.mrfcache</IndexFile>
  </Raster>
  <GeoTags>
    <BoundingBox minx="-180.31250000" miny="-90.25000000" maxx="179.68750000" maxy=" 90.25000000" />
        <Projection>EPSG:4326</Projection>
  </GeoTags>
</MRF_META>

Step 3:

  • Create a Database Table in AWS RDS (PostgreSQL)  or CSV with the following headings:

    OBJECTID,Variable,Dimensions,StdTime,StdTime_max,StdZ,Raster,long_name,Name

Note

More table headings can be added. Minimum required are Variable, Dimensions, StdTime, and Raster if using a multidimensional dataset.

Step 4:

  • Add the Raster Proxy to Table under the "Raster" column. 

OBJECTID,Variable,Dimensions,StdTime,StdTime_max,StdZ,Raster,long_name,Name
1,T2M,"StdTime,StdZ",2019-01-01 00:30:00,2019-01-01 1:29:59,2,<MRF_META><CachedSource><Source>NETCDF:"/vsis3/sdt-data/gmao/merra2/MERRA2_400.tavg1_2d_slv_Nx.20190101.nc4":T2M:0</Source></CachedSource><Raster><Size x="576" y="361" c="1" /><PageSize x="576" y="361" c="1" /><Compression>LERC</Compression><DataType>Float32</DataType><DataValues NoData="999999986991104.00000000" /><DataFile>c:/temp/tavg1_2d_slv_Nx.20190101_nc4_T2M_1.mrfcache</DataFile><IndexFile>c:/temp/tavg1_2d_slv_Nx.20190101_nc4_T2M_1.mrfcache</IndexFile></Raster><GeoTags><BoundingBox minx="-180.31250000" miny="-90.25000000" maxx="179.68750000" maxy=" 90.25000000" /><Projection>EPSG:4326</Projection></GeoTags></MRF_META>,Temperature at 2 Meters,MERRA2_400.tavg1_2d_slv_Nx.20190101.T2M.0

Step 5:

  • Create Mosaic Dataset
  • Use the AddRasters to Mosaic tool. Make Raster Type = Table and point to the CSV or table in DB using connection file (.sde).

Step 6:

  • Right click on Mosaic Dataset
  • Modify > Build Multidimensional Info (using because we used raster proxy)
    Build Multidimensional Information since using a Raster Proxy and Table
  • Set Mosaic Dataset Properties
    • Scientific
    • Number of Raster per mosaic
    • LERC Compression
    • Sort by StdTime
    • Set Use Time Start and Max
    • If StdZ Set as well


Step 7:

  • Publish Mosaic Dataset using "Share as Web Layer" in ArcGIS Pro.
  • Or use upload.py ArcPy script.
  • If you add more rasters later using MDCS, restart service using ArcGIS Server Manager to see the new rasters.






  • No labels