Hi Andre, if possible, you should use a spatial index, to do some pre-filtering. JTS comes with a Quadtree and R-Tree (STRtree) implemetation. One is updatable while the other not (not sure though, which one). A spatial index allows you to retrieve only those objects from a dataset, that are fairly close/near by.
Do you have objects that do not move around?, What are your 4 Million objects? Also could you not buffer your objects only once and then store them? best, stefan Am 26.08.13 13:21, schrieb André Salvati: > Hi, > > I'm a beginner with JTS and this is my first post here. > > We've been working with geofences for a vehicle tracking app and I would > like to know what solution could give me a lower CPU consumption. > > 1) Calculate and store a Buffered Area (100 meters) from a LineString > object. Run 4 million times if my vehicle positions are inside or not > that precalculated with contains() method. > > 2) Run 4 million times isWithinDistance() method from LineString for > each position. > > Are there another options? > > Thanks. > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Jts-topo-suite-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user > ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk _______________________________________________ Jts-topo-suite-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
