<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.umiacs.umd.edu/adapt/index.php?action=history&amp;feed=atom&amp;title=SRB%3ASpatial_Extensions</id>
	<title>SRB:Spatial Extensions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.umiacs.umd.edu/adapt/index.php?action=history&amp;feed=atom&amp;title=SRB%3ASpatial_Extensions"/>
	<link rel="alternate" type="text/html" href="https://wiki.umiacs.umd.edu/adapt/index.php?title=SRB:Spatial_Extensions&amp;action=history"/>
	<updated>2026-04-05T21:34:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.7</generator>
	<entry>
		<id>https://wiki.umiacs.umd.edu/adapt/index.php?title=SRB:Spatial_Extensions&amp;diff=2195&amp;oldid=prev</id>
		<title>Toaster at 17:49, 16 September 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.umiacs.umd.edu/adapt/index.php?title=SRB:Spatial_Extensions&amp;diff=2195&amp;oldid=prev"/>
		<updated>2008-09-16T17:49:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;---+Adding Spatial Elements to the SRB&lt;br /&gt;
&lt;br /&gt;
This was done using a 2.x version of the SRB. Newer versions have the capacity for user-defined tables that should be used instead&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
in mcat/mk.config set db_informix= to db_informix=1&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;ll want to make sure that NODEFDAC=yes is set in your environment&lt;br /&gt;
before you do the db mcat setup, this will disable defualt public &lt;br /&gt;
access to any newly created tables&lt;br /&gt;
&lt;br /&gt;
setup mcat to use lobj/table driver, when ingesting the mcat location&lt;br /&gt;
use esipmcat01:mcat:mcat since we will be using the table driver&lt;br /&gt;
&lt;br /&gt;
Table setup.&lt;br /&gt;
create table GEO_GRANULE_OBJ (&lt;br /&gt;
   data_id      integer  not null,&lt;br /&gt;
        metadatanum     integer not null,&lt;br /&gt;
   bound      ST_Polygon,&lt;br /&gt;
   location   varchar(255,20),&lt;br /&gt;
--&lt;br /&gt;
--  browse files refer to data_id&amp;#039;s of other items in the mcat&lt;br /&gt;
--&lt;br /&gt;
   preview_file   integer, &lt;br /&gt;
   browse_file   integer,&lt;br /&gt;
   vendor      varchar(80),&lt;br /&gt;
   start_date   date,&lt;br /&gt;
   end_date   date,&lt;br /&gt;
   wrs_path   int,&lt;br /&gt;
   wrs_row      int,&lt;br /&gt;
   wrs_fraction   varchar(10),&lt;br /&gt;
        wrs_type        int,&lt;br /&gt;
--&lt;br /&gt;
-- from project table&lt;br /&gt;
--&lt;br /&gt;
        project_id      int not null,&lt;br /&gt;
--&lt;br /&gt;
-- description of process applied to data (orthorect, etc)&lt;br /&gt;
--&lt;br /&gt;
        attributes_text varchar(255)&lt;br /&gt;
);&lt;br /&gt;
create table GEO_GRANULE_COLL (&lt;br /&gt;
   data_grp_id   varchar(127) not null,&lt;br /&gt;
        metadatanum     integer not null,&lt;br /&gt;
   bound      ST_Polygon,&lt;br /&gt;
   location   varchar(255,20),&lt;br /&gt;
--&lt;br /&gt;
--  browse files refer to data_id&amp;#039;s of other items in the mcat&lt;br /&gt;
--&lt;br /&gt;
   preview_file   integer, &lt;br /&gt;
   browse_file   integer,&lt;br /&gt;
   vendor      varchar(80),&lt;br /&gt;
   start_date   date,&lt;br /&gt;
   end_date   date,&lt;br /&gt;
   wrs_path   int,&lt;br /&gt;
   wrs_row      int,&lt;br /&gt;
   wrs_fraction   varchar(10),&lt;br /&gt;
        wrs_type        int,&lt;br /&gt;
--&lt;br /&gt;
-- from project table&lt;br /&gt;
--&lt;br /&gt;
        project_id      int not null,&lt;br /&gt;
--&lt;br /&gt;
-- description of process applied to data (orthorect, etc)&lt;br /&gt;
--&lt;br /&gt;
        attributes_text varchar(255)&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
Add account mcattbl and grant permissions. You will also need to drop public&lt;br /&gt;
permissions from all other tables as well so the DAI interface cannot talk &lt;br /&gt;
to the authentication tables.&lt;br /&gt;
grant all on geo_granule_obj to mcattbl;&lt;br /&gt;
grant all on geo_granule_coll to mcattbl;&lt;br /&gt;
grant select on mdas_ad_repl to mcattbl;&lt;br /&gt;
grant select on mdas_ad_mdata to mcattbl;&lt;br /&gt;
grant select on mdas_ad_collmdata to mcattbl;&lt;br /&gt;
grant select on mdas_td_data_grp to mcattbl;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add account and password to data/TableConfig&lt;br /&gt;
&lt;br /&gt;
register the resource into the mcat&lt;br /&gt;
ingestResource &amp;#039;esipmcat01-ifmx&amp;#039;  &amp;#039;informix table database&amp;#039; &amp;#039;esipmcat01&amp;#039; &amp;#039; permanent 0&lt;br /&gt;
&lt;br /&gt;
test the DAI interface by: &lt;br /&gt;
   Sregister -D &amp;#039;database shadow object&amp;#039; -R esipmcat01-ifmx &amp;#039; testdb&lt;br /&gt;
   Scat &amp;#039;testdb&amp;amp;SHADOW= select * from geo_granule_granule&amp;#039;&lt;br /&gt;
   Scat &amp;#039;testdb&amp;amp;SHADOW= select * from mdas_td_locn&amp;#039;&lt;br /&gt;
   the last test should error out as you do not have permission to view&lt;br /&gt;
   the mdas_td_locn table&lt;br /&gt;
&lt;br /&gt;
 you can test loading in spatial atributes through teh DAI by doing:&lt;br /&gt;
   find out the data_id of a file. You can do this through MDAS_AD_REPL&lt;br /&gt;
   Sappend -i &amp;quot;dlib1&amp;amp;SHADOW=&amp;quot;&lt;br /&gt;
   insert into geo_granule values(102,0 POLYGON ((103.242999937 45.3830000241, 105.593000071 45.0410000818, 106.228999979 46.6620000697, 103.811999936 47.0149999195, 103.242999937 45.3830000241)))&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Now add the spatial attribute to the source code.&lt;br /&gt;
&lt;br /&gt;
edit mdasC_db2_externs.h. and go down to the unused block at USEREXTRA1&lt;br /&gt;
&lt;br /&gt;
mdasC_db2_externs.h:#define GEO_BOUND                      201 /* USER EXTRA 1*/&lt;br /&gt;
mdasC_db2_externs.h:#define GEO_LOCATION                   202 /* USER EXTRA 2*/&lt;br /&gt;
mdasC_db2_externs.h:#define GEO_PREVIEW_FILE               203 /* USER EXTRA 3*/&lt;br /&gt;
mdasC_db2_externs.h:#define GEO_BROWSE_FILE                204 /* USER EXTRA 4*/&lt;br /&gt;
mdasC_db2_externs.h:#define GEO_VENDOR                     205 /* USER EXTRA 5*/&lt;br /&gt;
mdasC_db2_externs.h:#define GEO_START_DATE                 206 /* USER EXTRA 6*/&lt;br /&gt;
mdasC_db2_externs.h:#define GEO_END_DATE                   207 /* USER EXTRA 7*/&lt;br /&gt;
mdasC_db2_externs.h:#define GEO_WRS_PATH                   208 /* USER EXTRA 8*/&lt;br /&gt;
mdasC_db2_externs.h:#define GEO_WRS_ROW                    209 /* USER EXTRA 9*/&lt;br /&gt;
mdasC_db2_externs.h:#define GEO_WRS_FRACTION               210 /* USER EXTRA 10*/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
now in the mdasGlobals.h file, change the USEREXTRA in dcs_tname around&lt;br /&gt;
marker 280 to the table name you created &amp;#039;GEO_GRANULE&amp;#039; in our case. Now in &lt;br /&gt;
dcs_aname change the first &amp;#039;extra&amp;#039; around marker 80 to the column name.&lt;br /&gt;
This is bound in our case.&lt;br /&gt;
&lt;br /&gt;
now you can recompile the mcat.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Main.MikeSmorul - 02 May 2005&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Toaster</name></author>
	</entry>
</feed>