Custom Format and other problem

Posted By James on 01-25-2010 02:27 AM 

Chen, 



I am not very sure what you want. The boundingBox is a parameter that passes in from outside, that you don’t need modify the value of it, just use it in GetFeaturesInsideBoundingBoxCore method. 



If you want to get the bounding box of a line shape, you can create an instance of LineShape by pass in the well known text, and then call the GetBoundingBox() method. 

The attached file Line.txt is the list of well known text of line shapes. 



Please let me know if you have more questions. 



Thanks 



James 






 


Sorry, James


Maybe I speak unclearly.


I attach program is your custom data format sample.


You can see GetFeaturesInsideBoundingBoxCore method, this method use point X, Y to control its rectange range.


But I use wkt of line shapes, one line shape contains many coordinate of X, Y.


so I don’t know how to set range or GetFeaturesInsideBoundingBoxCore by wkt of line shapes.


 


 











Hi Chen,


 


I’m afraid that you can not implement the GetFeaturesInsideBoundingBoxCore method like the OledbFeatureSource, because the SQL query statement for the line can not be constructed like the point. So like what you said, every time it loads all the data (features) when drawing, and then filter the features which are inside the passed in bounding box and draw them to the map. To improve this, not load all the data for every drawing, one method is building an index file. Once you have your own index file, you can filter the feature ids by the index file, and just load the real needed data from your custom data format file.


 


Hope this helps and any more questions please let us know.


 


Thanks,


 


Sun




Hi, 
  
 Before few days, David said R-Tree file index class will expose. I’m not sure R-Tree index can support me or not. Or, it still can’t support coordinate of WKT? 
 And I don’t know when R-Tree class will expose?

Chen, 
  
 We just load data that included in this range.  
  
 I am sure you can understand what your question after you answer my question below. 
  
 How do you get the data in the range? The basic way is get all data and compare each of them with the range, if in range move to collection A, if out of rang move to collection B, finally you can get the data in range by collection A. If you have another idea, you can override GetFeaturesInsideBoundingBox by your own way. The ShapeFileFeatureSource did it, we use R-Tree spatial index to make it faster for getting data in range. Also some other FeatureSources use the optimized way to do it, such as GridFeatureSource, MsSql2008FeatureSource, OracleFeatureSource… etc 
  
 Thanks 
 James