CMAQ Modelers: Crosswalking Your Grid Definitions

(Ali) #1

Hi Everyone, I needed to share Calvin Arter’s (Univ. North Carolina Ph.D. Candidate) experience when he generated his own grid through the spatial allocator program. He originally wasn’t able to crosswalk his grid, but he figured it out and hoped his experience will help some of you other CMAQ modelers out there! Thanks again, Calvin!

"I had created the grid through the spatial allocator program from the CMAQ-WRF-MCIP file GRIDCRO2D and a GRIDDESC (grid description file). This essentially took a netcdf file and output a shape file with the grids. However, I then had to create the proper projection as described in the GRIDDESC file with a GIS program (I used ArcGIS). I was then able to import this file into BenMap under the modify datasets tab as a new grid definition. When I then imported my CMAQ air quality surface, it was projected properly on the new grid definition.

The problem with the crosswalk arose whenever I attempted to perform a crosswalk between my new grid definition and any of the other US grid definitions (County, State, etc.). And the same error occurred whether I was attempting to do the crosswalk when I first imported the shape file grid definition or when I was attempting the health impact analysis:

Faulted: System.ArgumentException: points must form a closed linestring
at NetTopologySuite.Geometries.LinearRing.ValidateConstruction()
at NetTopologySuite.Geometries.GeometryFactory.CreateLinearRing(Coordinate[] coordinates)
at DotSpatial.Data.Shape.FromPolygon(IGeometryFactory factory)
at BenMAP.Crosswalks.CrosswalksCalculator.Calculate(IFeatureSet grid, IFeatureSet features, CancellationToken cancellationToken, IProgress progress)
at BenMAP.Crosswalks.CrosswalksConfiguration.<>c__DisplayClass18_0.b__0()
at System.Threading.Tasks.Task.Execute()

After some extensive internet searching, I found the problem was with the topology of the shape file itself. It turns out that the error referring to points must form a closed line string (or an unclosed ring as described in ArcGIS) means that the vertices of the grids were being drawn like a bowtie (crossing over itself diagonally). When the shape file was projected however, it was impossible to see this.

To fix the problem I had to use two tools in ArcGIS, Check Geometry and Repair Geometry. Essentially the grids had to be redrawn while obeying simple topological rules. I then imported the corrected shape file into BenMAP as a new grid definition and everything worked perfectly."