6.1 Advanced Georeferencing
In addition to spatial referencing capability, advanced georeferencing capabilities are available.
In GeoRaster, the spatial referencing capability is called SRS (spatial reference system) or georeferencing, which may or may not be related to geography or a geospatial scheme. Georeferencing is a key feature of GeoRaster and is the foundation of spatial query and operations over geospatial image and gridded raster data. See Georeferencing for a detailed description of the SRS models.
GeoRaster supports non-geospatial images, fine art photos, and multi-dimensional arrays, which might not be associated with any coordinate system. For those images and rasters, there is generally no need for georeferencing, but most of the GeoRaster operations still work on them, such as pyramiding, scaling, subsetting, band merging, stretching, and algebraic operations. In these cases, you address the pixels (cells) using the raster's cell space coordinates (that is, row, column, and band).
You can also create a user-defined coordinate system (a new SRID) that is not related to geography, and you can use that SRID as the model coordinate system for the rasters. Then, you can spatially reference these rasters to that SRID; that is, an SRS metadata component will be created for each of those rasters. Doing this causes those rasters to be spatially referenced, and thus co-located in that user-defined model coordinate system. After this is done for all related rasters, GeoRaster operations will work on those rasters as if they are georeferenced to a geographic coordinate system. For example, assume that an artist has painted a large mural on a wall, and that you want to be able to take many high-resolution photographs of different tiles of this wall and then stitch them together. You can spatially reference the tile images and then use the GeoRaster mosaicking capability to do the stitching.
If you do not define a new coordinate system, you can still co-locate the images in the cell space. That is, you can set up different ULT coordinates for the images by calling the SDO_GEOR.setULTCoordinate procedure, so that the images are aligned in the same coordinate system and then can be mosaicked.
Most geospatial image and raster files that you have are probably already georeferenced by other software tools, and thus they may come with georeferencing information. In those cases, the georeferencing information can be directly loaded with the rasters or afterward by using SDO_GEOR.setSRS, the GeoRaster loader tool, GDAL, or other third-party ETL tools. For more information, check GeoRaster Tools: Viewer_ Loader_ Exporter and Georeferencing GeoRaster Objects.
If a geospatial image does not have spatial reference information, you can use the GeoRaster Ground Control Point (GCP) support to georeference the image. GCPs are collected either automatically by the remote sensing system or manually afterward. For an image without GCP information, you can use a GeoRaster visualization tool to collection GCPs for the GeoRaster object. GCPs are described in Ground Control Point (GCP) Georeferencing Model.
After you have the GCPs and want to store them in the GeoRaster metadata, you can get and set the GCP-based georeferencing mode by using the SDO_GEOR.getGCPGeorefModel function and the SDO_GEOR.setGCPGeorefModel procedure. To get, set, and edit only GCPs, use the SDO_GEOR.getControlPoint function and the SDO_GEOR.setControlPoint and SDO_GEOR.deleteControlPoint procedures. The GCPs can also be stored in the GeoRaster metadata when you call SDO_GEOR.georeference.
To get and set only the geometric model, use the SDO_GEOR.getGCPGeorefMethod function and the SDO_GEOR.setGCPGeorefMethod procedure. GeoRaster also allows you to store check points (pointType
= 2), which are treated and manipulated in the same way as control points (pointType
= 1) except that check points are not used to create the SRS coefficient when SDO_GEOR.georeference is called with the GCPs.
If you have ground control points (GCPs) that are either stored in the GeoRaster object or not, and if you want to calculate the functional fitting georeferencing model, you can call the SDO_GEOR.georeference procedure to find the solution. The functional fitting georeferencing model stores all coefficients in the GeoRaster SRS and enables the coordinate transformations between cell space and model space. To generate the functional fitting georeferencing model using GCP, you must specify an appropriate geometric model. The specific geometric models supported by SDO_GEOR.georeference are Affine Transformation, Quadratic Polynomial, Cubic Polynomial, DLT, Quadratic Rational, and RPC. These models are described in Functional Fitting Georeferencing Model.
Example 6-1 Setting Up the GCP Georeferencing Model
For example, if you have a Landsat image in a plain area and want to georeference it, you might choose the Quadratic Polynomial geometric model. For that purpose, assuming you have collected 9 GCPs (at least 6 GCPs in this case) and 3 check points, you can set up the GCPs and store them in the GeoRaster's metadata using the code in Example 6-1.
DECLARE gr1 sdo_georaster; georefModel SDO_GEOR_GCPGEOREFTYPE; GCPs SDO_GEOR_GCP_COLLECTION; BEGIN SELECT georaster INTO gr1 from georaster_table WHERE georid=1 FOR UPDATE; GCPs := SDO_GEOR_GCP_COLLECTION( SDO_GEOR_GCP('1', '', 1, 2, sdo_number_array(25, 73), 2, sdo_number_array(237036.9, 897987.2), NULL, NULL), SDO_GEOR_GCP('2', '', 1, 2, sdo_number_array(100, 459), 2, sdo_number_array(237229.6, 897949.7), NULL, NULL), SDO_GEOR_GCP('3', '', 1, 2, sdo_number_array(362, 77), 2, sdo_number_array(237038.9, 897818.8), NULL, NULL), SDO_GEOR_GCP('4', '', 1, 2, sdo_number_array(478, 402), 2, sdo_number_array(237201.06, 897760.56), NULL, NULL), SDO_GEOR_GCP('5', '', 1, 2, sdo_number_array(167, 64), 2, sdo_number_array(237032.02, 897916.26), NULL, NULL), SDO_GEOR_GCP('6', '', 1, 2, sdo_number_array(101, 257), 2, sdo_number_array(237128.9, 897949.3), NULL, NULL), SDO_GEOR_GCP('7', '', 1, 2, sdo_number_array(235, 501), 2, sdo_number_array(237250.9, 897882.2), NULL, NULL), SDO_GEOR_GCP('8', '', 1, 2, sdo_number_array(423, 214), 2, sdo_number_array(237107.3, 897788.0), NULL, NULL), SDO_GEOR_GCP('9', '', 1, 2, sdo_number_array(127, 178), 2, sdo_number_array(237089.0, 897936.5), NULL, NULL), SDO_GEOR_GCP('10', '', 2, 2, sdo_number_array(131, 425), 2, sdo_number_array(237212.8, 897934.2), NULL, NULL), SDO_GEOR_GCP('11', '', 2, 2, sdo_number_array(299, 111), 2, sdo_number_array(237055.7, 897850.4), NULL, NULL), SDO_GEOR_GCP('12', '', 2, 2, sdo_number_array(329, 253), 2, sdo_number_array(237126.9,897835.4), NULL, NULL) ); georefModel := SDO_GEOR_GCPGEOREFTYPE('QuadraticPolynomial', GCPs.count, GCPs, NULL); -- Set and store the GCP georeference model into the GeoRaster object's metadata sdo_geor.setGCPGeorefModel(gr1, georefModel); UPDATE georaster_table SET georaster=gr1 WHERE georid=1; COMMIT; END; /
Example 6-2 Generating the Functional Fitting Model Using GCPs
After using the code in Example 6-1, you can generate the functional fitting model coefficients by using the code in Example 6-2.
DECLARE gr1 sdo_georaster; rms sdo_number_array; BEGIN SELECT georaster INTO gr1 from georaster_table WHERE georid=1 FOR UPDATE; -- georeference the image using the GCPs stored in the image's metadata rms := sdo_geor.georeference(gr1, null, 26986, 0, 'TRUE'); UPDATE georaster_table SET georaster=gr1 WHERE georid=1; COMMIT; END; /
The steps in Example 6-1 and Example 6-2 can be combined without the need to pre-set the GCPs into the GeoRaster object's metadata (see the example for SDO_GEOR.georeference in SDO_GEOR Package Reference). The returned value array of SDO_GEOR.georeference in Example 6-2 contains RMS values and residuals for each GCP. Using these, you can examine the solution accuracy and identify erratic GCPs. If the accuracy is not satisfactory, recheck all GCPs to make sure they are accurate and add more GCPs as necessary, and then run the script or scripts again.
The GCP support in GeoRaster enables you to spatially reference any non-geospatial images and rasters also.
After geospatial images are georeferenced, you can process those images, such as applying rectification, reprojection, and mosaicking, and spatially querying and subsetting the rasters using geometry polygons in different coordinate systems.
Parent topic: Image Processing and Virtual Mosaic