Overview

First of all, you need to decide whether or not you want to write to a RasterMap or a RasterCatalog:

A raster column can either be a raster map storing all raster data in the table as a single raster in a single row, or a raster catalog storing multiple rasters in multiple rows in the table. So if you want to mosaic all your data into one raster, use a rastermap. If you want to preserve all your original tiles, and you have user attributes you want to store for each tile, use a raster catalog. Note that catalogs support a table view in ArcCatalog and rastermaps don't.

When reading SDE rasters, raster catalogs can be viewed as a single seamless mosaic even though all the tiles are stored individually. This is why there is only one SDE raster reader. To the reader, a rastermap or catalog looks the same. The reader just specifies an extent and one raster for that extent is returned.

With both maps and catalogs, it is important to think carefully about your spatial reference parameters. In SDE, every feature class needs to have a valid origin and scale defined or inherit one from the writer parameters. If the extents are too narrow, you will get an out of bounds error. If the extents are too wide, you can get problems related to insufficient precision, such as loss of resolution. For large extents such as continental or global rasters, you need to consider what the resolution is on the ground in meters vs what it might be in lat/long. This is radically different near the poles then it is near the equator. Don't forget, whatever your spatial extents, you will need to make sure you have a valid coordinate system defined for your destination at either the dataset, feature type, or feature level.

SDE RasterMaps

In most cases, new feature classes must be registered with the geodatabase before they can be viewed. Prior to SDE 9.3, only RasterCatalogs needed to be registered, but as of 9.3 all raster tables require registration. Be forewarned that if you register a rastermap against an older geodatabase, it may cause it to be corrupt and you may need to delete and rewrite it. Conversely, if you fail to register a rastermap against a 9.3 geodatabase, it will probably appear as a table and you will, most likely, not be able to view it. While this can get confusing, we are somewhat limited by the ArcObjects API in terms of what we can do and what must be done within ArcGIS. That said, we will try to streamline this process as much as possible to minimize the possibilities for user difficulties.

SDE RasterCatalogs

RasterCatalogs work quite differently. Once you create a new raster catalog feature class, you need to go into ArcCatalog, right click on it and register it with the geodatabase. At this point it seems to disappear. However, when you hit F5 and then look at the very top of the list of feature classes for that database, the raster catalog appears there. Note that they don't fall in alphabetical order with the other feature class types.

You can then write multiple raster tiles to the same raster catalog. You get a new row in the table for each tile that you add. You do not need to re-register the raster catalog after each run, only the first time.

Known Issues

General ArcGIS Issues:

  • You do need to hit F5 in ArcCatalog after every FME run in order for ArcCatalog to show the latest contents of the tile you just added merged with what was there before.
  • If you ever get a network I/O error because of something like a table lock, you will need to disconnect and reconnect to the database to refresh the connection. You may then need to delete and recreate the table that had the lock problem.
  • If you encounter problems writing to a feature class, make sure you delete any old feature classes with the same name, or set 'drop table first' to true. If the original table was partially deleted or has a bad spatial reference, trying to update or insert into it may not work. If you are having trouble deleting it in ArcCatalog, you can always try deleting it from the SDE command line.

RasterMap:

  • Formerly, if you created a new rastermap feature class, the feature class properties had this odd data source name which included "...RASTER.OBJECTID=1". This should no longer be a problem in FME 2009+, but you now need to register the rastermap with the geodatabase. Prior to 2009, to eliminate this problem, all you had to do was create a user attribute on the destination feature type. You could always do an 'apply to all' to put one on all your destination feature types, and the field value itself doesn't have to be populated.

RasterCatalog:

  • With geodatabase scales, such as footprint scale, it's better to think of scale as precision in terms of number of decimal places. So for lat/long a scale of 10000 is more appropriate, since this equates to a lat, long precision of 0.0001.

Registration

As of ArcGIS 9.3, both RasterCatalogs and RasterMaps require manual registration in order to be fully accessible by ArcGIS as rasters. If you fail to register a rastermap against a 9.3 geodatabase, it will probably appear as a table and you most likely will not be able to view it. Be forewarned that if you register a rastermap against an older geodatabase, it may cause it to be corrupt and you may need to delete and rewrite it.

First of all, it is best to use ArcCatalog to register the rastermap, just as you currently do with raster catalogs. If you do not have access to ArcCatalog, or need to automate this process, then there is a scripted approach provided by Esri desribed below.

While this can get confusing, we are somewhat limited by a bug in the ArcObjects API in terms of what we can do and what must be done within ArcGIS. Below is the workaround provided by Esri to summarize what is typically required to register a raster with geodatabase. These steps involve SQL commands and so may be incorporated into a script. With a bit of work, this should allow you to automate the process more easily as a substitute for the purely manual process of registering rasters from within ArcGIS desktop.

Note the work on the Geodatabase raster reader/writer is currently in progress. Since we do not know whether or when Esri may fix the registration bug described above, Geodatabase raster will likely be the best reader / writer to use for SDE raster, when it's complete.

For further information please contact support@safe.com and refer to PR#7673.

Recommended Workaround:

Register the new raster with the GDB through sqlplus:

1. Get the new objectclass id by getting the next id.

SQL> SELECT MAX(ID) FROM SDE.GDB_OBJECTCLASSES;

Result:

 MAX(ID)
 ----------
 662

2. Insert a new row into the gdb_objectclasses table. Increase the maxid by one and be sure to use provided clsid({3EAA2478-5332-40F8-8FA8-62382390A3BA}) as this designates this object as a raster dataset.

SQL> INSERT INTO SDE.GDB_OBJECTCLASSES(ID,OWNER,NAME,CLSID) VALUES SQL> (663,'MARKT','DICKSON_TN','{3EAA2478-5332-40F8-8FA8-62382390A3BA}');

Result: 1 row created.

SQL> commit;

Result: Commit complete.

3. Insert a new row into the gdb_featureClasses table. Use the id used above and 14, 4, 'FOOTPRINT' for the other parameters. These designate the geometry and feature types.

SQL> INSERT INTO SDE.GDB_FEATURECLASSES(OBJECTCLASSID,FEATURETYPE,GEOMETRYTYPE,SHAPE SQL> FIELD) VALUES (663, 14, 4, 'FOOTPRINT');

Result: 1 row created.

SQL> commit;

Result: Commit complete.