Hi,
I am comparing the rendering performance of Geotools (using Tomcat) against the
Oracle tool MapViewer.
My test shows Geotools is 2-3 times slower than MapViewer.
The same chart view, scale and contents is used (dMinX, dMinY, dMaxX, dMaxY).
Also the same map pixel width/height is used (iSizeX,iSizeY).
What could be the reason for the big difference?
This is the Geotools code that I tried in both GT 2.7.4 as 8.0 RC1:
java.util.Map params = new java.util.HashMap();
params.put( "dbtype", "oracle");
params.put( "alias", "nbgproj2");
params.put( "schema", "gie");
params.put( "user", "nbg_rli61");
params.put( "passwd", "nbg_rli61");
dataStore = new
OracleNGOCIDataStoreFactory().createDataStore(params);
String typeName = "GIE_GEO_KADASTRAAL_PERCEEL";
FeatureSource featureSource = dataStore.getFeatureSource(typeName);
map = new MapContent();
map.setTitle("Ron");
Style style = createPolygonStyle();
Layer layer = new FeatureLayer(featureSource, style);
map.addLayer(layer);
renderer = new StreamingRenderer();
renderer.setMapContent(map);
String file = "c:\\temp\\image.png";
Rectangle imageBounds = new Rectangle(0, 0, iSizeX, iSizeY);
ReferencedEnvelope mapBounds = new ReferencedEnvelope(dMinX, dMaxX,
dMinY, dMaxY, CRS.decode("EPSG:28992"));
BufferedImage image = new BufferedImage(imageBounds.width,
imageBounds.height, BufferedImage.TYPE_INT_RGB);
Graphics2D gr = image.createGraphics();
gr.setPaint(Color.WHITE);
gr.fill(imageBounds);
try {
renderer.paint(gr, imageBounds, mapBounds);
File fileToSave = new File(file);
ImageIO.write(image, "png", fileToSave);
} catch (IOException e) {
throw new RuntimeException(e);
}
Thanks.
Ron
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users