Select to view content in your preferred language

Publish script with MDCS as web tool

547
0
05-19-2023 12:50 AM
MoritzHackenberg
Occasional Contributor
 

I am trying to publish a Python script as a web tool. It calls MDCS (Mosaic Dataset Configuration Script) several times. It flags missing data stores for /Footprints, referring to the Footprint layer of the mosaic datasets. I thought it would be because of the function "import mosaic dataset geometry".

                    <CalculateValue>
                        <fieldName>GroupName</fieldName>
                        <expression>splitLayerName(!Name!)</expression>
                        <expression_type>PYTHON3</expression_type>
                        <code_block>import re
def splitLayerName(value):
    mo = re.search('^dtk(25|50|100)[_]\d{4,5}[_]\d{4}[_]\d+|^[lc]?\d{4}', value.lower())      
    try:
        return mo.group()
    except AttributeError:
        return None
                        </code_block>
                    </CalculateValue>

                    <CalculateValue>
                        <fieldName>ZOrder</fieldName>
                        <expression>-1</expression>
                        <expression_type>PYTHON</expression_type>
                    </CalculateValue>
                </CalculateValues>

                <ImportGeometry>
                    <target_featureclass_type>$FOOTPRINT$</target_featureclass_type>
                    <target_join_field>GroupName</target_join_field>
                    <input_featureclass>\\lswfsdtk1\dtk2\DTK-N-Repository\Ressourcen\DTK-N_Erfassungseinheiten.gdb\b$massstab$_utm3$utm$s</input_featureclass>
                    <input_join_field>DTKNR</input_join_field>
                </ImportGeometry>

                <ClipFootprints>
                    <in_feature_class>\\lswfsdtk1\dtk2\DTK-N-Repository\Ressourcen\dtk$massstab$_Bestand.gdb\dtk$massstab$_laenderpolygone</in_feature_class>
                    <where_clause>Land LIKE '$land$'</where_clause>
                    <out_feature_class>$workspace$\dtk$massstab$_$land$_$datum$.gdb\source_footprints</out_feature_class>  
                </ClipFootprints>

However, commenting out the parameter configurations and commands at the top of the xml did not change it. It also flags "24046 tool calculate field cannot use VB expressions for services" Is that referreing to the python Regular expression?

0 Kudos
0 Replies