SDE Command/Method to calculate extent

802
8
01-13-2013 10:47 PM
VinayakJogade
New Contributor
Hi,

We have came across certain requirements under which we want to reconfigure the map in specific scenario.
So, my question to the respective members is that- Is there any direct method/function already available in SDE dll which further can be used to recalculate extent directly ? If yes, then explanation with example would be benificial.
If no, then which alternate method from sde dll can be used to recalculate it and how ?

As a part of supportive information, we are using this SDE dll in .Net environment by introducing wrapper methods and calling those methods/functions.

thanks in advance.....:)
0 Kudos
8 Replies
JakeSkinner
Esri Esteemed Contributor
You can use the 'sdelayer -o alter' command with the '-E' option to calculate the extent.  Ex:

sdelayer -o alter -l airports,shape -E calc -D gis -i sde:sqlserver:server -u vector -p vector


For the '-E' option you can use 'calc' to automatically calculate the extent, or you can enter the extent manually, i.e. (-E -75.07,40.03,-74.98,40.10)
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Using .NET against the ArcSDE DLLs isn't really supported.  The supported mechanism would
be to use C++ against the 'C' API to make .NET objects, though in this case, the  SE_ENVELOPE
object is representable with a wrapper.  The 'C' API documentation explains all the available
functions, and should be your first reference when attempting 'C' API programming.  All-in-all,
using 'sdelayer' is much easier.

You need to be careful about changing the extents of layers, since the optimizer uses the
ratio of the layer extent to the search envelope to determine if the spatial index should be
used -- envelope changes can have an impact on draw performance.

- V
0 Kudos
VinayakJogade
New Contributor
You can use the 'sdelayer -o alter' command with the '-E' option to calculate the extent.  Ex:

sdelayer -o alter -l airports,shape -E calc -D gis -i sde:sqlserver:server -u vector -p vector


For the '-E' option you can use 'calc' to automatically calculate the extent, or you can enter the extent manually, i.e. (-E -75.07,40.03,-74.98,40.10)


Jake, first of all thanks for the reply.

I am worried about this command as it would give me altered extent of all layers. However, I am using dynamic service (updating data @ run time) with single layer, so does this command alter it upto that layer only ?
0 Kudos
JakeSkinner
Esri Esteemed Contributor
This command will only update the layer specified with the '-l' option.  In the example above, only the "airports" feature class extent will be updated.
0 Kudos
VinayakJogade
New Contributor
Using .NET against the ArcSDE DLLs isn't really supported.  The supported mechanism would
be to use C++ against the 'C' API to make .NET objects, though in this case, the  SE_ENVELOPE
object is representable with a wrapper.  The 'C' API documentation explains all the available
functions, and should be your first reference when attempting 'C' API programming.  All-in-all,
using 'sdelayer' is much easier.

You need to be careful about changing the extents of layers, since the optimizer uses the
ratio of the layer extent to the search envelope to determine if the spatial index should be
used -- envelope changes can have an impact on draw performance.

- V


Offcourse, I am using 'C API' from SDE dll, but little bit ambigious to use exact function to calculate extent of dynamic single layer.
So expecting any clue.

again thanks in advance..:)
0 Kudos
VinceAngelo
Esri Esteemed Contributor
I'm not sure what you mean by 'ambiguous' or 'dynamic single layer'.  There are
only a dozen functions in 'sdetype.h' that take SE_ENVELOPE parameters, and the
only functions that are relevant are the ones with "layer" in their name.  From the
ArcSDE API standpoint, all layers are "single", and the only "dynamic" objects in the
API are the "shape table" and "point table" (SE_STABLE & SE_PTABLE) constructs,
neither of which are a "layer".

From an ArcSDE standpoint, you'll get much better performance if you aways initialize
all layers with their potential extent at creation time (e.g. set to "-180,-90,180,90" for
GCS_WGS_1984), which obviates the need to ever recalculate extents, from the API
*or* with 'sdelayer'. 

- V
0 Kudos
VinayakJogade
New Contributor
This command will only update the layer specified with the '-l' option.  In the example above, only the "airports" feature class extent will be updated.


Jake, I think its lengthy part to introduce supportive framework for commands in the project framework, instead I think it would be easy to have methods from sde dll. Can you suggest any method or steps corresponding to this command which can give me extent/alter extent ?
0 Kudos
VinceAngelo
Esri Esteemed Contributor
There's nothing easy about the ArcSDE 'C' API.  Plan on spending several weeks to learn
it well enough to use it.  The first step is actually to learn the command-line utilities well
enough to envision the function calls necessary to implement them.  And in this case,
it isn't even necessary -- If you create the layer with the correct envelope you won't
need to update it.

- V
0 Kudos