mborne / cours-patron-conception

[ENSG] Cours et TP en java sur les patrons de conception et le refactoring de code
https://mborne.github.io/cours-patron-conception/
Other
8 stars 6 forks source link

tp-graph - corriger la lecture geotools dans la branche initiale #8

Closed mborne closed 3 years ago

mborne commented 3 years ago

c.f. correctif question "0.15 - Optimisation du temps de chargement du graphe"

A faire pour 2022 sur la branche upgrade en mettant à jour par la suite les branches du corrigé :

GraphBuilder graphBuilder = new GraphBuilder();
FeatureIterator<SimpleFeature> features = null;
try {
    features = collection.features();
    while (features.hasNext()) {
        SimpleFeature feature = features.next();
        //...
    }
}finally {
    if ( features != null ){
        features.close();
    }
    dataStore.dispose();
}
return graphBuilder.getGraph();
mborne commented 3 years ago

ok branche upgrade