Hi,
I am a new user of geotools, I try to use it with Eclipse e4:
If in a menu I do the following (very simple):
public class CreateSection {
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell) {
MapContent mapcontext = new MapContent();
mapcontext.setTitle("Projet");
File shapeFile = new File("d:/Partage/FRA_adm0.shp");
ShapefileDataStore store;
try {
store = new ShapefileDataStore(shapeFile.toURI().toURL());
SimpleFeatureSource featureSource = store.getFeatureSource();
SimpleFeatureCollection shapefile = featureSource.getFeatures();
final StyleBuilder builder1 = new StyleBuilder();
final Style style1 =
builder1.createStyle(builder1.createLineSymbolizer());
mapcontext.addLayer(new FeatureLayer(shapefile, style1));
// and show the map viewer
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("list " + mapcontext.layers().size());
StreamingRenderer rend = new StreamingRenderer();
rend.setMapContent(mapcontext);
SwtMapFrame.showMap(mapcontext);
}
}
I obtain the folowing error when I call SwtMapFrame.showMap(mapcontext):
nov. 11, 2013 3:35:47 PM org.geotools.map.MapContent finalize
SEVERE: Call MapContent dispose() to prevent memory leaks
If I do the same in a classical class with just a main there is no problem.
Thanks a lot for your help
Antonio
P Pensez à l'environnement avant d'imprimer ce message
Think Environment before printing
Le contenu de ce mél et de ses pièces jointes est destiné à l'usage exclusif du
(des) destinataire(s) désigné(s) comme tel(s).
En cas de réception par erreur, le signaler à son expéditeur et ne pas en
divulguer le contenu.
L'absence de virus a été vérifiée à l'émission, il convient néanmoins de
s'assurer de l'absence de contamination à sa réception.
The contents of this email and any attachments are confidential. They are
intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or
the sender immediately and do not disclose the contents to
anyone or make copies.
This email was scanned for viruses, vandals and malicious content.
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users