Hi,
I have two layers. Both layer has columns. Using that column values difference I want to find features from one layer. I know the option of one layer to get feature by column values
inmemorylayer.FeatureSource.GetFeaturesByColumnValue() which works for layers own column values.
Example :
layer1 column A- value 10
layer2 column B- value 20
From layer1 find the features which values are less or equal to (layer2 Column B - layer1 Column A).
Using loop and checking individual conditions I am able to get it. But any other way without loop we can get it. Please suggest the way to get it.
Thanks,
Goral
Get Features from layer with reference to two layer column values
Hi Goral,
If you want to implement statistics cross multiply layers, I think the way you mentioned to loop all the features by group and write your own logic for compare is already the best solution.
The columns of features in layer is just saved like collection, so you can handle them like collection.
Regards,
Don
Hi,
Thanks for reply.
Goral
Hi Goral,
Any question please let us know.
Regards,
Don
Hi,
I have one more question related to this so I am adding in this only.
In one layer column values "",100,200 etc. I want the features which value is not "". In GetFeatureByColumnvalue() I am getting which value feature I want to get. Please suggest how to get it.
Thanks,
Goral
Hi Goral,
We could filter these empty columns by LINQ statement. Would you please try codes below?
layer.Open();
List<Feature> filterdFeatures = layer.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns)
.Where(feature => feature.ColumnValues["columnName"] != string.Empty).ToList();
Hope it helps and any question please don’t hesitate to let us know.
Regards,
Don
Hi,
Thanks for reply. Ya its working fine and very helpful.
Goral
Hi Goral,
Glad to it works fine. Let us know if we can be of any additional assistance.