Hello,everyone.
i used to tried to use the gp tool for copying features. I know the efficiency of the gp tool is optimal.But it doesn't seem to support queryfilter.
And I have implemented a method to copy the sde features to local gdb's same featureclass, and the queryfilter based on the spatial intersection. But the efficiency of this copy is rather slow, can anyone provide a better idea or implementation method?
Solved! Go to Solution.
Hi,
You need to select features using spatial filter first and then use geoprocessing. Most of geoprocessing tools checks automatically for layer selection.
SpatialQueryFilter filter = new SpatialQueryFilter();
// define filter patameters
layer.Select(filter);
// Call geoprocessing using layer as input parameter
sir,thank you for your reply.
This approach works. I've tried it before. The gp tool can use layers as input parameters. This method is efficient.
But I can't let the user know what feaclass table I've manipulated in the background. So should I do it that way, first load the sde featureclass as a layer on the map, then finish the selection, then copy it with the gp tool, and finally remove the relevant layer?
Hi,
There is better way. You can use Feature Class To Feature Class geoprocessing tool. You can set SQL expression for it. But expression you need to form by yourself, From spatial query read each row OBJECTID and form expression like this: OBJECTID in (.....)
Hi,
You need to select features using spatial filter first and then use geoprocessing. Most of geoprocessing tools checks automatically for layer selection.
SpatialQueryFilter filter = new SpatialQueryFilter();
// define filter patameters
layer.Select(filter);
// Call geoprocessing using layer as input parameter
sir,thank you for your reply.
This approach works. I've tried it before. The gp tool can use layers as input parameters. This method is efficient.
But I can't let the user know what feaclass table I've manipulated in the background. So should I do it that way, first load the sde featureclass as a layer on the map, then finish the selection, then copy it with the gp tool, and finally remove the relevant layer?
Hi,
There is better way. You can use Feature Class To Feature Class geoprocessing tool. You can set SQL expression for it. But expression you need to form by yourself, From spatial query read each row OBJECTID and form expression like this: OBJECTID in (.....)
Wow, a new tool, another treasure found.
sir,you are really a genius, thank you for your selflessness.
I also asked a question before about exporting cad leaders.This issue was left behind.Can I ask you for advice?The following one.
It doesn't matter
I will also try to try more.Thank you