Get science Metadata

The metadata sometimes proves to be very useful for a geo-spatial designer. HydroShare has a way of displaying this specific type of metadata. The metadata provides a lot of information like the spatial coverage of a shapefile, the units used, projection of the file and so on.

Our demonstration code here is comprised of two steps. Step 1 will query the resource and generate a list of files available therein. Step 2 will actually display the metadata of the selected file.

Step 1: Get a list of files in a resource from HydroShare:

In the boxes below you enter your HydroShare username and its password. If you have to make an HydroShare account, click here.

The resource Id is a unique identifier for every resource on Hydroshare. You can findit by browsing to your HydroShare resource copying the ID from the URL. Like for example, this is an example hyperlink https://www.hydroshare.org/resource/08c6e88adaa647cd9bb28e5d619178e0/ from which the 32 letter combination at the end is called the resource id. And so the resource id from the example hyperlink is 08c6e88adaa647cd9bb28e5d619178e0

Resource ID

Step 2: Choose a file to get its metadata


    

  

Learn more:

To try this on your own, you can use the code snippet below, or download the full javascript file that is used in this demonstration

      
      from hs_restclient import HydroShare, HydroShareAuthBasic
      auth = HydroShareAuthBasic(username='myusername', password='mypassword')
      hs = HydroShare(auth=auth)
      science_metadata_json = hs.getScienceMetadata('ID OF RESOURCE GOES HERE')