/** * Load specified tagged geometries to concepts * @param geometries * @throws DaoException */ public void retrieveLocations(Map<Integer, Geometry> geometries) throws DaoException { LOG.info(String.format("Found %d total geometries, now loading geometries", geometries.size())); // Build up list of concepts in all languages for (Integer conceptId : geometries.keySet()){ UniversalPage concept = upDao.getById(conceptId); if (concept != null && concept.hasAllLanguages(new LanguageSet(langs))) { concepts.add(concept); Geometry g1 = geometries.get(conceptId); locations.put(conceptId, g1.getCentroid()); if (concepts.size() % 1000 == 0) { LOG.info(String.format("Loaded %d geometries with articles in %s...", concepts.size(), langs)); } } } LOG.info(String.format("Finish loading %d geometries with articles in %s", concepts.size(), langs)); }
/** * Load specified tagged geometries to concepts * @param geometries * @throws DaoException */ public void retrieveLocations(Map<Integer, Geometry> geometries) throws DaoException { LOG.info(String.format("Found %d total geometries, now loading geometries", geometries.size())); // Build up list of concepts in all languages for (Integer conceptId : geometries.keySet()){ UniversalPage concept = upDao.getById(conceptId); if (concept != null && concept.hasAllLanguages(new LanguageSet(langs))) { concepts.add(concept); Geometry g1 = geometries.get(conceptId); locations.put(conceptId, g1.getCentroid()); if (concepts.size() % 1000 == 0) { LOG.info(String.format("Loaded %d geometries with articles in %s...", concepts.size(), langs)); } } } LOG.info(String.format("Finish loading %d geometries with articles in %s", concepts.size(), langs)); }
public void retrieveLocations() throws DaoException { // Get all known concept geometries Map<Integer, Geometry> geometries = sdDao.getAllGeometriesInLayer("wikidata", "earth"); LOG.info(String.format("Get %d geometries, now building id-name mapping", geometries.size())); // Build up list of concepts in all languages for (Integer conceptId : geometries.keySet()){ UniversalPage concept = upDao.getById(conceptId); if (concept != null && concept.hasAllLanguages(env.getLanguages())) { concepts.add(concept); locations.put(concept, geometries.get(conceptId).getCentroid()); if (concepts.size() % 1000 == 0) { LOG.info(String.format("Loaded %d geometries with articles in %s...", concepts.size(), env.getLanguages())); } } } LOG.info(String.format("Found %d geometries with articles in %s", concepts.size(), env.getLanguages())); }
/** * Load all locations from all language editions of Wikipedia to concepts * * @throws DaoException */ public void retrieveAllLocations() throws DaoException { // Get all known concept geometries Map<Integer, Geometry> geometries = sdDao.getAllGeometriesInLayer("wikidata", "earth"); LOG.info(String.format("Found %d total geometries, now loading geometries", geometries.size())); // Build up list of concepts in all languages for (Integer conceptId : geometries.keySet()){ UniversalPage concept = upDao.getById(conceptId); if (concept != null && concept.hasAllLanguages(new LanguageSet(langs))) { concepts.add(concept); Geometry g1 = geometries.get(conceptId); locations.put(conceptId, g1.getCentroid()); if (concepts.size() % 1000 == 0) { LOG.info(String.format("Loaded %d geometries with articles in %s...", concepts.size(), langs)); } } } LOG.info(String.format("Found %d geometries with articles in %s", concepts.size(), langs)); }
public void retrieveLocations() throws DaoException { // Get all known concept geometries Map<Integer, Geometry> geometries = sdDao.getAllGeometriesInLayer("wikidata", "earth"); LOG.info(String.format("Get %d geometries, now building id-name mapping", geometries.size())); // Build up list of concepts in all languages for (Integer conceptId : geometries.keySet()){ UniversalPage concept = upDao.getById(conceptId); if (concept != null && concept.hasAllLanguages(env.getLanguages())) { concepts.add(concept); locations.put(concept, geometries.get(conceptId).getCentroid()); if (concepts.size() % 1000 == 0) { LOG.info(String.format("Loaded %d geometries with articles in %s...", concepts.size(), env.getLanguages())); } } } LOG.info(String.format("Found %d geometries with articles in %s", concepts.size(), env.getLanguages())); }
/** * Load all locations from all language editions of Wikipedia to concepts * * @throws DaoException */ public void retrieveAllLocations() throws DaoException { // Get all known concept geometries Map<Integer, Geometry> geometries = sdDao.getAllGeometriesInLayer("wikidata", "earth"); LOG.info(String.format("Found %d total geometries, now loading geometries", geometries.size())); // Build up list of concepts in all languages for (Integer conceptId : geometries.keySet()){ UniversalPage concept = upDao.getById(conceptId); if (concept != null && concept.hasAllLanguages(new LanguageSet(langs))) { concepts.add(concept); Geometry g1 = geometries.get(conceptId); locations.put(conceptId, g1.getCentroid()); if (concepts.size() % 1000 == 0) { LOG.info(String.format("Loaded %d geometries with articles in %s...", concepts.size(), langs)); } } } LOG.info(String.format("Found %d geometries with articles in %s", concepts.size(), langs)); }
if (concept != null && concept.hasAllLanguages(new LanguageSet(langs))) { concepts.add(concept); Geometry g1 = geometries.get(conceptId);
if (concept != null && concept.hasAllLanguages(new LanguageSet(langs))) { concepts.add(concept); Geometry g1 = geometries.get(conceptId);
LOG.info(String.format("%d geometries added out of %d", counter, sampledContainedId1.size())); UniversalPage concept = upDao.getById(i); if(concept != null && concept.hasAllLanguages(languageSet)){ concepts1.add(upDao.getById(i)); geometriesToParse.put(i, sdDao.getGeometry(i, "wikidata", "earth")); if(concept != null && concept.hasAllLanguages(languageSet)){ concepts2.add(upDao.getById(i)); geometriesToParse.put(i, sdDao.getGeometry(i, "wikidata", "earth"));
LOG.info(String.format("%d geometries added out of %d", counter, sampledContainedId1.size())); UniversalPage concept = upDao.getById(i); if(concept != null && concept.hasAllLanguages(languageSet)){ concepts1.add(upDao.getById(i)); geometriesToParse.put(i, sdDao.getGeometry(i, "wikidata", "earth")); if(concept != null && concept.hasAllLanguages(languageSet)){ concepts2.add(upDao.getById(i)); geometriesToParse.put(i, sdDao.getGeometry(i, "wikidata", "earth"));