Esri / mdcs-py

MDCS is an acronym for Mosaic Dataset Configuration Script and is the entry point to a collection of Python classes/libraries that could be consumed by a Python client application to complete a given workflow for creating a mosaic dataset, populating it with data, and setting all required/desired parameters.
Apache License 2.0
64 stars 29 forks source link

MDCS Create Reference Mosaic Dataset #116

Closed mapface closed 1 year ago

mapface commented 2 years ago

Unable to create a Referenced MD using this command:

python.exe "C:\Image_Mgmt_Workflows\mdcs-py\scripts\MDCS.py" -i:"C:\Image_Mgmt_Workflows\mdcs-py\Parameter\Config\create_ref_md.xml"

With this template:

<?xml version="1.0" encoding="utf-8"?>
<Application>
    <Name>create_ref</Name>
    <Command>CR</Command>
    <Workspace>
        <WorkspacePath>C:\data\Services\Aerial\</WorkspacePath>
        <Geodatabase>Aerial_Public.gdb</Geodatabase>
        <MosaicDataset>
            <MosaicDatasetType>source</MosaicDatasetType>
            <Name>Aerial_Public</Name>
            <CreateReferencedMosaicDataset>
                <in_dataset>Aerial_Public</in_dataset>
                <out_mosaic_dataset>Aerial_Public_R</out_mosaic_dataset>
                <SRS></SRS>
                <number_of_bands></number_of_bands>
                <pixel_type></pixel_type>
                <where_clause>Latest = 1</where_clause>
                <in_template_dataset></in_template_dataset>
                <extent></extent>
                <select_using_features></select_using_features>
                <lod_field></lod_field>
                <minPS_field>MinPS</minPS_field>
                <maxPS_field>MaxPS</maxPS_field>
                <pixelSize></pixelSize>
                <build_boundary>BUILD_BOUNDARY</build_boundary>
            </CreateReferencedMosaicDataset>
            <AddRasters>
            </AddRasters>
            <Processes>
            </Processes>
        </MosaicDataset>
    </Workspace>
</Application>

There's no errors in the logfile, but no reference is created. I've tried hardcoding paths in and , as well as using m: and p: in the console to override the mosaic and output but no luck. What am I missing?

mapface commented 1 year ago

I got it working using variables, although I'm still a bit confused since I had to set the MosaicDataset name as the Reference I wanted to create, rather than the existing source

Command used:

python.exe "C:\Image_Mgmt_Workflows\mdcs-py\scripts\MDCS.py" -i:"C:\Image_Mgmt_Workflows\mdcs-py\Parameter\Config\create_ref_md.xml" -p:"C:\image_data\Aerial_Public.gdb\Aerial_Public"$SourceMD -p:"C:\image_data\Aerial_Public.gdb\Aerial_Public"$RefMD

config:

<Application>
    <Name>create_ref</Name>
    <Command>CR</Command>
    <Workspace>
        <WorkspacePath>C:\placeholder</WorkspacePath>
        <Geodatabase>placeholder.gdb</Geodatabase>
        <MosaicDataset>
            <MosaicDatasetType>source</MosaicDatasetType>
            <Name>Ref_MD;$RefMD$</Name>
            <CreateReferencedMosaicDataset>
                <in_dataset>Source_MD;$SourceMD$</in_dataset>
                <out_mosaic_dataset>Ref_MD;$RefMD$</out_mosaic_dataset>
                <SRS></SRS>
                <number_of_bands></number_of_bands>
                <pixel_type></pixel_type>
                <where_clause>Year = 1998</where_clause>
                <in_template_dataset></in_template_dataset>
                <extent></extent>
                <select_using_features></select_using_features>
                <lod_field></lod_field>
                <minPS_field>MinPS</minPS_field>
                <maxPS_field>MaxPS</maxPS_field>
                <pixelSize></pixelSize>
                <build_boundary>BUILD_BOUNDARY</build_boundary>
            </CreateReferencedMosaicDataset>
            <Processes>
            </Processes>
        </MosaicDataset>
    </Workspace>
</Application>