<div dir="ltr">Hi everyone again,<div><br></div><div style>As an update to this topic, I am trying to solve this problem from a different angle: getting through a command the FdoIGetSpatialContexts, and accessing the FdoIEnvelope from FdoISpatialContextReader -> GetExtent and converting the FdoByteArray to a FdoIGeometry.</div>
<div style><br></div><div style>By doing this, I can easily access to the extents of all the features. However, if I cannot find the minX, minY, maxX and maxY values that are expected.</div><div style><br></div><div style>
A snippet of the code (based on <span style="color:black;font-family:Consolas">SpatialContextTests::test_create_delete </span>and <span style="color:black;font-family:Consolas">ArcSDETests::get_extent</span>):</div><div style>
<br></div><div style><pre style="font-family:Consolas;color:black"> FdoPtr < FdoIGetSpatialContexts > cmdGetSpatialContexts = provider->createCommand< FdoIGetSpatialContexts >( FdoCommandType_GetSpatialContexts );
<span style="color:blue">if</span> (cmdGetSpatialContexts)
{
cmdGetSpatialContexts->SetActiveOnly( <span style="color:blue">false</span> );
FdoPtr < FdoISpatialContextReader > scReader = cmdGetSpatialContexts->Execute();
<span style="color:blue">while</span> (scReader->ReadNext())
{
FdoStringP name = scReader->GetName();
std::string str = std::string(<span style="color:blue">static_cast</span><<span style="color:blue">const</span> <span style="color:blue">char</span> *> (name));
<span style="color:green">// Get extent:</span>
FdoPtr<FdoByteArray> fgfArray = scReader->GetExtent();
<span style="color:green">// Convert spatial context's extent to a FdoIEnvelope:</span>
FdoPtr<FdoFgfGeometryFactory> fgfFactory = FdoFgfGeometryFactory::GetInstance();
FdoPtr<FdoIGeometry> geom = fgfFactory->CreateGeometryFromFgf(fgfArray);
FdoPtr<FdoIEnvelope> geomEnvelope = geom->GetEnvelope();
<span style="color:green">// Convert envelope to minx/miny/maxx/maxy:</span>
<span style="color:blue">double</span> minx = geomEnvelope->GetMinX();
<span style="color:blue">double</span> miny = geomEnvelope->GetMinY();
<span style="color:blue">double</span> maxx = geomEnvelope->GetMaxX();
<span style="color:blue">double</span> maxy = geomEnvelope->GetMaxY();
}
}</pre></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>Thanks in advance,</div><div class="gmail_extra" style>Alfredo.</div><div class="gmail_extra" style><br>
</div><div class="gmail_extra" style><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 10, 2013 at 12:20 PM, Alfredo Muela-Romero <span dir="ltr"><<a href="mailto:alfredo.muela@pds.nl" target="_blank">alfredo.muela@pds.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi everyone,<div><br></div><div>Given a Feature class (in particular a raster data one, although I guess it can be generalized), I am trying to figure out the four corners (assuming same "z"-dimension).</div>
<div><br></div><div>The approach is to execute a SQL command to retrieve MINX, MINY, MIZ, MAXX, MAXY, MAXZ from SDE.LAYERS with the appropriate owner and table. From those two coordinates that the z-dimension equality can be checked and the 4 corners defined.</div>
<div><br></div><div>With that approach I get the expected values... usually. In other words, there are some features when the values from the query are hugely different. In order to validate the results, I use ArcCatalog to compare the Top, Left, Right and Bottom values from the Extent property.</div>
<div><br></div><div>My questions are:</div><div> - can anyone shed some light on why is that happening?</div><div> - should I use a different approach to get this information?</div><div><br>
</div><div><br></div><div>Many thanks,</div><div>Alfredo.</div></div>
</blockquote></div><br></div></div>