AirWare On-line Reference Manual
| | Release Level | 5.4 |
| | Release Date | 2008 10 |
| Revision Level | 1.0 |
|
Last modified on:
Monday, 20-Jul-09 14:03 CEST
|
Bulk Import of Area Source Data
To import and use a set of area sources, the following steps need to be taken,
assuming that the source of the information is a Shapefile with the polygon definitions
and a spreadsheet with the textual and numerical data describing each area source.
- make sure that all required parameters are defined in the
TEMPLATE for area sources;
- define any additional parameters as required as
DESCRIPTORS in the Knowledge Base
- Edit the TEMPLATE to reflect these additions.
- IMPORTANT do make a backup copy of the current data base !
Tables that will have to be popuplated when creating new Area Sources are:
- RBO (generates unique object id's and assigns objects to classes)
- AREA_SOURCE ( contains the Area Source data and a reference to the
- Polygon/Geometry)
- POLYGON ( contains geometry points for the polygon)
Table Structures:
*RBO.RBO:*
ID int(11) auto_increment
CLASSID int(11)
primary key: ID
*AIR.AREA_SOURCE:*
ID int(10)
DESCRIPTOR varchar(32)
VALUE varchar(255)
FLAG int(3) default 0, *internal use only
primary key: ID,DESCRIPTOR
*AIR.POLYGON:*
LOCATIONID int(11) *internal has to be 600
OBJ_ID int(11) ID from AIR.AREA_SOURCE
POINT_NR int(11) sequence number of the point in polygon
POINT_X float UTM coordinate
POINT_Y float UTM coordinate
Now to create a new single Area Source in the database:
- Add a new record to table *RBO.RBO* with column CLASSID set to 61
(==Area Source).
Field ID will be set automatically since it is an autoincrement
field and will be filled with the next higher unique ID.
Example: Lets say you get a new ID with value 98765.
- Use that new (Area source) ID to insert data into table
*AIR.AREA_SOURCE* for each descriptor:
CLASSID, NAME, DESCRIPTION, CREATED, MODIFIED, OWNER, GX, GY,
EXTENT, GEOM_ID, CO_emission_gps, NOX_emission_gps,
NO_emission_gps,NO2_emission_gps,SO2_emission_gps,
VOC_emission_gps, total_area, num_polygon_points,GEOM_ID
Example:
ID DESCRIPTOR VALUE
98765 CLASSID 61
98765 NAME Tehran example Area Source
98765 DESCRIPTION This is just an example
98765 CREATED 2008-10-07 15:00
98765 MODIFIED 2008-10-07 15:00
98765 GX 538173
98765 GY 3932609
98765 EXTENT 6000
98765 MAPID 5003
98765 GEOM_ID 98765 (reference to AIR.POLYGON)
98765 num_polygon_points 4
98765 CO_emission_gps 7.15
98765 NOX_emission_gps 173.71
.......
- Create Geometry (polygon points) in *AIR.POLYGON
*LOCATIONID=600 *fixed internal*
*Example:*
*LOCATIONID OBJ_ID POINT_NR POINT_X POINT_Y
600 98765 1 537432 3955000
600 98765 2 537435 3955020
...........
*
*