Hi Frank:
I am the original implementor of MemoryDataStore and I am afraid it needs a
little love and attention. It was used to define the datastore api and thus
it is really focused on correctness; and not speed or efficiency - indeed
file based implementations like shapefile are faster.

In terms of order; there is the Query sortBy method if you wish to ask for
features in a specific order; I often made use of a TreeMap internally (in
order to avoid duplicate features; and to simulate the idea of an index).

I am interested in your patch :-) It sounds like an solid improvement.

As far as I can tell the comment is full of it; the SLD specification has
specific ideas about how to draw features; and they allow you to seperate
out multiple rendering "passes" in order to handle overlapping features in a
sensible manner.

Jody


On Fri, Mar 27, 2009 at 12:59 AM, <[email protected]> wrote:

> Hi,
>
> I reviewed some DataStore implementations and have some questions. In
> MemoryDataStore is a comment that the features should return in the same
> order they were inserted. The FeatureSource interface does'nt expect a
> specific order and the MemoryDataStore comment set me on the wrong track I
> guess. Are there any requirements of the feature order in a store (hopefully
> not because JDBC datastores could return features in different order each
> time a new request were started)?
> Is the TempMemoryDataStore a changed copy of MemoryDataStore (maybe a try
> to get ConcurrentModificationExceptions in StreamRenderers anymore). But
> I/we use the StreamMaps and the Exceptions were still thrown. Therefore we
> created a fixed MemoryDataStore which uses the ConcurrentHashMap to store
> the features.
> Are you interested in a patch fixing the problems? I stumbled  by reading
> the following comment:
>            // use an order preserving map, so that features are returned in
> the same
>            // order as they were inserted. This is important for repeatable
> rendering
>            // of overlapping features.
>
> The implementation is'nt very consistent because in
>   addFeatures(FeatureReader <SimpleFeatureType, SimpleFeature> reader) and
> createSchema-Method
> the internal Map is a LinkedHashMap
>
> BUT in
>
> addFeatures(FeatureIterator<SimpleFeature> reader) a HashMap is used.
>
> I'm a little confused about that. Do you have any suggestions?
>
> Frank
>
>
------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to