|
POST
|
You might have a problem with the geodatabase or geometries. Try to convert them into shapefile and repeat the process if helps.
... View more
01-30-2021
08:47 AM
|
0
|
0
|
1583
|
|
POST
|
@KirkKuykendall1 and @tempStephenRhea_NV5 Thank you for your answers. Both ScrollViewer and ListBox functon the same in terms of scrolling but ListBox changed the design a little bit, so I decided to use ScrollViewer. However, neither of them was scrolling if the controls fit inside in it. Furthermore, when DockPane floating scroll bar was not auto adjusting So, I created an event which adjust the height of ScrollViewer when UserControl's size changed. Now, it works fine and adapts the height when dockpane size changes. Here is the code not proper MVVM but it works private void KSDEUserControl_SizeChanged(object sender, SizeChangedEventArgs e)
{
StackPScrollViewer.Height = KSDEUserControl.ActualHeight;
}
... View more
01-28-2021
09:03 AM
|
1
|
0
|
3902
|
|
POST
|
Hi @KirkKuykendall1 I am not sure what that sample does. Do you mind elaborate?
... View more
01-27-2021
03:14 PM
|
0
|
1
|
3929
|
|
POST
|
XAML (Probably DockPane1.xaml)
<UserControl ..../>
<UserControl.Resources>
<Grid x:Name="YourGridName>
<!--All your controls here that will be blocked during long process-->
</Grid>
//C# (Probably Dockpane1.xaml.cs)
private void LongProcessEventTriggered(object sender, EventArgs e)
{
QueuedTask.Run(() =>
{
Dispatcher.Invoke(() =>
{
YourGridName.IsEnabled = false;
});
Do your stuff
Dispatcher.Invoke(() =>
{
YourGridName.IsEnabled = true;
});
}
} This is not proper MVVM but functions the same way if you bind your grid/stackpanel etc. you probably wouldn't need dispatcher
... View more
01-27-2021
01:30 PM
|
0
|
1
|
2798
|
|
POST
|
I generated a DockPane but some laptop users complained they are not able to see whole dockpane neither they can roll vertically to see the rest of the dockpane. There is a vertical scroll viewer shows up on catalog dockpane if content does not fit into it. I would like to utilize something like that. On my dockpane I have list boxes mainly vs catalog pane has only tree view items but still there should be a way to do this I tried a few things but I couldn't make it show up <StackPanel x:Name="MainStackPanel" Background="WhiteSmoke"
ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
> I would appreciate any help - Thanks
... View more
01-27-2021
01:20 PM
|
0
|
5
|
3947
|
|
POST
|
Thanks for the all help, I learned a lot from this post. I will implement something like this when selection made (either layer or county) check the selected layer's dictionary if dictionary not exist : create the dictionary then read dictionary into ListView for given criteria else read dictionary into ListView for given criteria rather than creating all dictionaries at once as soon as ProWindow started
... View more
01-20-2021
12:14 PM
|
0
|
0
|
7964
|
|
POST
|
Thank you @Wolf and @Anonymous User I tried both Sorted Dictionary and Data Table and measured time on a ~300K rows 10+ fields Feature Class Here are the methods as one of them commented public void GenerateRoadDict(FeatureLayer RoadLayer, SortedDictionary<long, string[]> RoadDict)
{
//FeaturesDataTable.Columns.Add(RoadColHead);
//FeaturesDataTable.Columns.Add(RouteColHead);
//FeaturesDataTable.Columns.Add("county");
//FeaturesDataTable.Columns.Add("routetype");
//var listValues = new List<List<string>>();
using (ArcGIS.Core.Data.Table RoadFLayerTable = RoadLayer.GetTable())
{
using (RowCursor rowCursor = RoadFLayerTable.Search())
{
while (rowCursor.MoveNext())
{
using (ArcGIS.Core.Data.Row row = rowCursor.Current)
{
//var newRow = new List<string>();
//newRow.Add(row["RD_NAME"].ToString());
//newRow.Add(row["ROUTE"].ToString());
//newRow.Add(row["CO_NAME"].ToString());
//newRow.Add(row["ROUTE_TYPE"].ToString());
//listValues.Add(newRow);
string[] dictvalue = new string[]
{
row["rd_name"].ToString(),
row["route"].ToString(),
row["co_name"].ToString(),
row["route_type"].ToString()
};
long v = Convert.ToInt64(row["objectid"].ToString());
RoadDict[v] = dictvalue;
};
}
}
}
//foreach (var row in listValues)
//{
// var newRow = FeaturesDataTable.NewRow();
// newRow.ItemArray = row.ToArray();
// FeaturesDataTable.Rows.Add(newRow);
//}
} //in QueueTask.Run
Stopwatch timer = Stopwatch.StartNew();
GenerateRoadDict(LocalRoads, LocalRoadsDict);
timer.Stop();
TimeSpan timespan = timer.Elapsed; creating Sorted Dictionary took to 28 secs vs creating Data Table took 26 secs Also having the dictionary keys as long type helped significantly I think I will stick with Sorted Dictionary since there is not much time difference and I don't have to change anything
... View more
01-20-2021
12:01 PM
|
0
|
0
|
7964
|
|
POST
|
I used SortedDictionaries but they did not make much difference. I tried to create attribute indexes but it did not work. I have only viewing permission on the data. That is the problem I think. Users have to narrow down the search by selecting county and road type. I am using that criteria to narrow down the search and update ListView.ItemsSource which displays the results. Initially building dictionaries taking time, querying is very fast but . If I read directly from table into ListView.ItemsSource this time every query has some delays. It is because a large table get going through in every query. I don't know I might need to take a closer look to TableContent idea. Thanks!
... View more
01-19-2021
01:28 PM
|
0
|
1
|
7979
|
|
POST
|
Hi @Anonymous User , Is there any link or example you know showing the solution you offered I searched but I could not find much. I think I can bind the DataTable as ItemsSource="{Binding RoadDataTable}" but how do I cast/convert FeatureLayer/ArcGIS.Core.Data.Table to DataTable ? Thanks!
... View more
01-19-2021
01:09 PM
|
0
|
0
|
7979
|
|
POST
|
I thought about that but I thought it would be too complex to implement, I will check your click and see what I can do. Thanks!
... View more
01-18-2021
10:28 AM
|
0
|
2
|
7999
|
|
POST
|
I have utilized a ProWindow which shows road names and route numbers for selected county and road type Altogether I need to read about 350K - 400K rows ( all feature counts local, state, etc. ). I tried a few different strategies to load them faster. The best way I found: I created dictionaries for each feature class ( local, state, highways ..) which are filled from reading attribute tables after initialization of the ProWindow. Whenever a user selects a feature class and county that dictionary filtered and transferred to ListView items source. However, initialization takes more than a minute public Dictionary<string, string[]> GenerateRoadDict
(FeatureLayer RoadLayer, Dictionary<string, string[]> RoadDict)
{
using (ArcGIS.Core.Data.Table RoadFLayerTable = RoadLayer.GetTable())
{
using (RowCursor rowCursor = RoadFLayerTable.Search())
{
while (rowCursor.MoveNext())
{
using (ArcGIS.Core.Data.Row row = rowCursor.Current)
{
string[] dictValue = { row["RD_NAME"].ToString(), row["ROUTE"].ToString(), row["CO_NAME"].ToString() };
RoadDict[row["OBJECTID"].ToString()] = dictValue;
};
}
}
}
return RoadDict;
}
public void LoadRoadsForSelectedCounty()
{
RoadItemsObsColl = new ObservableCollection<RoadItems>();
Dictionary<Dictionary<string,string[]>, bool> DictAndBoolDict = new Dictionary<Dictionary<string, string[]>, bool>
{
{ LocalRoadsDict, LocalRChecked },
{ StateRoadsDict, StateRChecked },
{ HighwaysDict, HighwaysChecked },
{ InterstateDict, InterstateChecked },
{ ParkwaysDict, ParkwaysChecked }
};
foreach (KeyValuePair<Dictionary<string, string[]>, bool> kvp in DictAndBoolDict)
{
if (kvp.Value)
{
foreach (KeyValuePair<string, string []> kvpRoad in kvp.Key)
{
if (kvpRoad.Value[2] == SelectedCounty)
{
RoadItemsObsColl.Add(new RoadItems { roadItem = kvpRoad.Value[0], routeItem = kvpRoad.Value[1] });
}
}
}
}
} As a note I don't like to use table content Would there be better way? I could not figure how to convert ObjectID to long and use it as string as the dictionary key. If I use long would I get better performance?
... View more
01-15-2021
08:02 PM
|
0
|
9
|
8274
|
|
POST
|
Thanks a lot for detailed explanation. I did not think about two way binding. Let me try it.
... View more
01-05-2021
09:30 AM
|
0
|
0
|
2290
|
|
POST
|
Is there way to check if a row is selected when using row by row cursor using (ArcGIS.Core.Data.Table GNISFTable = (GNISFLayer as FeatureLayer).GetTable())
{
using (RowCursor rowCursor = GNISFLayer.Search())
{
while (rowCursor.MoveNext())
{
using (ArcGIS.Core.Data.Row row = rowCursor.Current)
//If row is not selected skip
{
fType = row["FEATURE_CLASS"].ToString();
state = row["STATE_ALPHA"].ToString();
county = row["COUNTY_NAME"].ToString();
quad = row["MAP_NAME"].ToString();
};
}
}
}
... View more
01-04-2021
03:19 PM
|
0
|
1
|
1428
|
|
POST
|
My original idea was using DataGrid but I have about 50K rows. In my case, TableControl is better to handle that many rows in addition coming with some nice ESRI controls. However, I could not find any event such as row click or mouse left click on row. I don't know how to implement one either.
... View more
01-04-2021
11:57 AM
|
0
|
0
|
2301
|
|
POST
|
I have utilized a TableControl and it works fine. <editing:TableControl AutomationProperties.AutomationId="_tableControl" x:Name="tableControl"
Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
SelectedRowsChanged="tableControl_SelectedRowsChanged"
TableContent="{Binding Path=TableContent}"
RowContextMenu="{StaticResource MyRowContextMenu}"
SelectedRowContextMenu="{StaticResource MyRowContextMenu}">
</editing:TableControl> Is there way to detect user left mouse click on a row in the table? I tried PreviewMouseLeftButton but that event is valid for whole table not specifically for a row.
... View more
12-30-2020
01:11 PM
|
2
|
4
|
2365
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-23-2021 02:29 PM | |
| 1 | 09-25-2024 03:31 PM | |
| 1 | 02-26-2024 06:48 AM | |
| 1 | 02-11-2020 02:18 PM | |
| 1 | 07-20-2022 08:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|