<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ladco.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Find_model_grid_cell-county_intersections</id>
	<title>Find model grid cell-county intersections - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ladco.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Find_model_grid_cell-county_intersections"/>
	<link rel="alternate" type="text/html" href="https://ladco.org/wiki/index.php?title=Find_model_grid_cell-county_intersections&amp;action=history"/>
	<updated>2026-06-13T01:21:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://ladco.org/wiki/index.php?title=Find_model_grid_cell-county_intersections&amp;diff=58&amp;oldid=prev</id>
		<title>Zac: Created page with &quot;==Question==  How do I figure out which grid cells (x, y) contain any part of the Chicago ozone nonattainment area?  ==Approach==  Use a GIS to find the counties that intersec...&quot;</title>
		<link rel="alternate" type="text/html" href="https://ladco.org/wiki/index.php?title=Find_model_grid_cell-county_intersections&amp;diff=58&amp;oldid=prev"/>
		<updated>2018-12-07T22:42:37Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Question==  How do I figure out which grid cells (x, y) contain any part of the Chicago ozone nonattainment area?  ==Approach==  Use a GIS to find the counties that intersec...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Question==&lt;br /&gt;
&lt;br /&gt;
How do I figure out which grid cells (x, y) contain any part of the Chicago ozone nonattainment area?&lt;br /&gt;
&lt;br /&gt;
==Approach==&lt;br /&gt;
&lt;br /&gt;
Use a GIS to find the counties that intersect the model grid cells.  &lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
&lt;br /&gt;
===Create a shapefile of the 12US2 modeling grid (396x246) ===&lt;br /&gt;
Use the [https://github.com/CMASCenter/Spatial-Allocator Spatial Allocator] raster tools to create the shapefile. See generateGridShapefile.csh script as an example.&lt;br /&gt;
&lt;br /&gt;
   setenv GRID_PROJ &amp;quot;+proj=lcc +a=6370000.0 +b=6370000.0 +lat_1=33 +lat_2=45 +lat_0=40 +lon_0=-97&amp;quot;&lt;br /&gt;
   setenv GRID_ROWS 246&lt;br /&gt;
   setenv GRID_COLUMNS 396&lt;br /&gt;
   setenv GRID_XMIN  -2412000.0&lt;br /&gt;
   setenv GRID_YMIN  -1620000.0&lt;br /&gt;
   setenv GRID_XCELLSIZE 12000&lt;br /&gt;
   setenv GRID_YCELLSIZE 12000&lt;br /&gt;
   setenv GRID_SHAPEFILE_NAME ../output/conus_12US2.shp&lt;br /&gt;
   ../bin/64bits/create_gridPolygon.exe &lt;br /&gt;
&lt;br /&gt;
===Add X Y columns to the shapefile===&lt;br /&gt;
&lt;br /&gt;
# Load the CONUS12 shapefile into QGIS.&lt;br /&gt;
# Open the attribute table, put the file in edit mode, and add two short integer columns: X and Y&lt;br /&gt;
# Apply the following field calculator formulas, in this order (calculate Y first), to calculate X and Y; note that 396 = NCOLS&lt;br /&gt;
&lt;br /&gt;
   Y = (floor((&amp;quot;GRIDID&amp;quot;-1)/396)+1)&lt;br /&gt;
   X = &amp;quot;GRIDID&amp;quot;-(&amp;quot;Y&amp;quot;-1)*396&lt;br /&gt;
&lt;br /&gt;
===Intersect the county and grid shapefiles using GIS ===&lt;br /&gt;
&lt;br /&gt;
Use the QGIS Intersect function to find all counties that intersect each grid cell. &lt;br /&gt;
&lt;br /&gt;
1. Load a county shapefile into QGIS&lt;br /&gt;
&lt;br /&gt;
[[File:CountyMap.png|800px]]&lt;br /&gt;
&lt;br /&gt;
2. Load the grid shapefile and put the county shapefile and model grid shapefile on the same coordinate system&lt;br /&gt;
&lt;br /&gt;
[[File:County-grid.png|800px]]&lt;br /&gt;
&lt;br /&gt;
3. Use Vector-&amp;gt;Geoprocessing Tools-&amp;gt;Intersection to intersect the two features.  The grid shapefile is the Input Layer; the county shapefile is the Intersect Layer&lt;br /&gt;
&lt;br /&gt;
[[File:Intersect.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&lt;br /&gt;
=== [https://drive.google.com/uc?export=download&amp;amp;id=1U-AoHnpTAfNKc1uAU_moUlleyYUkWRUX Download a CSV file with county and grid cell intersection] ===&lt;/div&gt;</summary>
		<author><name>Zac</name></author>
		
	</entry>
</feed>