CONCEPT Grid Definition and Spatial Modeling - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

CONCEPT Grid Definition and Spatial Modeling

Description:

CONCEPT script execution. Spatial Processing (area source spatial ... Both init_project and import_sp run the following shell script: src/import/import_sp.sh ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 24
Provided by: systema262
Category:

less

Transcript and Presenter's Notes

Title: CONCEPT Grid Definition and Spatial Modeling


1
CONCEPT Grid Definition and Spatial Modeling
2
Overview
  • Defining an emissions modeling grid
  • Run control file
  • CONCEPT script execution
  • Spatial Processing (area source spatial
    surrogates)
  • Run control file
  • Importing spatial coverages
  • Defining spatial surrogates
  • CONCEPT script execution

3
Defining an Emissions Modeling Grid
  • Run control
  • GridName arbitrary grid name
  • Projection UTM, Lambert, Geographic,
    Stereographic
  • UTMZone 3 lt x lt 22 (North American Zones)
  • GridDatum WGS84, NAD83, NAD27, Sphere (fixed
    geo-referencing system)
  • Grid1Lat 1st standard parallel (decimal
    degrees Lambert)
  • Grid2Lat 2nd standard parallel (decimal
    degrees Lambert)
  • GridLonOrigin longitude of origin (decimal
    degrees)
  • GridLatOrigin latitude of origin (decimal
    degrees)
  • OriginX east-west distance to the southwest
    corner of grid (decimal degrees for Geographic
    meters for others)
  • OriginY north-south distance to the southwest
    corner of grid (decimal degrees for Geographic
    meters for others)
  • NumXCells number of grid cells in east-west
    direction
  • NumYCells number of grid cells in north-south
    direction
  • XCellSize east-west grid cell size (decimal
    degrees for Geographic meters for others)
  • YCellSize north-south grid cell size (decimal
    degrees for Geographic meters for others)

4
Grid Definition Terminology
XCellSize
YCellSize
NumXCells
Grid1Lat
NumYCells
GridLatOrigin
.
Grid2Lat
OriginY
GridLonOrigin
OriginX
5
UTM Zone Designations
6
Supported Map Projections
  • ProjectionLambert
  • MM5 default
  • GridDatumSphere
  • ProjectionLambert
  • GridDatumNAD27 or NAD83
  • -180 lt GridLonOrigin lt 0
  • 0 lt GridLatOrigin lt 90
  • 15 lt Grid1Lat lt 75
  • 15 lt Grid2Lat lt 75 and Grid1Lat gt Grid2Lat
  • Other systems can be added relatively easily by
    modifying grid_definition.sql (we will come back
    to this)
  • ProjectionGeographic
  • GridDatumSphere
  • GridLonOrigin assumed to be 0 (equator)
  • GridLatOrigin assumed to be 0 (Greenwich Line)
  • ProjectionGeographic
  • GridDatumNAD27 or NAD83
  • -180 lt GridXOrigin lt 0
  • 0 lt GridYOrigin lt 90
  • GridLatOrigin assumed to be 0 (Greenwich Line)
  • ProjectionStereographic
  • GridDatumSphere or WGS84
  • ProjectionUTM
  • GridDatumNAD27 or NAD83
  • 3 lt UTMZone lt 22

7
Running CONCEPT Grid Definition Model
  • concept run_grid_defintion_model n
    ltyourdatabasegt -s ltyourscneariogt -d
    ltyouroutputdirgt
  • ? src/spatial/run_grid_definition_model.sh
    PROJECTNAME SCENARIONAME DIRECTORY
  • ? src/spatial/grid_definition_model.sql
  • ? runs SQL stored procedure
    GridDefinition()
  • GridDefinition( ) should have been loaded with
    the following CONCEPT command

concept init_project n ltyourdatabasegt Or
concept import_sp n ltyourdatabasegt
  • Both init_project and import_sp run the following
    shell script
  • src/import/import_sp.sh
  • import_sp.sh loads the GridDefintion( ) procedure
    from the SQL program
  • src/spatial/processors/grid_definition.sql
  • .so lets go take a look at the code

8
Examining the Emissions Modeling Grid Data
  • No visualization capabilitiesyet
  • JUMP did not work during development, but
    apparently works now. www.vividsolutions.com/jump/
  • QGIS is new and being examined.
    qgis.sourceforge.net
  • EmisView from EPA is underdevelopment.
    emisview.sourceforge.net
  • but we can still examine the data
  • psql d ltyourdatabasegt
  • ltyourdatabasegt \d spatial.rpo36
  • ltyourdatabasegt SELECT FROM spatial.rpo36
  • the_geom column
  • SRID and relationship to public.spatial_ref_sys
  • Relationship to public.geometry_columns

9
SQL Emissions Modeling Grid Structure
Table "spatial.rpo36" Column
Type Modifiers -------------------------
---------------------- gid
integer not null area
double precision perimeter double
precision icell integer
jcell integer
x_coordinate numeric(16,6)
y_coordinate numeric(16,6)
x_coordinate_lon numeric(16,6)
y_coordinate_lat numeric(16,6) the_geom
geometry Indexes
"rpo36_pk" primary key, btree (gid)
"rpo36_gispk" gist (the_geom) Check constraints
"enforce_srid_the_geom" CHECK (srid(the_geom)
888889) "enforce_geotype_the_geom" CHECK
(geometrytype(the_geom) 'MULTIPOLYGON'text
OR the_geom IS NULL)
10
Area Source Spatial Surrogates
  • Step 1 tell the system what coverages to load
    into the system
  • Step 2 tell the system how to compute the area
    source spatial surrogates

11
Step 1 Import Which Coverages?
  • Run control file
  • SurrFileName fully pathed name of ASCII file
    containing information about the coverages to
    load into the data base
  • lets take a look

12
Structure of ASCII File
  • Field 1 fully qualified location and name of
    shapefile to import (text)
  • Field 2 arbitrary and unique internal name used
    by CONCEPT (text)
  • Field 3 fully qualified location and name of
    the map projection file for the shapefile (text)
    (if this is a number, then it is the map
    projection SRID that exists in PUBLIC.SPATIAL_REF_
    SYS)
  • Field 4 country_code identifier (text) (this
    can be a field name in the shapefile
    SUBSTR(ltfieldnamegt,ss,2) where ltfieldnamegt is a
    field from the shapefile which contains the
    country_code and ss identifies the start position
    of the country_code DEFAULT?? where ??
    identifies the default country code e.g., US
    OVERLAYltshapefilegt where ltshapefilegt is a unique
    internal name of a shapefile that will be
    overlaid to obtain the country_code or MISSING
    which states that the current shapefile is
    missing the country_code currently not
    implemented)
  • Field 5 state_county_fips identifier (text)
    (this can be a field name in the shapefile
    SUBSTR(ltfieldnamegt,ss,5) where ltfieldnamegt is a
    field from the shapefile which contains the
    state_county_fips and ss identifies the start
    position of the state_county_fips DEFAULT??
    where ?? identifies the default state_county_fips
    e.g., 21002 OVERLAYltshapefilegt where
    ltshapefilegt is a unique internal name of a
    shapefile that will be overlaid to obtain the
    state_county_fips or MISSING which states that
    the current shapefile is missing the
    state_county_fips currently not implemented)
  • Field 6 tribal_code identifier (text) (this can
    be a field name in the shapefile
    SUBSTR(ltfieldnamegt,ss,5) where ltfieldnamegt is a
    field from the shapefile which contains the
    tribal_code and ss identifies the start position
    of the tribal_code DEFAULT?? where ??
    identifies the default tribal_code e.g., 0083
    OVERLAYltshapefilegt where ltshapefilegt is a unique
    internal name of a shapefile that will be
    overlaid to obtain the tribal_code or MISSING
    which states that the current shapefile is
    missing the tribal_code currently not
    implemented)
  • Field 7 if YES, this shapefile is used to QA
    point sources against the FIPS state and county
    code.

13
SQL Structure
Table "spatial.coverages" Column
Type Modifiers
-----------------------------------------------
------- shapecover text
shapename character varying(50)
mapprojection text
shp2pgsqltext text
shapeindex text
country_code text
state_county_fips text
tribal_code text
fips_check_overlay character varying(3)
14
Standard Coverages
  • states020 (NAD83 SRID4269 geographic)
  • countyp020 (NAD83 SRID4269 geographic)
  • us_tribalbnds (NAD83 SRID4269 geographic)

15
Field 3 the map projection file
  • OGC compliant file
  • Easiest if projection already exists in
    public.spatial_ref_sys (simply supply SRID in
    Field 3)..
  • .however, it will be the case where the map
    projection is not available from PostGIS, so you
    will have to define a map projection file.
  • Examples of these files are provided.
  • .so lets take a look

16
Importing Spatial Coverages
  • concept import_spatial_coverages n
    ltyourdatabasegt -s ltyourscneariogt -d
    ltyouroutputdirgt
  • ? src/spatial/import_spatial_coverages.sh
    PROJECTNAME SCENARIONAME DIRECTORY
  • ? runs SQL stored procedure
    ImportSpatialCoverages()
  • ? creates /tmp/importspatialcoverages.s
    h
  • ? creates /tmp/importspatialcoverages_i
    ndex.sql
  • ? modifies and runs /tmp/importspatialcover
    ages.sh (brief on shp2pgsql)
  • ? runs /tmp/importspatialcoverages_index.sq
    l
  • ImportSpatialCoverages( ) should have been loaded
    with the following CONCEPT command

concept init_project n ltyourdatabasegt Or
concept import_sp n ltyourdatabasegt
  • Both init_project and import_sp run the following
    shell script
  • src/import/import_sp.sh
  • import_sp.sh loads the ImportSpatialCoverages( )
    procedure from the SQL program
  • src/spatial/processors/import_spatial_coverages.sq
    l
  • .so lets go take a look at the code

17
Examining the Spatial Data
  • Connect to the data base
  • Use \dt to list tables
  • Use \d to list table structures
  • Use SELECT to view the data

18
Step 2 Area Source Spatial Surrogates
  • Run control file
  • SurrDefiName fully pathed name of ASCII file
    containing information to define area source
    spatial surrogates
  • lets take a look

19
Structure of ASCII File
  • Field 1 spatial surrogate code (SSC)
    (VARCHAR(10))
  • Field 2 spatial surrogate formula (text)

20
Field 2 Spatial Surrogate Formula
  • separated system for formula components
  • Each formula component is separated by
  • Field 1 weight factor
  • Field 2 table name
  • Field 3 formula of table name fields to use
  • Field 4 basis (AREA, LENGTH, POINT)
  • Field 5 SQL subsetting clause (NONE is
    acceptable)

21
SQL Structure
Table "spatial.surrogates" Column
Type Modifiers -------------------
------------------------------ ssc
character varying(10) formula text
fraction numeric
surtable text
field text
weighttype character varying(10)
subset_clause text
field_cnt integer
22
Computing Spatial Surrogates
  • concept create_spatial_surrogates n
    ltyourdatabasegt -s ltyourscneariogt -d
    ltyouroutputdirgt
  • ? src/spatial/create_spatial_surrogates.sh
    PROJECTNAME SCENARIONAME DIRECTORY
  • ? runs SQL stored procedure
    CreateSpatialSurrogates()
  • CreateSpatialSurrogates( ) should have been
    loaded with the following CONCEPT command

concept init_project n ltyourdatabasegt Or
concept import_sp n ltyourdatabasegt
  • Both init_project and import_sp run the following
    shell script
  • src/import/import_sp.sh
  • import_sp.sh loads the CreateSpatialSurrogates( )
    procedure from the SQL program
  • src/spatial/processors/create_spatial_surrogates.s
    ql
  • .so lets go take a look at the code
  • The product of all this labor is the following
  • xref.rpo_sr
  • xref.rpo_sr_tribe (note that the test data set
    for Kentucky indicates no tribal data)

23
Examining the Spatial Surrogates Data
  • Connect to the data base
  • Use \dt to list tables
  • Use \d to list table structures
  • Use SELECT to view the data
Write a Comment
User Comments (0)
About PowerShow.com