[OpenMap Users] DbfHandler Hacking to improve performance in rendering road network shape

From: Alessio Iannone <alessio_iannone_at_yahoo.it>
Date: Fri, 18 Apr 2008 14:03:44 +0000 (GMT)

Hi all, Trying to develop an application that is capable of rendering road network layer based on Esri Shape File and applying to them different drawing attributes according to the rule definition I have noticed that (AFAIK) there are some problem, ( probably bug or probably something that I have not really understand). For example if have to write a rule that says to not render road with a FRC greater than 4 what I have done to be able to obtain this beahoviour, was to modify the code(more or less line 336) in com.bbn.openmap.dataAccess.shape.DbfHandler.java if (rule.da != null) { rule.da.setTo(omg); }else{ //FIXME Verify if it is correct... //If the drawing attributes are not set this mean that I don't want //to draw the object...for example assume that we don't want to render //road with a FRC class greater than 4 we set render properties to false... //so we have to return a null omg; //Otherwise we have to define another property to telle explicitely that we don't want //rendering occurs.... //_at_author Alessio Iannone // Debug.output("Rule "+rule.getRuleName()+" skipping drawing..."); omg = null; } now what is happening is that even if with this hack I am able to avoid the call to the OMGraphics generate method, and so I am skipping rendering of this kind of road, I could not avoid the call to factory.makeEsriGraphicFromRecord(entry.getByteOffset(), shp, drawingAttributes, pointIcon, byteTracker); in com.bbn.openmap.layer.shape.SpatialIndex (line 512). I have also noticed that inside the call generated by makeEsriGraphicFromRecord every time new object are allocated (like ESRIPoint and so on)..I am thinking about introducing bounded Object Pool to avoid these numerous allocation but I have to verify where I can submit again the object to the Pool Itself (I don't want to override the finalize method of the object...i think is not a good idea). Basically I am trying to find a way to improve performance in loading big network shape file. What do you think about it? Have you better suggestion on how I can improve loading of road network shape file?. I have also tested the same application whit different kind of layer for loading the Map application like MapBean, BufferedMapBean adn BufferedLayerMapBean....but the performance doesnt' change and i have also some spurious graphics artifacts when not using the MapBean (Like map displayed over scrollbar of a JScrollPane container)...furthermore I have tried to use BufferedShapeLayer (instead of simple ShapeLayer)....now performance are much better but no rules is applyied to the shape file.....any hints? P.S. I am using CVS Version of openmap. For JR I have still to try your code for caching the shape file...please be patient ;) Sorry for my English :(. Alessio Iannone Software Engineer Mobile: 39 329 8834960 Email: alessio.iannone_at_nextant.it IM: quonn77@hotmail.com (AIM) http://www.linkedin.com/in/alessioiannone Web sites of the Martial Arts I play Nextant - Navcomm Applications Via Alessandro Noale See who we know in common Want a signature like this? Inviato da Yahoo! Mail. La casella di posta intelligente. http://it.docs.yahoo.com/mail/overview/index.html

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Apr 18 2008 - 10:06:06 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT