Skip to main content

Hi,

I have csv data x, y, z Bathymetry survey result. How can I create BAG file in FME?

Hi @angelok, FME supports the BAG format. Quote from the help: "A BAG raster contains two bands. The first band contains elevations. The units of the elevation values are meters, and the sign convention is that positive values represent measures above the vertical datum. The second band describes the vertical uncertainty at each point of elevation. The uncertainty grid supports multiple definitions of uncertainty; the metadata contains information on the meaning of the uncertainty grid."

You can create 3D points from (x, y, z) values using the VertexCreator, and then create a one-band numeric raster from the 3D points using the NumericRasterizer.

However you will have to create a two-bands raster as the input of the BAG writer, since a BAG dataset requires a raster consisting of 2 bands. If you create two one-band rasters representing "elevation" and "uncertainty" separately, you can combine the two rasters into one two-bands raster using the RasterBandCombiner.

I don't know exact meaning of the terminologies - "elevation" and "uncertainty" which should be recorded in a BAG file. Can you retrieve or calculate those values from the CSV data?


Hi @angelok, FME supports the BAG format. Quote from the help: "A BAG raster contains two bands. The first band contains elevations. The units of the elevation values are meters, and the sign convention is that positive values represent measures above the vertical datum. The second band describes the vertical uncertainty at each point of elevation. The uncertainty grid supports multiple definitions of uncertainty; the metadata contains information on the meaning of the uncertainty grid."

You can create 3D points from (x, y, z) values using the VertexCreator, and then create a one-band numeric raster from the 3D points using the NumericRasterizer.

However you will have to create a two-bands raster as the input of the BAG writer, since a BAG dataset requires a raster consisting of 2 bands. If you create two one-band rasters representing "elevation" and "uncertainty" separately, you can combine the two rasters into one two-bands raster using the RasterBandCombiner.

I don't know exact meaning of the terminologies - "elevation" and "uncertainty" which should be recorded in a BAG file. Can you retrieve or calculate those values from the CSV data?

Thanks Takashi. I will test your advise.

'elevation' - I will add from Z. 'uncertanty' - I will calculate in Fledertmaus sofware.


@takashi I created workspace usinf Geotiff for elevation and Geotiff for uncertanty, then RasterBandCombiner. But my translation FAILED. Merged raster not created. Input rasters are incompatible because the coordinate of the lower left corner of the raster doesn't match


@takashi I created workspace usinf Geotiff for elevation and Geotiff for uncertanty, then RasterBandCombiner. But my translation FAILED. Merged raster not created. Input rasters are incompatible because the coordinate of the lower left corner of the raster doesn't match

All rasters which will be combined by the RasterBandCombiner should have the same extents and resolution. According to the error message, I guess the two Geotiff rasters have different extents. Make sure that their extents and resolution are identical.


Hello @takashi,

Do you know is it possible to create raster in FME using edge to edge method, or create raster rendered from center to center using raster with render edge to edge?


Hello @takashi,

Do you know is it possible to create raster in FME using edge to edge method, or create raster rendered from center to center using raster with render edge to edge?

Hi @angelok, sorry, I'm unclear what the "edge to edge method" means. Could you please explain the concrete condition of the source rasters and your desired result?


Hello @takash. Edge to edge method is amethod of raster creation. Value of vell will be on the cell corner, not in the center.


Hello @takash. Edge to edge method is amethod of raster creation. Value of vell will be on the cell corner, not in the center.

Hi, the RasterCellOriginSetter transformer might help you. Set 0 to both X and Y Origin, then the cell origin of the resulting raster will be changed to (0, 0) i.e. left-bottom corner.


Hi, @takashi, thanks a lot. I checked this transformer. It is working, but for final BAG not useful.


Hi @takashi, how I can do from left-bottom to centre to centre?


Hi @takashi, how I can do from left-bottom to centre to centre?

Also you can use the RasterCellOriginSetter. Set 0.5 to both X and Y Origin.


@takashi is it possible to pull one raster for another raster?


@takashi is it possible to pull one raster for another raster?

the answer depends on the requirement and actual condition. Please explain your scenario in more detail.


@takashi

I have DTM raster and BAG I would like to move BAG to DTM.


@takashi

I have DTM raster and BAG I would like to move BAG to DTM.

I don't have any experience about the BAG format, but according to the FME Readers/Writers doc, a BAG raster consists of two bands and the first band contains elevations. So I guess that you can do that with this procedure. Try!

  1. BAG reader: Read the BAG raster.
  2. RasterSelector: Select the first band of the BAG raster (set 0 to the "Band and Palette List" parameter).
  3. RasterBandKeeper: Keep the selected band.

Then, write the resulting raster into a file in a preferable format. e.g. GeoTIFF, ERDAS IMAGINE etc.


@takashi

Thanks a lot for your advise. It is good experience to know how to use this two transformers.

But I need another solution. I would like to use extent from DTM (GeoTIFF I already have) to BAG.


@takashi

Thanks a lot for your advise. It is good experience to know how to use this two transformers.

But I need another solution. I would like to use extent from DTM (GeoTIFF I already have) to BAG.

How would you like to use the GeoTIFF extents? Clip the BAG by the GeoTIFF extents? Warp the BAG so that it fits to the GeoTIFF extents? Or else?


Yes, I would like warp BAG to GeoTIFF.


Yes, I would like warp BAG to GeoTIFF.

OK. This workflow might work. In the FeatureMerger, set an identical constant e.g. 1 to the Join On parameter for both Requestor and Supplier, so that the Supplier's attributes will be merged to the Requestor unconditionally.


Reply