<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Cambria;
        panose-1:2 4 5 3 5 4 6 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.gmailsignatureprefix
        {mso-style-name:gmail_signature_prefix;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Thank you Jackie! This is very helpful.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Now I’m getting and Exception when executing the ISelect.  I think it is because lyr.GetFeatureGeometryName() returns an empty string.<o:p></o:p></p>
<p class="MsoNormal"><img width="1249" height="448" style="width:13.0104in;height:4.6666in" id="Picture_x0020_1" src="cid:image002.png@01D99F56.364B5210"><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> mapguide-users <mapguide-users-bounces@lists.osgeo.org>
<b>On Behalf Of </b>Jackie Ng<br>
<b>Sent:</b> Wednesday, June 14, 2023 6:45 AM<br>
<b>To:</b> mapguide-users@lists.osgeo.org<br>
<b>Subject:</b> Re: [mapguide-users] Resample or Clip expression for WMS connection<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><strong><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:white;background:#FF6600">CAUTION: This email originated from outside the organization.
</span></strong><br>
<strong><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:white;background:#FF6600">Do not click links or open attachments unless you recognize the sender and know the content is safe.</span></strong><o:p></o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">Actually you're not too far off.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You use the expression capabilities as a programmatic way to answer the question of "What functions I can use for expressions against this particular FDO provider?" by checking if your function of interest (CLIP) is in the collection of
 supported functions.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If you know in your code that the feature source in question is always pointing to a WMS connection, then you know (from the provider documentation) that CLIP() is supported and you can bypass this capability check. Otherwise, you would
 use the various capabilities from the root IConnection to ask questions of what this connection can or cannot do.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">As for what to do with the command. your CreateCommand call is close, but you are actually supposed to cast that ICommand down to a derived command interface. The ICommand interface itself is pretty barebones and not something you'll ever
 use directly. The CommandType enum you're passing in is the hint as to what command interface you're actually supposed to cast to.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">CommandType.CommandType_Select -> cast the result to ISelect<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">CommandType.CommandType_DescribeSchema -> cast the result to IDescribeSchema<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">CommandType.CommandType_SelectAggregates -> cast the result to ISelectAggregates<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">etc, etc.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Here's a snippet adapted from the "FDO Cookbook - Select Data" example from that devguide link that gives a rough idea of what you're supposed to do once you've created a select command:<o:p></o:p></p>
</div>
<blockquote style="margin-left:30.0pt;margin-right:0in">
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">// The MgLayerBase has the name of the feature class</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">Identifier className = new Identifier(lyr.GetFeatureClassName());</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">// Make the select command</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ISelect select = conn.CreateCommand(CommandType.CommandType_Select) as ISelect;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">// Set the name of the feature class this select command is querying from</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">select.FeatureClassName = className;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">// The MgLayerBase also knows the name of the designated geometry/raster property for the layer, which you need to know for the first argument of CLIP()</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">// note the name "clipped_raster", which is our alias for this computed property</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">ComputedIdentifier computedId = Expression.Parse($"CLIP({lyr.GetFeatureGeometryName()}, {minX}, {minY}, {maxX}, {maxY}) AS clipped_raster") as ComputedIdentifier;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">// Add this computed property to the select command</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">select.PropertyNames.Add(computedId);</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">// Execute the command</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">IFeatureReader reader = select.Execute();</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">// You need to advance the reader in order to get data out of it</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">try {</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">    while (reader.ReadNext()) {</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">        // Access the raster by the computed alias name</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">        var raster = reader.GetRaster("clipped_raster");</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">        // TODO: Do something with the raster data</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">    }</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">}</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">finally {</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">    // Always close the feature readers afterwards when done. Putting this in the finally section of
</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">    // a try/finally block ensures this always happens (regardless of exceptions thrown in the try block)</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">    reader.Close();</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">}</span><o:p></o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You'll need to provide your own minX, minY, maxX, maxY values for the CLIP() function call.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Hope that helps.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">- Jackie<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You wrote:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I am using Autodesk Civil 3D/Map 3D (contains a MapGuide component) and I need to create a custom command to clip or resample raster image via WMS connection. I am a C# developer.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I see the appropriate expression capabilities listed here, but I cannot find any examples how to apply these expressions to the WMS connection.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="http://docs.autodesk.com/MAP/2014/ENU/Developer_Guides/index.html" target="_blank">FDO Developer's Guide: FDO Provider for WMS Capabilities (autodesk.com)</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Can anyone provide an example on how to use expressions? This is what I have so far, but don’t feel like I’m close.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">using</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> Autodesk</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Gis</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Map</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Platform</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">using</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> OSGeo</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">FDO</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Commands</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">using</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> OSGeo</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">FDO</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Connections</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">using</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> OSGeo</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">FDO</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Connections</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Capabilities</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">using</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> OSGeo</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">FDO</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Expression</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">using</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> OSGeo</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">MapGuide</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">namespace</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> MapServices</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">{</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">    </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">public</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">class</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><span style="font-size:10.0pt;font-family:"Courier New";color:#005FD2">WmsLayer</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">    </span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">{</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">        </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">public</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">static</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">void</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><span style="font-size:10.0pt;font-family:"Courier New";color:#005FD2">ClipMapLayer</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">(</span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">string</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> layerName</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">{</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">            AcMapFeatureService fs </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> AcMapServiceFactory</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">GetService</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">MgServiceType</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">FeatureService</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">)</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">as</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> AcMapFeatureService</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//Get the current Map.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">            AcMapMap currentMap </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> AcMapMap</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">GetCurrentMap</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">()</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//Get the collecton of Map 3D layers</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">            MgLayerCollection layers </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> currentMap</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">GetLayers</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">()</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">            </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">if</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">layers</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Contains</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">layerName</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">))</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//Make
 sure the specified Map 3D layer exists</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">{</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//Get the specified Map 3D layer with the Raster image.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                MgLayerBase lyr </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> layers</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">GetItem</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">layerName</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">)</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//Get the resource identifier</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                MgResourceIdentifier identifier </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#E66170">new</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> MgResourceIdentifier</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">lyr</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">FeatureSourceId</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">)</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//Get the FDO connection from the resource</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                IConnection con </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> fs</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">GetFdoConnection</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">identifier</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">)</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//I can get the Expression capabilities from the connection, but what do I do with that</span><span style="font-size:10.0pt;font-family:"Courier New";color:white;background:#3C215F">??</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                IExpressionCapabilities expCaps </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> con</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">ExpressionCapabilities</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                ExpressionType</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">[]</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> types </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> expCaps</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">ExpressionTypes</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                FunctionDefinitionCollection funcs </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> expCaps</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Functions</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//Is this how to create the expression?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//How do I pass the inputs into the expression?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//How is a BLOB created from the raster?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                Expression wmsCmd </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> Expression</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">Parse</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#02D045">"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#00C4C4">CLIP(raster,
 minX, minY, maxX, maxY)</span><span style="font-size:10.0pt;font-family:"Courier New";color:#02D045">"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">)</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9">//Do I somehow pass the expression into an ICommand</span><span style="font-size:10.0pt;font-family:"Courier New";color:white;background:#3C215F">???</span><span style="font-size:10.0pt;font-family:"Courier New";color:#9999A9"> 
 No idea what command type is correct.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">                ICommand cmd </span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">=</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1"> con</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">CreateCommand</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">CommandType</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">CommandType_Select</span><span style="font-size:10.0pt;font-family:"Courier New";color:#D2CD86">)</span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">}</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">}</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#D1D1D1">    </span><span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">}</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:black">
<span style="font-size:10.0pt;font-family:"Courier New";color:#B060B0">}</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thank you for your assistance!<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:14.0pt;font-family:"Cambria",serif">Keith Sowinski, P.E.</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Civil 3D Implementation Engineer<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Methods Development Unit<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">WisDOT Bureau of Project Development<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Office: (920) 492-4132<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="http://wisconsindot.gov/" target="_blank">wisconsindot.gov</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><span class="gmailsignatureprefix">-- </span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><i><span style="font-size:7.5pt">Please Note: I no longer create new posts or post replies to any OSGeo mailing list through nabble. As a result, you most likely won't see this message appear on nabble's view of any OSGeo mailing list and
 may only see this message through mailing list archives or depending on your mailing list subscription settings, through daily message digests or automated notifications from the mailing lists.</span></i><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>