Closed philipbaileynar closed 2 years ago
Not saying Arc needs to do EXACTLY the same stuff but for reference here's what the menu items look like in Q
Root project menu item
![]() |
Layer imported from another project
![]() |
<Warehouse>
element so you need to check for existence"warehouseUrl": "https://data.riverscapes.xyz/#"
<MetaData
Here's the XML you're reading for the root node:
<?xml version="1.0"?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xml.riverscapes.xyz/Projects/XSD/V1/BRAT.xsd">
<Name>BRAT for HUC 10190004</Name>
<ProjectType>BRAT</ProjectType>
<Warehouse>
<Meta name="id">f20d6d07-6d2c-4188-bbf4-5d4405ddad4b</Meta>
<Meta name="user">d6c0ff26-8550-4f80-b9ea-6cc1e70a1c4d</Meta>
<Meta name="program">Anabranch</Meta>
<Meta name="tags">TEST,OCT16,WEBRAVE</Meta>
</Warehouse>
And here's the MEtadata you need for a derivative layer:
<DEM guid="f2b8255b-656b-4bf0-a7fe-6e3300e91243" id="DEM">
<Name>NED 10m DEM</Name>
<Path>inputs/dem.tif</Path>
<MetaData>
<Meta name="_rs_wh_id">e84e1f3f-b3cc-4133-a348-ec0cdc7024c9</Meta>
<Meta name="_rs_wh_program">Anabranch</Meta>
<Meta name="_rs_OTHERSTUFF">...etc</Meta>
</MetaData>
</DEM>
FYI here's the python code that does this in case it helps:
def get_warehouse_url(self, wh_meta: Dict[str, str]):
if wh_meta is not None:
# if this is not a derivative layer then you're looking for the <Warehouse> tag at the root of the <Project> node
if 'program' in wh_meta and 'id' in wh_meta:
return '/'.join([CONSTANTS['warehouseUrl'], wh_meta['program'][0], wh_meta['id'][0]])
# If this is a derivative layer (like DEM) then the URL you need to build is not to THIS project but rather
# to the parent project from which this program came. So a VBET project's DEM.tif link will be to the RSContext
# project
elif '_rs_wh_id' in wh_meta and '_rs_wh_program' in wh_meta:
return '/'.join([CONSTANTS['warehouseUrl'], wh_meta['_rs_wh_program'][0], wh_meta['_rs_wh_id'][0]])
return None
Fixed via last commit
@philipbaileynar I see the code for the project-level part of this but not for the layer-level part. Are we including that in ArcRave?
Was already implemented. Tested. Works.
I just used the "View in warehouse" feature within QRAVE, by right clicking on the project. It is insanely useful (kudos @MattReimer) and we should implement in ArcRAVE.