I have a Tab File, which is loaded by TabFileFutureLayer on map control.
My question is
1. Is the tab file editable?
My requrement is, we are doing survey for our client. Some times distance of survey done extra from the actual site by mistake and that is not requirement of customer. After expoting log file from TEMS, I am geeting tab file. When I am plotting tab file on map control, now requirement is
1. select all those point on map, which is extra survey, with help of mouse.
2. Remove all those points from tab file, which is extra surveyed bu us, is selected by mouse, so that modified syrveyed tab file can submit to customer.
In current TabFileFeatureLayer, we only provide read-only functions for tab files. We’re deeply sorry for the inconvenience, but we’ll carefully consider your requirement, hopefully we’ll integrate edit functions into TabFileFeatureLayer in the near future.
In May release we added the strong ability for tab file that includes the load, edit functionalities. Please keep your eyes on the website once the new public release can be downloaded,
Thank you to added new editing features for TAB File. I have worked as a sample for my purpose and my concern is
1. In 4.5.0.0 desktop version a class used TabFileFutureLayer, but in 5.0.0.0 version TabFutureLayer class has used. It means if I use 5.0.0.0 version, my whole project needs to modify. Is I am right or wrong? If I am right, what is the best way?
2. The sample provided on wiki for NativeTabFileSupport, I gone through the sample and reprojected my concern but its not working for me. The difference is the sample Tab File used is based on area style, but my Tab File is based ob point style. Please help to solve my problem.
TabFileFeatureLayer is renamed to TabFeatureLayer in the API review before 5.0 public release. As well as some minor API changes. The TabFileFeatuureLayer is added after 4.5 public release which doesn’t pass through the API review. We have to do this breaking change before it goes further. I am afraid you have to do the renaming in your whole project. Sorry for the inconvenience.
For the 2# question, could you please upload your sample project as well as the data?
I have attached my sample code with my ticket no 3370.
My concern point is 1. When I am clicking on map
tabFeatureLayer.QueryTools.GetFeaturesContaining(e.WorldLocation, ReturningColumnsType.AllColumns) - is used to select for area style
this not worked for point style map, so I used tabFeatureLayer.QueryTools.GetFeaturesNearestTo(clickedPointShape, WinformsMap1.MapUnit, 1, ReturningColumnsType.NoColumns)
So, how we decide, which function will used based on map display style
2. After point selection and click on delete button, either point not deleted or map not refreshed.
3. When multiple selection used and clicked on delete button, an error occured, key not found.
4. How to add new point like star on map with mouse click on map.
Thanks for your sample. Let’s go through your questions.
1. The styles are just control the data rendering, it has nothing to do with any of the spatial queries nor projections. The shape(feature) decided itself is a Point, Line or Area Type, and we will apply certain style on it to draw.
You are trying to use the method GetFeaturesContining() to query the features containing the point you passed in, that’s correct, but keep this in mind, only area type feature may contains other features, such as lines or points, so this method only works for area features.
If you want to find the Point type feature around your clicking point, the GetFeaturesNearest() is one option. And there is another one: create a RectangeShape (or AreaType shape) in certain size based on the point you clicked, and use GetFeaturesWithIn(), that will return the features inside the shape you created.
2. We will do some test on 2# and 3# and let you know how it goes.
3. About adding points by clicking on map, I would like do this:
a. Create a InmemoryFeatureLayer.
b. Setup the styles
c. On WinformsMap1_MapClick event, convert the mouse click point to world coordinate, and add it into the InmemoryFeatureLayer.
Thanks For replay. I am eagerly waiting answer for my 2nd and 3rd question. If possible please provide sample for 2nd, 3rd and 4th point.
One thing I want to know, If I am deleteing some points on map, is it deleting point on map or from tab file or both? My concern point is if I am deleting some points on map and not saved, it will affect my tab file or not.
We have a bug in TabFeatureLayer spatial queries, the return feature’s ID is incorrect, so the Delete method doesn’t work properly on the TAB file. we have added this bug in our issue track system. Sorry for the inconvenience.
For the 4#, I created a simple sample below.
Private Sub frmEditTabFile_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ver As String = WinformsMap.GetVersion WinformsMap1.MapUnit = GeographyUnit.DecimalDegree WinformsMap1.ThreadingMode = MapThreadingMode.SingleThreaded WinformsMap1.BackgroundOverlay.BackgroundBrush = New GeoSolidBrush(GeoColor.GeographicColors.DeepOcean)
Dim starLayer As New InMemoryFeatureLayer() starLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20 starLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = New PointStyle(PointSymbolType.Star, New GeoSolidBrush(GeoColor.SimpleColors.Red), 10)
Dim StarOverlay As New LayerOverlay() StarOverlay.Layers.Add("StarLayer", starLayer)
WinformsMap1.CurrentExtent = New RectangleShape(-180, 90, 180, -90) WinformsMap1.Refresh()
AddHandler WinformsMap1.MapClick, AddressOf WinformsMap1_MapClick End Sub
Private Sub WinformsMap1_MapClick(ByVal sender As Object, ByVal e As MapClickWinformsMapEventArgs) If WinformsMap1.TrackOverlay.TrackMode = TrackMode.None Then Dim starLayer As InMemoryFeatureLayer = WinformsMap1.FindFeatureLayer("StarLayer")
Sorry for the inconvenience, we have updated the status for ticket 3370, in the ticket 3370 you posted two issues, one is for the delete issue, another is for the loading performance issue. The delete issue had been fixed, please get the 5.0.20.0 to try again, the loading performance issue has been added to our issue list, our development team will work on that and if there are any updates I will let you know,
First thing is in ticket 3370 I have posted three issue 1. Delete issue from tab file : with help of 5.0.20.0, still I am not able to delete the features. 2. Performance Issue : Currently your team is working on this. 3. Layer refresh problem : Still the same condition.
For your three issues in this post, actually, I’m working on your first two issues, Gary is working on the Layer.Refresh issue. So I just focus on the delete issue and performance issue. Currently the status is:
1, Delete issue: This issue had been fixed properly I just verified it. Also I reviewed your sample code again and I found out the actual problem is from your sample code, please get the attachment in the ticket 3370 that I modified the code in the Delete event, then it works fine. Please reference the 5.0.20.0 dlls.
2, Working on it. Any updates I will let you know.
3, Gary is working on it and he will work with you directly for this issue.
I have worked with sample, which you provided on my ticket no 3370 with 5.0.20.0 dll. Some problems are still there which I faced,
1. Delete Single point Select point with mouse click (Working) Delete point with delete butoon (Either not working or not map no refresh), but no error Again Select point with mouse click (Error comes messge - The given key was not present in dictionaly.
2. Delete With Multi point Seletion Select Multi point with TrackOverly (Working) Delete selected point with Delete button (Working)
So, now the problem with only first point, which describe above. Please look into it.
I have updated the associate ticket 3370 and I upload an new sample for you again, the issue of delete single point is from your sample code, I modified it please check it again.
Also for the load performance, we have fixed it, please get latest version to try again,
As I am working for whole Editing Concept (Add, Edit, Delete), one thing I want to know:
As you have guided me to add point (star Point) in the InMemoryFeatureLayer (Post No 46) and today I worked with save point into tab file. One thing I want to know, one option is available for Track Mode
can we use this (TrackMode.Custom) instead of to maintain one extra layer. it will be better if we can set custom as PointStyle (PointStyleType.Star, New GeoSolidBrush(GeoColor.SimpleColors.Red),10).
Means the Custom mode can set as star point with color and size.
If it will work, then one save command is able to save whole changes which has done through track mode otherwise I have to run two save command, one for Track Mode and another for InMenoryFeatureLayer.