Skip to main content
Question

Bathymetric attributed grid (BAG) to database

  • March 2, 2020
  • 2 replies
  • 35 views

Im trying to import a BAG file in a database. A bag file has 2 bands (elevation and uncertainty) and a metadata string. I want to import the 2 bands and the metadata features to their own column in a table. When I try to import the metadata string it imports the whole string to one column called: Bag_metadata_string. I have no experience with the xml transformators.

 

 

I tried to export the string to a xml file and continue with that xml file to import in a database. It worked almost but not completely. When I export to XML it changes the < > to something like &gm; and &gl;

When i changed them back in notepad to < > it could be used to import to a database. Unfortunately it created only the columns and didn't import the data.

What is a good workaround to work with a BAG file so I can export the metadata correctly from BAG to postgis?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

Hi @wilco, if I am understanding it correctly, you would like to extract data from the bag_metadata_string into columns? Adding an XMLFragmenter transformer after reading the BAG file and set bag_metadata_string as the XML Attribute may work for you. You may have to specify the Elements to Match and Attributes to Expose for the tags you would like to extract. Hope this helps a bit. You are also very welcome to share some sample data, so we can take a closer to look at it.


  • Author
  • March 5, 2020

Hi @wilco, if I am understanding it correctly, you would like to extract data from the bag_metadata_string into columns? Adding an XMLFragmenter transformer after reading the BAG file and set bag_metadata_string as the XML Attribute may work for you. You may have to specify the Elements to Match and Attributes to Expose for the tags you would like to extract. Hope this helps a bit. You are also very welcome to share some sample data, so we can take a closer to look at it.

Hi @alyssaatsafe, Thank you for sending me in the right direction.

 

 

I downloaded: H12656_MB_50cm_MLLW_23of31.bag

 

from: https://data.noaa.gov//metaview/page?xml=NOAA/NESDIS/NGDC/MGG/NOS/H12001-H14000/iso/xml/H12656.xml&view=getDataView&header=none as example file.

It is conform ISO 19115 metadata standard.

 

 

When I use the fragmenter and use gmi:MI_Metadata to match it will put all my metadata as 1 string in just 1 single column?