-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of variables in configuration script #24
Comments
Please note the correct syntax for the variable usage: It looks like there's a typo in the doc or the single '$' functionality in the MDCS source has been removed for clarity. Will update doc. Here the in the MDCS parameter file has to to be replaced with a unique name of your choice. Do this for all the variables you have, each with its own unique name without any duplicates unless you want the same user defined value to replace at multiple locations in the parameter file. e.g. CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Year_GENERIC;$MDName$ Now at the command like you can enter the following to replace the default value for the MD i.e CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Year_GENERIC with a value of your choice. e.g. -p:My_New_MD_Name$MDName Please correct your parameter file and try. If you still face any issues, let us know. From: eagletilmann [mailto:notifications@github.com] When using a batch file to create a series of similar Mosaic datasets from the same configuration file (see extract below) I am not able to use variables in the batch and configuration files. The variables seem to be ignored and the default value is always used. Also: how is a variable used when the variable name is non-unique in the configuration XML? (as is the case with which occurs twice at the top of the file). I am getting a The help specifies the following syntax: which in my case for below configuration file looks as follows when I want the, and variables to be dynamically specified: c:\python27\ArcGIS10.3\python.exe C:\Image_Mgmt_Workflow\MDCS\scripts\mdcs.py -i:C:\Image_Mgmt_Workflow\MDCS\Parameter\Config\MPI_CreateMosaicDataset_GENERIC_AlbersEqualArea.xml -p:CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Ficticious$MosaicDataset/Name -p:CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Year01$dataset_id -p:year=1$filter CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Year_GENERIC CM+AR+AF+BB+ERF+SP+CC+CV+AI+DO+BO
['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM ['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Albers'],PARAMETER ['false_easting',0.0],PARAMETER['false_northing',0.0],PARAMETER ['central_meridian',175.0],PARAMETER['standard_parallel_1',-30.0],PARAMETER ['standard_parallel_2',-50.0],PARAMETER['latitude_of_origin',-40.0],UNIT['Meter',1.0]]
Thanks for any help on this. — |
Thanks Peter, That works - Have updated my batch and config files. Just need to mention how MDCS really is the missing link for me when working with Mosaic datasets: scripted configuration of MDS will be the norm for me now- I can hardly believe how much manual configuration that is going to save! Would you consider writing a blog entry for the Esri blogs to promote this? Thanks for the great work! Tilmann On 25/07/2015, at 8:34 am, Peter Becker <notifications@github.commailto:notifications@github.com> wrote: Please note the correct syntax for the variable usage: It looks like there's a typo in the doc or the single '$' functionality in the MDCS source has been removed for clarity. Will update doc. Here the in the MDCS parameter file has to to be replaced with a unique name of your choice. Do this for all the variables you have, each with its own unique name without any duplicates unless you want the same user defined value to replace at multiple locations in the parameter file. e.g. CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Year_GENERIC;$MDName$ Now at the command like you can enter the following to replace the default value for the MD i.e CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Year_GENERIC with a value of your choice. e.g. -p:My_New_MD_Name$MDName Please correct your parameter file and try. If you still face any issues, let us know. From: eagletilmann [mailto:notifications@github.com] When using a batch file to create a series of similar Mosaic datasets from the same configuration file (see extract below) I am not able to use variables in the batch and configuration files. The variables seem to be ignored and the default value is always used. Also: how is a variable used when the variable name is non-unique in the configuration XML? (as is the case with which occurs twice at the top of the file). I am getting a The help specifies the following syntax: which in my case for below configuration file looks as follows when I want the, and variables to be dynamically specified: c:\python27\ArcGIS10.3\python.exe C:\Image_Mgmt_Workflow\MDCS\scripts\mdcs.py -i:C:\Image_Mgmt_Workflow\MDCS\Parameter\Config\MPI_CreateMosaicDataset_GENERIC_AlbersEqualArea.xml -p:CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Ficticious$MosaicDataset/Name -p:CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Year01$dataset_id -p:year=1$filter CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Year_GENERIC CM+AR+AF+BB+ERF+SP+CC+CV+AI+DO+BO md CatchMapper_MPI_Demo_YearlyMosaics CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Year_GENERIC;$ Source PROJCS['NZ_Albers_Equal_Area',GEOGCS['GCS_WGS_1984',DATUM ['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM ['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Albers'],PARAMETER ['false_easting',0.0],PARAMETER['false_northing',0.0],PARAMETER ['central_meridian',175.0],PARAMETER['standard_parallel_1',-30.0],PARAMETER ['standard_parallel_2',-50.0],PARAMETER['latitude_of_origin',-40.0],UNIT['Meter',1.0]] <num_bands>1</num_bands> <pixel_type>8_BIT_UNSIGNED</pixel_type> <dataset_id>MPI8bit_mosaics_Albers_Year05Grouped;$</dataset_id> <raster_type>Table @ C:\Image_Mgmt_Workflow\MDCS\MD\CatchMapper_MPI_Demo_YearlyMosaics.gdb\CatchMapper_MPI_AlbersEqualArea_MDCS_Demo\RasterType.OBJECTID=3</raster_type> <data_path>C:\Image_Mgmt_Workflow\MDCS\MD\CatchMapper_MPI_Demo.gdb\CatchMapper_MPI_AlbersEqualArea_MDCS_Demo</data_path> year=1;$ <duplicate_items_action>OVERWRITE_DUPLICATES</duplicate_items_action> Thanks for any help on this. — — This email is confidential and may be legally privileged. |
When using a batch file to create a series of similar Mosaic datasets from the same configuration file (see extract below) I am not able to use variables in the batch and configuration files.
The variables seem to be ignored and the default value is always used. Also: how is a variable used when the variable name is non-unique in the configuration XML? (as is the case with
<Name>
which occurs twice at the top of the file). I am getting alog-critical: Error: <Name> should be the first child-element in <MosaicDataset>
and then the MDCS script fails.
The help specifies the following syntax:
<defaultValue>;$<variableName>
which in my case for below configuration file looks as follows when I want the
<MosaicDataset><Name>
,<dataset_id>
and<filter>
variables to be dynamically specified:c:\python27\ArcGIS10.3\python.exe C:\Image_Mgmt_Workflow\MDCS\scripts\mdcs.py -i:C:\Image_Mgmt_Workflow\MDCS\Parameter\Config\MPI_CreateMosaicDataset_GENERIC_AlbersEqualArea.xml -p:CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Ficticious$MosaicDataset/Name -p:CatchMapper_MPI_AlbersEqualArea_MDCS_Demo_Year01$dataset_id -p:year=1$filter
Thanks for any help on this.
The text was updated successfully, but these errors were encountered: