Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Davis2012-11-14 02:24:07 +0000
committerMatthew Davis2012-11-14 02:24:07 +0000
commitee08f2454cc88fd6702400ce354f16215a816057 (patch)
treee0b3911556329d38eb3f87492c9e6b5bfb110cc2
parent74ec59585cce2eb433110b1841ecd864f7e3fef3 (diff)
downloadorg.eclipse.stem.data-ee08f2454cc88fd6702400ce354f16215a816057.tar.gz
org.eclipse.stem.data-ee08f2454cc88fd6702400ce354f16215a816057.tar.xz
org.eclipse.stem.data-ee08f2454cc88fd6702400ce354f16215a816057.zip
Code refactoring to move Geographic Names and Centes lookup from org.eclipse.stem.data.geography plug-in to new org.eclipse.stem.geography plug-in.
git-svn-id: http://dev.eclipse.org/svnroot/technology/org.eclipse.stem/trunk/data@3590 92a21009-5b66-0410-b83a-dc787c41c6e9
-rw-r--r--geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/GeographicMapper.java278
-rw-r--r--geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/GeographicNames.java225
-rw-r--r--geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/ISOKey.java94
-rw-r--r--geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/NameReader.java182
-rw-r--r--geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/CenterReader.java300
-rw-r--r--geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/GeographicCenters.java187
-rw-r--r--geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/PluginCenterReader.java298
-rw-r--r--geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/META-INF/MANIFEST.MF3
-rw-r--r--geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/TransportationDataGenerator.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/propertydata/AirTransportGeographicRelationshipPropertyData.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/specifications/AirTransportationGeographicRelationshipPropertyFileSpecification.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/update.xml1
-rw-r--r--geography/org.eclipse.stem.internal.data.geography.models/META-INF/MANIFEST.MF3
-rw-r--r--geography/org.eclipse.stem.internal.data.geography.models/src/org/eclipse/stem/internal/data/geography/models/GeographyModelGenerator.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography.models/src/org/eclipse/stem/internal/data/specifications/GeographicModelSpecification.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography.models/update.xml1
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/META-INF/MANIFEST.MF1
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/GeographyPluginFileGenerator.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/isokeycollector/ISOKeyCollector.java6
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/AreaPropertyData.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/GeographicFeaturePropertyData.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/GeographicRelationshipPropertyData.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/RegionPropertyData.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryAreaLabelPropertyFileSpecification.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryGraphPropertyFileSpecification.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryLabelPropertyFileSpecification.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryNodePropertyFileSpecification.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/GeographicRelationshipPropertyFileSpecification.java2
-rw-r--r--geography/org.eclipse.stem.internal.data.geography/update.xml1
-rw-r--r--population/org.eclipse.stem.internal.data.geography.population.human.models/META-INF/MANIFEST.MF1
-rw-r--r--population/org.eclipse.stem.internal.data.geography.population.human.models/src/org/eclipse/stem/internal/data/geography/population/human/models/PopulationModelGenerator.java2
-rw-r--r--population/org.eclipse.stem.internal.data.geography.population.human.models/src/org/eclipse/stem/internal/data/geography/population/human/models/PopulationModelSpecification.java2
-rw-r--r--population/org.eclipse.stem.internal.data.geography.population.human.models/update.xml1
-rw-r--r--population/org.eclipse.stem.internal.data.geography.population.human/update.xml1
-rw-r--r--population/org.eclipse.stem.internal.data.geography.population/META-INF/MANIFEST.MF1
-rw-r--r--population/org.eclipse.stem.internal.data.geography.population/src/org/eclipse/stem/internal/data/geography/propertydata/PopulationPropertyData.java2
-rw-r--r--population/org.eclipse.stem.internal.data.geography.population/src/org/eclipse/stem/internal/data/geography/specifications/CountryPopulationLabelPropertyFileSpecification.java2
-rw-r--r--population/org.eclipse.stem.internal.data.geography.population/update.xml1
-rw-r--r--population/org.eclipse.stem.internal.data.population.human/update.xml1
39 files changed, 36 insertions, 1588 deletions
diff --git a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/GeographicMapper.java b/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/GeographicMapper.java
deleted file mode 100644
index 170e7bc..0000000
--- a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/GeographicMapper.java
+++ /dev/null
@@ -1,278 +0,0 @@
-// GeographicMapper.java
-package org.eclipse.stem.data.geography;
-
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-import java.io.BufferedInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.ResourceBundle;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.emf.ecore.resource.impl.URIConverterImpl;
-import org.eclipse.stem.core.Constants;
-
-/**
- * This class maps geographic locations to specific data/information about the
- * location.
- */
-@SuppressWarnings("deprecation")
-abstract public class GeographicMapper {
-
- /**
- * The String that is used internally like an ISO-3166 alpha3 key to
- * represent the Earth as if it was a country.
- */
- public static final String EARTH_ALPHA3_ISO_KEY = "ZZZ"; //$NON-NLS-1$
- /**
- * The name of the file that maps ISO-3166 alpha2 keys to ISO-3166 alpha3
- * keys.
- */
- public static final String ALPHA2_TO_ALPHA3_NAME = "level0ISOKeys.properties"; //$NON-NLS-1$
-
- private static final URI LEVEL_0_ISO_MAPPING_FILE_URI = URI
- .createURI("platform:/plugin/" + Activator.PLUGIN_ID + "/resources/data/country/" + EARTH_ALPHA3_ISO_KEY + "/" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- + ALPHA2_TO_ALPHA3_NAME);
-
- protected static final String RB_PREFIX = Constants.ID_ROOT
- + ".data.geography"; //$NON-NLS-1$
- private static Properties alpha2ToAlpha3Map = null;
- private static Properties alpha3ToAlpha2Map = null;
-
- /**
- * @param propertyFile
- * @return the properties read from the file
- */
- protected static Properties readPropertyFiles(final URI propertyFileURI) {
- final URIConverter converter = new URIConverterImpl();
-
- final Properties retValue = new Properties();
- BufferedInputStream propertiesInputStream = null;
- try {
- propertiesInputStream = new BufferedInputStream(converter
- .createInputStream(propertyFileURI));
- retValue.load(propertiesInputStream);
- propertiesInputStream.close();
- } catch (final FileNotFoundException e) {
- Activator.logError(EARTH_ALPHA3_ISO_KEY, e);
- } catch (final IOException e) {
- Activator.logError(EARTH_ALPHA3_ISO_KEY, e);
- }
- return retValue;
- } // readPropertyFiles
-
- /**
- * @param key
- * @return the level of the key
- */
- protected static int keyLevel(final String key) {
- int level = 0;
- int start = 0;
- for (int temp = key.indexOf("-"); temp > 0;) { //$NON-NLS-1$
- level++;
- start += temp + 1;
- temp = key.substring(start).indexOf("-"); //$NON-NLS-1$
- } // for
- return level;
- } // keyLevel
-
- /**
- *
- */
- protected static Properties getAlpha2ToAlpha3Map() {
- // Got the alpha2->alpha3 map?
- if (alpha2ToAlpha3Map == null) {
- // No
- alpha2ToAlpha3Map = readPropertyFiles(LEVEL_0_ISO_MAPPING_FILE_URI);
- } // if
- // Got it now?
- if (alpha2ToAlpha3Map == null) {
- // No
- Activator.logError(
- "Can't read the alpha2 to alpha3 mapping file \"" //$NON-NLS-1$
- + ALPHA2_TO_ALPHA3_NAME + "\"", null); //$NON-NLS-1$
- } // if
- return alpha2ToAlpha3Map;
- } // getAlpha2ToAlpha3Map
-
- /**
- * @param alpha2ISOKey
- * @return the alpha 3 ISO key of the alpha2 key, or the alpha 2 key if
- * there is an error
- */
- public static String getAlpha3(final String alpha2ISOKey) {
- String retValue = alpha2ISOKey;
- final Properties alpha2ToAlpha3Map = getAlpha2ToAlpha3Map();
- // Do we have the map?
- if (alpha2ToAlpha3Map != null) {
- // Yes
- retValue = alpha2ToAlpha3Map.getProperty(alpha2ISOKey);
- } // if
- return retValue;
- } // getAlpha3
-
- /**
- * @param alpha3ISOKey
- * @return the alpha 2 ISO key of the alpha2 key, or the alpha 2 key if
- * there is an error
- */
- public static String getAlpha2(final String alpha3ISOKey) {
- String retValue = alpha3ISOKey;
-
- final Properties alpha3toAlpha2Map = getAlpha3toAlpha2Map();
- // Do we have the map?
- if (alpha3toAlpha2Map != null) {
- // Yes
- retValue = alpha3toAlpha2Map.getProperty(alpha3ISOKey);
- } // if
- return retValue;
- }
-
- private static Properties getAlpha3toAlpha2Map() {
- // Already created the map?
- if (alpha3ToAlpha2Map == null) {
- // No
- final Properties alpha2ToAlpha3Map = getAlpha2ToAlpha3Map();
- // Do we have the reverse map?
- if (alpha2ToAlpha3Map != null) {
- // Yes
- alpha3ToAlpha2Map = new Properties();
- for (final Entry<Object,Object> entry : alpha2ToAlpha3Map.entrySet()) {
- alpha3ToAlpha2Map.put(entry.getValue(),
- entry.getKey());
- } // for each String
- } // if
- } // if
-
- return alpha3ToAlpha2Map;
- }
-
- /**
- * @param alpha3ISOKey
- * the ISO-3166 alpha-3 key
- * @param bundlePrefix
- * TODO
- * @param bundleType
- * a {@link String} that identifies the type of bundle
- * @return the name of the bundle that contains the names for the iso key's
- * country.
- */
- protected static String makeBundleName(final String alpha3ISOKey,
- final String bundlePrefix, final String bundleType) {
- final StringBuilder sb = new StringBuilder(bundlePrefix);
- sb.append("."); //$NON-NLS-1$
- sb.append(alpha3ISOKey);
- sb.append("_"); //$NON-NLS-1$
- sb.append(bundleType);
- return sb.toString();
- } // makeBundleName
-
- /**
- * @param alpha2ISOKey
- * the ISO-3166 alpha-3 key
- * @param bundlePrefix
- * TODO
- * @param bundleType
- * a {@link String} that identifies the type of bundle
- * @return the {@link ResourceBundle} for the country identified by the
- * ISO-3166 alpha2 key
- */
- protected static ResourceBundle readResourceBundle(
- final String alpha2ISOKey, final String bundlePrefix,
- final String bundleType) {
- ResourceBundle retValue = null;
- final Properties alpha2ToAlpha3Map = getAlpha2ToAlpha3Map();
- // Got it?
- if (alpha2ToAlpha3Map != null) {
- // Yes
- final String alpha3ISOKey = alpha2ToAlpha3Map
- .getProperty(alpha2ISOKey);
- retValue = ResourceBundle.getBundle(makeBundleName(alpha3ISOKey,
- bundlePrefix, bundleType));
- } // if
-
- return retValue;
- } // readResourceBundle
-
- /**
- * @param isoKey
- * @param bundlePrefix
- * TODO
- * @param bundleType
- * a {@link String} that identifies the type of bundle
- * @param level0RBName
- * the name of the {@link ResourceBundle} file that contains the
- * level 0 resources
- * @param level0RB
- * the reference of the level 0 {@link ResourceBundle}
- * @param rbMap
- * a {@link Map} between alpha-2 iso key and
- * {@link ResourceBundle}s
- * @return the {@link ResourceBundle} that contains the mapping
- */
- protected static ResourceBundle getResourceBundle(final String isoKey,
- final int level, final String bundlePrefix,
- final String bundleType, final String level0RBName,
- ResourceBundle level0RB, Map<String, ResourceBundle> rbMap) {
- ResourceBundle retValue = null;
- // If the level is 0, we handle things specially. There is a single
- // resource bundle that contains all of the level 0 mappings (i.e., the
- // names of all countries) This allows us to avoid reading in all of the
- // other (245!) resource bundles just to obtain the names of the
- // countries. For the other levels we retrieve the bundle specific to
- // the country because it has the names for all levels (i.e., all ISO
- // keys).
-
- // Level 0?
- if (level == -1 || level == 0) {
- // Yes
- // Have we retrieved the level 0 resource bundle yet?
- if (level0RB == null) {
- // No
- level0RB = ResourceBundle.getBundle(level0RBName);
- } // if
- retValue = level0RB;
- } // if level 0
- else {
- // No
- final String alpha2ISOKey = isoKey.substring(0, 2);
-
- // We use that value as the key to "cache" the resource bundle
- retValue = rbMap.get(alpha2ISOKey);
-
- // Have we retrieved this ResourceBundle before?
- if (retValue == null) {
- // No
- retValue = readResourceBundle(alpha2ISOKey, bundlePrefix,
- bundleType);
- // Were we successful?
- if (retValue == null) {
- // No
- Activator.logError(
- "Could not read Resource Bundle of type " //$NON-NLS-1$
- + bundleType + " for \"" + alpha2ISOKey //$NON-NLS-1$
- + "\"", null); //$NON-NLS-1$
- } // if
- else {
- // No
- rbMap.put(alpha2ISOKey, retValue);
- } // else
- } // if
- } // else
- return retValue;
- } // getResourceBundle
-
-} // GeographicMapper
diff --git a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/GeographicNames.java b/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/GeographicNames.java
deleted file mode 100644
index a721ed4..0000000
--- a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/GeographicNames.java
+++ /dev/null
@@ -1,225 +0,0 @@
-// GeographicNames.java
-package org.eclipse.stem.data.geography;
-
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.Properties;
-import java.util.ResourceBundle;
-
-import org.eclipse.emf.common.util.URI;
-
-/**
- * This class is responsible for providing NLS'd names for geographic locations.
- */
-public class GeographicNames extends GeographicMapper {
-
- /**
- * This is the string that identifies the type of bundle for geographic
- * names.
- */
- private static final String NAMES_BUNDLE_TYPE = "names"; //$NON-NLS-1$
-
- /**
- * The root name of the file that contains the level 0 names.
- */
- public static final String LEVEL_0_ISO_NAMES_ROOT_NAME = "level0ISONames"; //$NON-NLS-1$
-
- private static final String LEVEL_0_RB_NAME = RB_PREFIX + "." //$NON-NLS-1$
- + LEVEL_0_ISO_NAMES_ROOT_NAME;
-
- private static ResourceBundle level0RB = null;
-
- private static Map<String, ResourceBundle> rbMap = new HashMap<String, ResourceBundle>();
-
- /**
- * @param isoKey
- * @return the name of the geographic location that matches isoKey
- */
- public static String getName(final String isoKey) {
- return getName(isoKey, keyLevel(isoKey));
- } // getName
-
- /**
- * @param isoKey
- * @param level
- * @return the name of the geographic location that matches isoKey
- */
- public static String getName(final String isoKey, final int level) {
- try {
- String isoKey2 = isoKey;
- // alpha3 key?
- if (isoKey.length() == 3) {
- // Yes
- isoKey2 = getAlpha2(isoKey);
- } // if
-
- final ResourceBundle rb = getResourceBundle(isoKey2, level,
- RB_PREFIX, NAMES_BUNDLE_TYPE, LEVEL_0_RB_NAME, level0RB, rbMap);
- return rb.getString(isoKey2).trim();
- } catch (final MissingResourceException e) {
- return isoKey;
- } catch (final NullPointerException e) {
- return '!' + isoKey + '!';
- } // catch NullPointerException
- } // getName
-
- /**
- * @param uri the {@link URI} of a geographic location
- * @return the name of the geographic location that matches {@link URI}
- */
- public static String getName(URI uri) {
- return getName(uri.lastSegment().toString());
- } // getName
-
- /**
- * @param isoKey
- * the ISO-3166 alpha2 or alpha3 key of a geographic location
- * @return the name of the location specified by the isoKey in reverse
- * hierarchy, e.g., "Santa Clara Country, California, USA" for the
- * ISO Key "US-CA-06085"
- */
- public static String getReverseHierarchyName(final String isoKey) {
- final StringBuilder sb = new StringBuilder(getName(isoKey));
-
- String temp = isoKey;
- int i = temp.lastIndexOf("-"); //$NON-NLS-1$
- while( i > 0) {
- // Strip off the last segment of the key
- temp = isoKey.substring(0,i);
- sb.append(", "); //$NON-NLS-1$
- sb.append(getName(temp));
- i = temp.lastIndexOf("-"); //$NON-NLS-1$
- }
- return sb.toString();
- } // getReverseHierarchyName
-
- /**
- * @param isoKey
- * the isoKey for which any "sub" keys at the level should be
- * returned.
- * @param level
- * the administrative level of the key
- * @return an array of the ISO keys that have the passed key as a prefix.
- */
- public static Object[] getSubISOKeys(final String isoKey, final int level) {
- Object[] retValue = new Object[] {};
-
- // Earth (ZZZ)?
- if (isoKey.equals(EARTH_ALPHA3_ISO_KEY)) {
- // Yes
- final Properties alpha2ToAlpha3Map = getAlpha2ToAlpha3Map();
- // Do we have the map?
- if (alpha2ToAlpha3Map != null) {
- // Yes
- // retValue = alpha2ToAlpha3Map.keySet().toArray();
- retValue = alpha2ToAlpha3Map.values().toArray();
- } // if
- } // if Earth
- else {
- // No
- try {
- final ResourceBundle rb = getResourceBundle(isoKey, level,
- RB_PREFIX, NAMES_BUNDLE_TYPE, LEVEL_0_RB_NAME, level0RB, rbMap);
- final List<String> temp = new ArrayList<String>();
- for (final Enumeration<String> keys = rb.getKeys(); keys
- .hasMoreElements();) {
- final String tempKey = keys.nextElement();
- // Is this key at the next level?
- if (tempKey.startsWith(isoKey)
- && keyLevel(tempKey) == level /* + 1 */) {
- // Yes
- temp.add(tempKey);
- } // if
- } // for each key
- retValue = temp.toArray(new String[] {});
- } catch (final MissingResourceException mre) {
- Activator.logError(mre.getMessage(), mre);
- }
- } // else
-
- return retValue;
- } // getSubISOKeys
-
- /**
- * @param isoKey
- * @param bundlePrefix
- * TODO
- * @param bundleType
- * a {@link String} that identifies the type of bundle
- * @param level0RBName
- * the name of the {@link ResourceBundle} file that contains the
- * level 0 resources
- * @param level0RB
- * the reference of the level 0 {@link ResourceBundle}
- * @param rbMap
- * a {@link Map} between alpha-2 iso key and
- * {@link ResourceBundle}s
- * @return the {@link ResourceBundle} that contains the mapping
- */
- protected static ResourceBundle getResourceBundle(final String isoKey,
- final int level, final String bundlePrefix,
- final String bundleType, final String level0RBName,
- ResourceBundle level0RB, Map<String, ResourceBundle> rbMap) {
- ResourceBundle retValue = null;
- // If the level is 0, we handle things specially. There is a single
- // resource bundle that contains all of the level 0 mappings (i.e., the
- // names of all countries) This allows us to avoid reading in all of the
- // other (245!) resource bundles just to obtain the names of the
- // countries. For the other levels we retrieve the bundle specific to
- // the country because it has the names for all levels (i.e., all ISO
- // keys).
-
- // Level 0?
- if (level == -1 || level == 0) {
- // Yes
- // Have we retrieved the level 0 resource bundle yet?
- if (level0RB == null) {
- // No
- level0RB = ResourceBundle.getBundle(level0RBName);
- } // if
- retValue = level0RB;
- } // if level 0
- else {
- // No
- final String alpha2ISOKey = isoKey.substring(0, 2);
-
- // We use that value as the key to "cache" the resource bundle
- retValue = rbMap.get(alpha2ISOKey);
-
- // Have we retrieved this ResourceBundle before?
- if (retValue == null) {
- // No
- retValue = readResourceBundle(alpha2ISOKey, bundlePrefix,
- bundleType);
- // Were we successful?
- if (retValue == null) {
- // No
- Activator.logError(
- "Could not read Resource Bundle of type " //$NON-NLS-1$
- + bundleType + " for \"" + alpha2ISOKey //$NON-NLS-1$
- + "\"", null); //$NON-NLS-1$
- } // if
- else {
- // No
- rbMap.put(alpha2ISOKey, retValue);
- } // else
- } // if
- } // else
- return retValue;
- } // getResourceBundle
-} // GeographicNames
diff --git a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/ISOKey.java b/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/ISOKey.java
deleted file mode 100644
index 6c7f3ce..0000000
--- a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/ISOKey.java
+++ /dev/null
@@ -1,94 +0,0 @@
-// ISOKey.java
-package org.eclipse.stem.data.geography;
-
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-/**
- * This class represents an ISO-3166-1 alpha3 or alpha2 country key (or
- * combination).
- */
-public class ISOKey implements Comparable<ISOKey> {
- /**
- * This is the ISO key used to represent The Earth
- */
- public static final ISOKey EARTH = new ISOKey("ZZZ"); //$NON-NLS-1$
-
- private String key = null;
-
- /**
- * @param key
- * the key
- */
- public ISOKey(final String key) {
- this.key = key.trim();
- }
-
- /**
- * @return the key
- */
- public final String getKey() {
- return key;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return key.hashCode();
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final ISOKey other = (ISOKey) obj;
- if (key == null) {
- if (other.key != null) {
- return false;
- }
- } else if (!key.equals(other.key)) {
- return false;
- }
- return true;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return key;
- }
-
- /**
- * @param isoKey
- * the key to compare to
- * @return the value of string compareTo
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- @Override
- public int compareTo(final ISOKey isoKey) {
- return this.key.compareTo(isoKey.key);
- }
-
-} // ISOKey
diff --git a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/NameReader.java b/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/NameReader.java
deleted file mode 100644
index c87f770..0000000
--- a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/NameReader.java
+++ /dev/null
@@ -1,182 +0,0 @@
-package org.eclipse.stem.data.geography;
-
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.osgi.framework.Bundle;
-
-/**
- * This class is still under construction
- * TODO: works but must remove hard coded strings
- *
- * process the raw region names files to obtain a map
- * of names keyed by stemIDs
- *
- */
-public class NameReader {
-
-
- static final String nameFilesPrefix = "src/org/eclipse/stem/data/geography/"; //$NON-NLS-1$
- //static final String nameFilesPrefix = "platform:/plugin/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/"; //$NON-NLS-1$
-
- static final String nameFilesSuffix = "_names.properties"; //$NON-NLS-1$
-
-
- public Map<String, String> regionNamesMap= new HashMap<String, String>();
-
- /**
- * process the raw region names files to obtain a map
- * of names keyed by stemIDs
- *
- */
- public NameReader() {
-
- }
-
- /**
- * main method for testing
- * @param args
- */
-// @SuppressWarnings("nls")
-// public static void main(String[] args) {
-//
-// NameReader nr = new NameReader();
-// String nameFilesPrefix = "/Users/jhkauf/Documents/workspace/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/"; //$NON-NLS-1$
-// String testfileName = nameFilesPrefix+"MEX_names.properties";
-//// nr.readNames(testfileName);
-// }// main()
-
-
- /**
- *
- * @param countryCode
- * @return
- */
- @SuppressWarnings("nls")
- public Map<String, String> readNamesByCountryCode(String countryCode) {
- Bundle bundle = Platform.getBundle("org.eclipse.stem.data.geography");
- Path path = new Path(nameFilesPrefix+countryCode+nameFilesSuffix);
- URL fileURL = FileLocator.find(bundle, path, null);
-// String fileName = rootWorkspace+nameFilesPrefix+countryCode+nameFilesSuffix;
-// File nameFile = new File(fileName);
- return readNames(fileURL);
- }
-
- /**
- * read in the level one Names and keys
- *
- */
- @SuppressWarnings("nls")
- public Map<String, String> readNames(URL url) {
-
- //Activator.logInformation("reading Names for "+fileName);
- String fname = url.getFile();
- BufferedReader fileReader = openReader(fname);
- try {
- // Add all the source URLs for this country.
-
- if (fileReader != null) {
- String buffer = null;
- while (EOF(buffer = fileReader.readLine()) != true) {
-
- //Activator.logInformation(" "+buffer);
- // Tokenize
- //
- if((buffer.indexOf("SOURCE")==-1)&&(buffer.indexOf("VALID")==-1)&&(buffer.indexOf("#")==-1)&&(buffer.indexOf("-")>=0)) {
- StringTokenizer tokenizer = new StringTokenizer(buffer, "="); //$NON-NLS-1$
-
- // Level 2
-
- String stemID2 = tokenizer.nextToken().trim();
- String name = tokenizer.nextToken();
-
-
- regionNamesMap.put(stemID2, name);
- //Activator.logInformation(" mapped "+stemID2+" to "+name );
- }
-
-
- }
- }
- }catch (Exception e) {
- Activator.logInformation("Error reading file"+fname,e);
- e.printStackTrace();
- System.exit(1);
- }
- return regionNamesMap;
-
- }// readName(String fileName)
-
-
- /**
- * Create a newBufferedReader
- *
- * @param fileName
- * the name of the file we want to open for reading
- *
- * @return a reader to a given file
- */
- static protected BufferedReader openReader(String file) {
-
- try {
-
- File f = new File(file);
-
- if (f.exists() == false) {
- return null;
- }
-
- return new BufferedReader(new FileReader(file));
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return null;
- }
-
-
-
-
- /**
- * Indicate End-Of-File
- *
- * @param buffer
- * A buffer of diva data
- *
- * @return True if we have reached End-Of-File
- */
- static protected boolean EOF(String buffer) {
- if (buffer == null )
- return true;
- return false;
- }
-
-
-
-
-
-
-
-
-}// class \ No newline at end of file
diff --git a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/CenterReader.java b/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/CenterReader.java
deleted file mode 100644
index e2fc35b..0000000
--- a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/CenterReader.java
+++ /dev/null
@@ -1,300 +0,0 @@
-package org.eclipse.stem.data.geography.centers;
-
-/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.stem.data.geography.Activator;
-import org.eclipse.stem.data.geography.GeographicMapper;
-
-/**
- *
- * THIS CLASS is working but still under construction
- *
- */
-public class CenterReader extends GeographicMapper{
-
- public static Map<String, String> regionCentersMap= new HashMap<String, String>();
-
- // TODO: Fix this, this is not the right way
- public static final String DATA_PATH = "/Users/jhkauf/Documents/workspace/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/"; //$NON-NLS-1$
-
- //public static final String dataPath = "./src/org/eclipse/stem/data/geography/centers/"; //$NON-NLS-1$
- public static String root;
- static List<String> allCentersFiles = new ArrayList<String>();
- List<String> allCountryIDs = new ArrayList<String>();
- /**
- * This class reads all the centers in STEM
- */
- @SuppressWarnings("nls")
- public CenterReader() {
- try {
- //String top = parentDir.getCanonicalPath();
- root = DATA_PATH;
- }catch(Exception e) {
- e.printStackTrace();
- }
- getAllCenterFileNames();
- for(int i = 0; i < allCentersFiles.size(); i ++) {
- String fileName = allCentersFiles.get(i);
- readCenters(fileName);
-
- int idx = fileName.indexOf("_centers.properties");
- if(idx >3) {
- String id3 = fileName.substring(idx-3,idx);
- if(id3.indexOf("ZZZ")==-1) allCountryIDs.add(id3);
- }
-
- }
-
- }
-
- /**
- * This class reads all the centers in STEM
- */
- @SuppressWarnings("nls")
- public CenterReader(List<String> centersFiles) {
- allCentersFiles = centersFiles;
- getAllCenterFileNames();
- for(int i = 0; i < allCentersFiles.size(); i ++) {
- String fileName = allCentersFiles.get(i);
- readCenters(fileName);
-
- int idx = fileName.indexOf("_centers.properties");
- if(idx >3) {
- String id3 = fileName.substring(idx-3,idx);
- if(id3.indexOf("ZZZ")==-1) allCountryIDs.add(id3);
- }
- }
- }
-
- /**
- * for testing
- * @param args
- */
- @SuppressWarnings("unused")
- public static void main(String[] args) {
- CenterReader cr = new CenterReader();
- }
-
- /**
- * Get an array of country codes
- * @return
- */
- public String[] getCountryIDs() {
- String[] id3s = allCountryIDs.toArray(new String[allCountryIDs.size()]);
- Arrays.sort(id3s);
- return id3s;
- }
-
- /**
- * read in the Centers and keys
- *
- */
- public Map<String, String> readCenters(String fileName) {
-
- BufferedReader fileReader = openReader(fileName);
-
- try {
- // Add all the source URLs for this country.
-
- if (fileReader != null) {
- String buffer = null;
- while (EOF(buffer = fileReader.readLine()) != true) {
-
- //Activator.logInformation(" "+buffer);
- // Tokenize
- //
- if((buffer.indexOf("SOURCE")==-1)&&(buffer.indexOf("VALID")==-1)&&(buffer.indexOf("#")==-1)&&(buffer.indexOf("=")>=0)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- StringTokenizer tokenizer = new StringTokenizer(buffer, "="); //$NON-NLS-1$
- String stemID2 = tokenizer.nextToken().trim();
- String center = tokenizer.nextToken();
- regionCentersMap.put(stemID2, center);
- //Activator.logInformation(" mapped "+stemID2+" to "+Name.doubleValue() );
- }
- }
- }
- }catch (Exception e) {
- Activator.logInformation("Error reading file"+fileName); //$NON-NLS-1$
- e.printStackTrace();
- System.exit(1);
- }
- return regionCentersMap;
-
- }// readName(String fileName)
-
-
- /**
- * Create a newBufferedReader
- *
- * @param fileName
- * the center of the file we want to open for reading
- *
- * @return a reader to a given file
- */
- static protected BufferedReader openReader(String file) {
-
- try {
-
- File f = new File(file);
-
- if (f.exists() == false) {
- return null;
- }
-
- return new BufferedReader(new FileReader(file));
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return null;
- }
-
-
-
-
- /**
- * Indicate End-Of-File
- *
- * @param buffer
- * A buffer of diva data
- *
- * @return True if we have reached End-Of-File
- */
- static protected boolean EOF(String buffer) {
- if (buffer == null )
- return true;
- return false;
- }
-
- /**
- *
- */
- static protected void getAllCenterFileNames() {
- try {
- File f = new File(root);
-
- if(f.isDirectory()) {
- File[] dataFiles = filterAndSortFiles(f.listFiles());
- // remember the area files
- for(int j = 0; j < dataFiles.length; j ++) {
-
- allCentersFiles.add(dataFiles[j].getAbsolutePath());
- }
- }
- }catch (Exception e) {
- Activator.logInformation("Error reading file"+e.getMessage()); //$NON-NLS-1$
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- /**
- * filter the list of files and return a sorted array
- * @param files
- * @return
- */
- static File[] filterAndSortFiles(File[] files) {
- List<File> filtered = new ArrayList<File>();
- for (int i = 0; i < files.length; i ++) {
- String name = files[i].getName();
-
- if(name.indexOf("_centers.properties")>=1) { //$NON-NLS-1$
- filtered.add(files[i]);
- }
- }
- File[] retVal = new File[filtered.size()];
- for (int i = 0; i < filtered.size(); i ++) {
- retVal[i] = filtered.get(i);
- }
- Arrays.sort(retVal);
- return retVal;
- }
-
- /**
- * filter the list of files and return a sorted array
- * @param files
- * @return
- */
- @SuppressWarnings("nls")
- static File[] filterAndSortCountryDirs(File[] files) {
- List<File> filtered = new ArrayList<File>();
- for (int i = 0; i < files.length; i ++) {
- String name = files[i].getName();
-
- if((name.indexOf("svn")<=-1)&&(name.indexOf("ZZZ")<=-1)&&(name.indexOf("DS_Store")<=-1)) {
- filtered.add(files[i]);
- }
- }
- File[] retVal = new File[filtered.size()];
- for (int i = 0; i < filtered.size(); i ++) {
- retVal[i] = filtered.get(i);
- }
- Arrays.sort(retVal);
- return retVal;
- }
-
- /**
- *
- * @param id
- * @return
- */
- public double getLatitude(String id) {
- if(regionCentersMap.containsKey(id)) {
- String center = regionCentersMap.get(id);
- StringTokenizer tokenizer = new StringTokenizer(center, ","); //$NON-NLS-1$
- String lat = tokenizer.nextToken().trim();
- double latVal = (new Double(lat)).doubleValue();
- return latVal;
- } else {
- Activator.logInformation("1. CenterReader(): Error, region "+id+" not found"); //$NON-NLS-1$ //$NON-NLS-2$
- return -999;
- }
-
- }
-
- /**
- * returns double[2] (lat,lng)
- * @param id
- * @return
- */
- public double[] getLatLong(String id) {
- double[] retVal = new double[2];
- if(regionCentersMap.containsKey(id)) {
- String center = regionCentersMap.get(id);
- StringTokenizer tokenizer = new StringTokenizer(center, ","); //$NON-NLS-1$
- String lat = tokenizer.nextToken().trim();
- String lng = tokenizer.nextToken().trim();
- retVal[0] = (new Double(lat)).doubleValue();
- retVal[1] = (new Double(lng)).doubleValue();
- return retVal;
- } else {
- Activator.logInformation("2. CenterReader(): Warning, region "+id+" not found"); //$NON-NLS-1$ //$NON-NLS-2$
- return null;
- }
-
- }
-
-
-
-
-}// class \ No newline at end of file
diff --git a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/GeographicCenters.java b/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/GeographicCenters.java
deleted file mode 100644
index 6743153..0000000
--- a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/GeographicCenters.java
+++ /dev/null
@@ -1,187 +0,0 @@
-// GeographicCenters.java
-package org.eclipse.stem.data.geography.centers;
-
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.NoSuchElementException;
-import java.util.ResourceBundle;
-import java.util.StringTokenizer;
-
-import org.eclipse.stem.data.geography.Activator;
-import org.eclipse.stem.data.geography.GeographicMapper;
-
-/**
- * This class is responsible for providing pre-computed geographic Latitude and
- * Longitude for the center of geographic locations.
- */
-@SuppressWarnings("nls")
-public class GeographicCenters extends GeographicMapper {
- /**
- * This is the string that identifies the type of bundle for geographic
- * centers.
- */
- private static final String CENTERS_BUNDLE_TYPE = "centers"; //$NON-NLS-1$
-
- /**
- * The root name of the file that contains the level 0 names.
- */
- public static final String LEVEL_0_ISO_NAMES_ROOT_NAME = "level0ISONames"; //$NON-NLS-1$
-
- private static final String LEVEL_0_RB_NAME = RB_PREFIX + "." //$NON-NLS-1$
- + LEVEL_0_ISO_NAMES_ROOT_NAME;
-
- private static ResourceBundle level0RB = null;
-
- private static Map<String, ResourceBundle> rbMap = new HashMap<String, ResourceBundle>();
-
- /**
- * @param isoKey
- * the ISO-3166 alpha2 or alpha3 key of a geographic location
- * @return the center of the geographic location that matches isoKey, the
- * first index (0) of the array is the latitude, the second (1) is
- * the longitude, or <code>null</code> if the center could not be
- * found for the key.
- */
- public static double[] getCenter(final String isoKey) {
- return getCenter(isoKey, keyLevel(isoKey));
- } // getCenter
-
- /**
- * @param isoKey
- * the ISO-3166 alpha2 or alpha3 key of a geographic location
- * @param level
- * the level of the key
- * @return the latitude and longitude of the center of the geographic region
- * that matches isoKey, or <code>null</code> if not found.
- */
-
- public static double[] getCenter(final String isoKey, final int level) {
- double[] retValue = null;
- String latLongString = "";
-
-
- try {
- // World is special
- if(isoKey.equalsIgnoreCase("ZZZ")) {
- retValue = new double[2];
- retValue[0] = 0.0;
- retValue[1] = 0.0;
- return retValue;
- }
-
- String isoKey2 = isoKey;
- // alpha3 key?
- if (isoKey.length() == 3) {
- // Yes
- isoKey2 = getAlpha2(isoKey);
- } // if
-
- ResourceBundle rb = getResourceBundle(isoKey2, level,
- RB_PREFIX + ".centers", CENTERS_BUNDLE_TYPE,
- LEVEL_0_RB_NAME, level0RB, rbMap);
- try {
- latLongString = rb.getString(isoKey2).trim();
- } catch (final MissingResourceException e) {
- // Try the 3 letter version
- rb = getResourceBundle(isoKey, level,
- RB_PREFIX + ".centers", CENTERS_BUNDLE_TYPE,
- LEVEL_0_RB_NAME, level0RB, rbMap);
- latLongString = rb.getString(isoKey).trim();
- }
- // Did we get anything?
- if (latLongString != null && !latLongString.equals("")) {
- // Yes
- final StringTokenizer st = new StringTokenizer(latLongString,
- ",");
- final String latitudeString = st.nextToken();
- final String longitudeString = st.nextToken();
-
- retValue = new double[2];
- retValue[0] = Double.parseDouble(latitudeString);
- retValue[1] = Double.parseDouble(longitudeString);
- } // if
-
- } catch (final MissingResourceException e) {
- retValue = null;
- } catch (final NullPointerException e) {
- retValue = null;
- } // catch NullPointerException
- catch (NumberFormatException nfe) {
- Activator.logError("Error parsing \"" + latLongString
- + "\" for the lat/long center of \"" + isoKey
- + "\" Number format?", nfe);
- } // catch NumberFormatException
- catch (NoSuchElementException nsee) {
- Activator.logError("Error parsing \"" + latLongString
- + "\" for the lat/long center of \"" + isoKey
- + "\" Missing value?", nsee);
- } // catch NoSuchElementException
-
- return retValue;
- } // getCenter
-
- /**
- * @param isoKey
- * @param bundlePrefix
- * TODO
- * @param bundleType
- * a {@link String} that identifies the type of bundle
- * @param level0RBName
- * the name of the {@link ResourceBundle} file that contains the
- * level 0 resources
- * @param level0RB
- * the reference of the level 0 {@link ResourceBundle}
- * @param rbMap
- * a {@link Map} between alpha-2 iso key and
- * {@link ResourceBundle}s
- * @return the {@link ResourceBundle} that contains the mapping
- */
- protected static ResourceBundle getResourceBundle(final String isoKey,
- final int level,
- final String bundlePrefix, final String bundleType,
- final String level0RBName, ResourceBundle level0RB,
- Map<String, ResourceBundle> rbMap) {
- ResourceBundle retValue = null;
-
- String alpha2ISOKey = isoKey;
- if (isoKey.length() == 3) {
- alpha2ISOKey = getAlpha2(isoKey);
- }
- else {
- alpha2ISOKey = (isoKey.trim()).substring(0, 2);
- }
-
- // We use that value as the key to "cache" the resource bundle
- retValue = rbMap.get(alpha2ISOKey);
-
- // Have we retrieved this ResourceBundle before?
- if (retValue == null) {
- // No
- retValue = readResourceBundle(alpha2ISOKey, bundlePrefix,
- bundleType);
- // Were we successful?
- if (retValue == null) {
- // No
- Activator.logError("Could not read Resource Bundle of type "
- + bundleType + " for \"" + alpha2ISOKey + "\"", null);
- } // if
- else {
- // No
- rbMap.put(alpha2ISOKey, retValue);
- } // else
- } // if
- return retValue;
- } // getResourceBundle
-} // GeographicCenters
diff --git a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/PluginCenterReader.java b/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/PluginCenterReader.java
deleted file mode 100644
index 53a127c..0000000
--- a/geography/org.eclipse.stem.data.geography/src/org/eclipse/stem/data/geography/centers/PluginCenterReader.java
+++ /dev/null
@@ -1,298 +0,0 @@
-package org.eclipse.stem.data.geography.centers;
-
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.stem.data.geography.Activator;
-import org.eclipse.stem.data.geography.GeographicMapper;
-import org.osgi.framework.Bundle;
-
-/**
- *
- * Same as CenterReader but uses OSGI bundle API's to load resources.
- *
- */
-public class PluginCenterReader extends GeographicMapper{
-
- public static Map<String, String> regionCentersMap= new HashMap<String, String>();
-
- public static final String GEOGRAPHY_DATA_PLUGIN = "org.eclipse.stem.data.geography"; //$NON-NLS-1$
- public static final String DATA_PATH = "src/org/eclipse/stem/data/geography/centers/"; //$NON-NLS-1$
-
- //public static final String dataPath = "./src/org/eclipse/stem/data/geography/centers/"; //$NON-NLS-1$
- public static Bundle geoBundle;
- static List<URL> allCentersFiles = new ArrayList<URL>();
- List<String> allCountryIDs = new ArrayList<String>();
- /**
- * This class reads all the centers in STEM
- */
- @SuppressWarnings("nls")
- public PluginCenterReader() {
- try {
- //String top = parentDir.getCanonicalPath();
- geoBundle=Platform.getBundle(GEOGRAPHY_DATA_PLUGIN);
-
- }catch(Exception e) {
- e.printStackTrace();
- }
- getAllCenterFileNames();
- for(int i = 0; i < allCentersFiles.size(); i ++) {
- URL url = allCentersFiles.get(i);
- readCenters(url);
-
- int idx = url.toString().indexOf("_centers.properties");
- if(idx >3) {
- String id3 = url.toString().substring(idx-3,idx);
- if(id3.indexOf("ZZZ")==-1) allCountryIDs.add(id3);
- }
-
- }
-
- }
-
- /**
- * This class reads all the centers in STEM
- */
- @SuppressWarnings("nls")
- public PluginCenterReader(List<URL> centersFiles) {
- allCentersFiles = centersFiles;
- getAllCenterFileNames();
- for(int i = 0; i < allCentersFiles.size(); i ++) {
- URL url = allCentersFiles.get(i);
- readCenters(url);
-
- int idx = url.toString().indexOf("_centers.properties");
- if(idx >3) {
- String id3 = url.toString().substring(idx-3,idx);
- if(id3.indexOf("ZZZ")==-1) allCountryIDs.add(id3);
- }
- }
- }
-
- /**
- * @param args
- */
- @SuppressWarnings("unused")
- public static void main(String[] args) {
- PluginCenterReader pcr = new PluginCenterReader();
- }
-
- /**
- * Get an array of country codes
- * @return
- */
- public String[] getCountryIDs() {
- String[] id3s = allCountryIDs.toArray(new String[allCountryIDs.size()]);
- Arrays.sort(id3s);
- return id3s;
- }
-
- /**
- * read in the Centers and keys
- *
- */
- public Map<String, String> readCenters(URL url) {
-
- BufferedReader fileReader = openReader(url);
-
- try {
- // Add all the source URLs for this country.
-
- if (fileReader != null) {
- String buffer = null;
- while (EOF(buffer = fileReader.readLine()) != true) {
-
- //Activator.logInformation(" "+buffer);
- // Tokenize
- //
- if((buffer.indexOf("SOURCE")==-1)&&(buffer.indexOf("VALID")==-1)&&(buffer.indexOf("#")==-1)&&(buffer.indexOf("=")>=0)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- StringTokenizer tokenizer = new StringTokenizer(buffer, "="); //$NON-NLS-1$
- String stemID2 = tokenizer.nextToken().trim();
- String center = tokenizer.nextToken();
- regionCentersMap.put(stemID2, center);
- //Activator.logInformation(" mapped "+stemID2+" to "+Name.doubleValue() );
- }
- }
- }
- }catch (Exception e) {
- Activator.logInformation("Error reading file"+url); //$NON-NLS-1$
- e.printStackTrace();
- System.exit(1);
- }
- return regionCentersMap;
-
- }// readName(String fileName)
-
-
- /**
- * Create a newBufferedReader
- *
- * @param fileName
- * the center of the file we want to open for reading
- *
- * @return a reader to a given file
- */
- static protected BufferedReader openReader(URL url) {
-
- try {
-
-// File f = new File(file);
-
-// if (f.exists() == false) {
-// return null;
-// }
-
- return new BufferedReader((new InputStreamReader(url.openStream())));
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return null;
- }
-
-
-
-
- /**
- * Indicate End-Of-File
- *
- * @param buffer
- * A buffer of diva data
- *
- * @return True if we have reached End-Of-File
- */
- static protected boolean EOF(String buffer) {
- if (buffer == null )
- return true;
- return false;
- }
-
- /**
- *
- */
- static protected void getAllCenterFileNames() {
- try {
- //Path p = new Path(DATA_PATH);
- Enumeration<URL> allFiles = geoBundle.findEntries(DATA_PATH, "*.properties", false); //$NON-NLS-1$
-
- URL[] dataFiles = filterAndSortFiles(allFiles);
- // remember the area files
- for(int j = 0; j < dataFiles.length; j ++) {
-
- allCentersFiles.add(dataFiles[j]);
- }
- }catch (Exception e) {
- Activator.logInformation("Error reading file"+e.getMessage()); //$NON-NLS-1$
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- /**
- * filter the list of files and return a sorted array
- * @param files
- * @return
- */
- static URL[] filterAndSortFiles(Enumeration<URL>allFiles) {
- List<URL> filtered = new ArrayList<URL>();
- while(allFiles.hasMoreElements()) {
- URL url = allFiles.nextElement();
-
- if(url.getPath().indexOf("_centers.properties")>=1) { //$NON-NLS-1$
- filtered.add(url);
- }
- }
- URL[] retVal = new URL[filtered.size()];
- for (int i = 0; i < filtered.size(); i ++) {
- retVal[i] = filtered.get(i);
- }
- Arrays.sort(retVal, new Comparator<URL>() {
- @Override
- public int compare(URL ua, URL ub) {
- return ua.getPath().compareTo(ub.toString());
- }
- });
- return retVal;
- }
-
- /**
- * filter the list of files and return a sorted array
- * @param files
- * @return
- */
- @SuppressWarnings("nls")
- static File[] filterAndSortCountryDirs(File[] files) {
- List<File> filtered = new ArrayList<File>();
- for (int i = 0; i < files.length; i ++) {
- String name = files[i].getName();
-
- if((name.indexOf("svn")<=-1)&&(name.indexOf("ZZZ")<=-1)&&(name.indexOf("DS_Store")<=-1)) {
- filtered.add(files[i]);
- }
- }
- File[] retVal = new File[filtered.size()];
- for (int i = 0; i < filtered.size(); i ++) {
- retVal[i] = filtered.get(i);
- }
- Arrays.sort(retVal);
- return retVal;
- }
-
- /**
- *
- * @param id
- * @return
- */
- public double getLatitude(String id) {
- if(regionCentersMap.containsKey(id)) {
- String center = regionCentersMap.get(id);
- StringTokenizer tokenizer = new StringTokenizer(center, ","); //$NON-NLS-1$
- String lat = tokenizer.nextToken().trim();
- double latVal = (new Double(lat)).doubleValue();
- return latVal;
- } else {
- Activator.logInformation("1. CenterReader(): Error, region "+id+" not found"); //$NON-NLS-1$ //$NON-NLS-2$
- return -999;
- }
-
- }
-
- /**
- * returns double[2] (lat,lng)
- * @param id
- * @return
- */
- public double[] getLatLong(String id) {
- double[] retVal = new double[2];
- if(regionCentersMap.containsKey(id)) {
- String center = regionCentersMap.get(id);
- StringTokenizer tokenizer = new StringTokenizer(center, ","); //$NON-NLS-1$
- String lat = tokenizer.nextToken().trim();
- String lng = tokenizer.nextToken().trim();
- retVal[0] = (new Double(lat)).doubleValue();
- retVal[1] = (new Double(lng)).doubleValue();
- return retVal;
- } else {
- Activator.logInformation("2. CenterReader(): Warning, region "+id+" not found"); //$NON-NLS-1$ //$NON-NLS-2$
- return null;
- }
-
- }
-
-
-
-
-}// class \ No newline at end of file
diff --git a/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/META-INF/MANIFEST.MF b/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/META-INF/MANIFEST.MF
index a075ff2..60ff403 100644
--- a/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/META-INF/MANIFEST.MF
+++ b/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/META-INF/MANIFEST.MF
@@ -9,5 +9,6 @@ Require-Bundle: org.eclipse.stem.definitions,
org.eclipse.stem.internal.data,
org.eclipse.stem.data.geography,
org.eclipse.stem.data.geography.infrastructure.transportation,
- org.eclipse.stem.transport
+ org.eclipse.stem.transport,
+ org.eclipse.stem.geography
Bundle-Vendor: Eclipse.org
diff --git a/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/TransportationDataGenerator.java b/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/TransportationDataGenerator.java
index 68c2ada..7df314c 100644
--- a/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/TransportationDataGenerator.java
+++ b/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/TransportationDataGenerator.java
@@ -17,7 +17,7 @@ import java.util.List;
import org.eclipse.emf.common.util.URI;
import org.eclipse.stem.core.Constants;
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.ModelGenerator;
import org.eclipse.stem.internal.data.PluginFileGenerator;
import org.eclipse.stem.internal.data.generatedplugin.DublinCore;
diff --git a/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/propertydata/AirTransportGeographicRelationshipPropertyData.java b/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/propertydata/AirTransportGeographicRelationshipPropertyData.java
index 25acc3a..20a9f9d 100644
--- a/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/propertydata/AirTransportGeographicRelationshipPropertyData.java
+++ b/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/propertydata/AirTransportGeographicRelationshipPropertyData.java
@@ -15,7 +15,7 @@ package org.eclipse.stem.internal.data.geography.infrastructure.transportation.p
import java.text.ParseException;
import java.util.StringTokenizer;
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.geography.propertydata.GeographicRelationshipPropertyData;
/**
diff --git a/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/specifications/AirTransportationGeographicRelationshipPropertyFileSpecification.java b/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/specifications/AirTransportationGeographicRelationshipPropertyFileSpecification.java
index b39f334..1c0024e 100644
--- a/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/specifications/AirTransportationGeographicRelationshipPropertyFileSpecification.java
+++ b/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/src/org/eclipse/stem/internal/data/geography/infrastructure/transportation/specifications/AirTransportationGeographicRelationshipPropertyFileSpecification.java
@@ -25,7 +25,6 @@ import org.eclipse.stem.core.graph.Edge;
import org.eclipse.stem.core.graph.EdgeLabel;
import org.eclipse.stem.core.graph.Graph;
import org.eclipse.stem.core.graph.impl.EdgeImpl;
-import org.eclipse.stem.data.geography.ISOKey;
import org.eclipse.stem.definitions.labels.LabelsFactory;
import org.eclipse.stem.definitions.labels.PopulationLabel;
import org.eclipse.stem.definitions.labels.RelativePhysicalRelationship;
@@ -38,6 +37,7 @@ import org.eclipse.stem.definitions.transport.PipeTransportEdge;
import org.eclipse.stem.definitions.transport.PipeTransportEdgeLabel;
import org.eclipse.stem.definitions.transport.PipeTransportEdgeLabelValue;
import org.eclipse.stem.definitions.transport.TransportFactory;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.geography.infrastructure.transportation.propertydata.AirTransportGeographicRelationshipPropertyData;
import org.eclipse.stem.internal.data.propertydata.PropertyData;
import org.eclipse.stem.internal.data.propertydata.RelationshipPropertyData;
diff --git a/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/update.xml b/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/update.xml
index 73388a7..0b5f15d 100644
--- a/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/update.xml
+++ b/geography/org.eclipse.stem.internal.data.geography.infrastructure.transportation/update.xml
@@ -86,6 +86,7 @@
<pathelement location="${path.sourceplugin}/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.core/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.definitions/${targetBin}" />
+ <pathelement location="${pluginRootDirectory}/${ID_ROOT}.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.data.geography/${targetBin}" />
diff --git a/geography/org.eclipse.stem.internal.data.geography.models/META-INF/MANIFEST.MF b/geography/org.eclipse.stem.internal.data.geography.models/META-INF/MANIFEST.MF
index 139b7c4..ee87d48 100644
--- a/geography/org.eclipse.stem.internal.data.geography.models/META-INF/MANIFEST.MF
+++ b/geography/org.eclipse.stem.internal.data.geography.models/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@ Require-Bundle: org.eclipse.emf.ecore,
org.eclipse.stem.internal.data.geography,
org.eclipse.stem.data.geography,
org.eclipse.stem.definitions,
- org.eclipse.stem.data.geography.models
+ org.eclipse.stem.data.geography.models,
+ org.eclipse.stem.geography
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.stem.internal.data.geography.models,
org.eclipse.stem.internal.data.specifications
diff --git a/geography/org.eclipse.stem.internal.data.geography.models/src/org/eclipse/stem/internal/data/geography/models/GeographyModelGenerator.java b/geography/org.eclipse.stem.internal.data.geography.models/src/org/eclipse/stem/internal/data/geography/models/GeographyModelGenerator.java
index 529dffe..7fcf59b 100644
--- a/geography/org.eclipse.stem.internal.data.geography.models/src/org/eclipse/stem/internal/data/geography/models/GeographyModelGenerator.java
+++ b/geography/org.eclipse.stem.internal.data.geography.models/src/org/eclipse/stem/internal/data/geography/models/GeographyModelGenerator.java
@@ -27,8 +27,8 @@ import java.util.Map;
import org.eclipse.emf.common.util.URI;
import org.eclipse.stem.core.Constants;
import org.eclipse.stem.core.graph.GraphPackage;
-import org.eclipse.stem.data.geography.ISOKey;
import org.eclipse.stem.definitions.nodes.Region;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.ModelGenerator;
import org.eclipse.stem.internal.data.PluginFileGenerator;
import org.eclipse.stem.internal.data.generatedplugin.DublinCore;
diff --git a/geography/org.eclipse.stem.internal.data.geography.models/src/org/eclipse/stem/internal/data/specifications/GeographicModelSpecification.java b/geography/org.eclipse.stem.internal.data.geography.models/src/org/eclipse/stem/internal/data/specifications/GeographicModelSpecification.java
index fc5e3f8..7d1efc2 100644
--- a/geography/org.eclipse.stem.internal.data.geography.models/src/org/eclipse/stem/internal/data/specifications/GeographicModelSpecification.java
+++ b/geography/org.eclipse.stem.internal.data.geography.models/src/org/eclipse/stem/internal/data/specifications/GeographicModelSpecification.java
@@ -25,8 +25,8 @@ import org.eclipse.stem.core.Utility;
import org.eclipse.stem.core.graph.Graph;
import org.eclipse.stem.core.model.Model;
import org.eclipse.stem.core.model.ModelPackage;
-import org.eclipse.stem.data.geography.ISOKey;
import org.eclipse.stem.definitions.nodes.NodesPackage;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.generatedplugin.DublinCore;
import org.eclipse.stem.internal.data.geography.specifications.AdminLevelSet;
import org.eclipse.stem.internal.data.geography.specifications.CountryGraphPropertyFileSpecification;
diff --git a/geography/org.eclipse.stem.internal.data.geography.models/update.xml b/geography/org.eclipse.stem.internal.data.geography.models/update.xml
index c3ff030..a1e1b23 100644
--- a/geography/org.eclipse.stem.internal.data.geography.models/update.xml
+++ b/geography/org.eclipse.stem.internal.data.geography.models/update.xml
@@ -92,6 +92,7 @@
<pathelement location="${path.sourceplugin}/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.core/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.definitions/${targetBin}" />
+ <pathelement location="${pluginRootDirectory}/${ID_ROOT}.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.data.geography/${targetBin}" />
diff --git a/geography/org.eclipse.stem.internal.data.geography/META-INF/MANIFEST.MF b/geography/org.eclipse.stem.internal.data.geography/META-INF/MANIFEST.MF
index 09d3438..dcc1953 100644
--- a/geography/org.eclipse.stem.internal.data.geography/META-INF/MANIFEST.MF
+++ b/geography/org.eclipse.stem.internal.data.geography/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Export-Package: org.eclipse.stem.internal.data.geography,
org.eclipse.stem.internal.data.geography.propertydata,
org.eclipse.stem.internal.data.geography.specifications
Require-Bundle: org.eclipse.stem.definitions,
+ org.eclipse.stem.geography,
org.eclipse.stem.internal.data,
org.eclipse.stem.data.geography
Bundle-Vendor: Eclipse.org
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/GeographyPluginFileGenerator.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/GeographyPluginFileGenerator.java
index a8b6c21..e1098f2 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/GeographyPluginFileGenerator.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/GeographyPluginFileGenerator.java
@@ -24,7 +24,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.PluginFileGenerator;
import org.eclipse.stem.internal.data.geography.specifications.CountryGraphPropertyFileSpecification;
import org.eclipse.stem.internal.data.geography.specifications.GeographicRelationshipPropertyFileSpecification;
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/isokeycollector/ISOKeyCollector.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/isokeycollector/ISOKeyCollector.java
index c5f1ca6..5fc66e9 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/isokeycollector/ISOKeyCollector.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/isokeycollector/ISOKeyCollector.java
@@ -27,9 +27,9 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
-import org.eclipse.stem.data.geography.GeographicMapper;
-import org.eclipse.stem.data.geography.GeographicNames;
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.GeographicMapper;
+import org.eclipse.stem.geography.names.GeographicNames;
+import org.eclipse.stem.geography.names.ISOKey;
/**
* This class processes the properties files for each country to create a
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/AreaPropertyData.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/AreaPropertyData.java
index b874138..810e13f 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/AreaPropertyData.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/AreaPropertyData.java
@@ -12,7 +12,7 @@ package org.eclipse.stem.internal.data.geography.propertydata;
* IBM Corporation - initial API and implementation
*******************************************************************************/
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
/**
* This class contains the data from a property that specifies the area in
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/GeographicFeaturePropertyData.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/GeographicFeaturePropertyData.java
index f6ea276..2271075 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/GeographicFeaturePropertyData.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/GeographicFeaturePropertyData.java
@@ -12,7 +12,7 @@ package org.eclipse.stem.internal.data.geography.propertydata;
* IBM Corporation - initial API and implementation
*******************************************************************************/
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.propertydata.PropertyData;
/**
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/GeographicRelationshipPropertyData.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/GeographicRelationshipPropertyData.java
index 5f43eac..e2867d1 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/GeographicRelationshipPropertyData.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/GeographicRelationshipPropertyData.java
@@ -15,7 +15,7 @@ package org.eclipse.stem.internal.data.geography.propertydata;
import java.text.ParseException;
import java.util.StringTokenizer;
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.propertydata.RelationshipPropertyData;
/**
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/RegionPropertyData.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/RegionPropertyData.java
index bea18bc..f5ea069 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/RegionPropertyData.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/propertydata/RegionPropertyData.java
@@ -12,7 +12,7 @@ package org.eclipse.stem.internal.data.geography.propertydata;
* IBM Corporation - initial API and implementation
*******************************************************************************/
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
/**
* This class contains the data from a property that specifies a single
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryAreaLabelPropertyFileSpecification.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryAreaLabelPropertyFileSpecification.java
index 8cc6ccd..2fde8d8 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryAreaLabelPropertyFileSpecification.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryAreaLabelPropertyFileSpecification.java
@@ -12,11 +12,11 @@ package org.eclipse.stem.internal.data.geography.specifications;
*******************************************************************************/
import org.eclipse.stem.core.graph.NodeLabel;
-import org.eclipse.stem.data.geography.ISOKey;
import org.eclipse.stem.definitions.labels.AreaLabel;
import org.eclipse.stem.definitions.labels.LabelsFactory;
import org.eclipse.stem.definitions.labels.impl.AreaLabelImpl;
import org.eclipse.stem.definitions.nodes.impl.RegionImpl;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.geography.propertydata.AreaPropertyData;
import org.eclipse.stem.internal.data.propertydata.PropertyData;
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryGraphPropertyFileSpecification.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryGraphPropertyFileSpecification.java
index a690bfb..b343365 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryGraphPropertyFileSpecification.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryGraphPropertyFileSpecification.java
@@ -18,7 +18,7 @@ import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.specifications.GraphPropertyFileSpecification;
/**
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryLabelPropertyFileSpecification.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryLabelPropertyFileSpecification.java
index 2d50561..05c61db 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryLabelPropertyFileSpecification.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryLabelPropertyFileSpecification.java
@@ -17,7 +17,7 @@ import org.eclipse.stem.core.common.Identifiable;
import org.eclipse.stem.core.graph.Graph;
import org.eclipse.stem.core.graph.GraphPackage;
import org.eclipse.stem.core.graph.NodeLabel;
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.propertydata.PropertyData;
/**
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryNodePropertyFileSpecification.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryNodePropertyFileSpecification.java
index 0cf8632..f7d8521 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryNodePropertyFileSpecification.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/CountryNodePropertyFileSpecification.java
@@ -17,11 +17,11 @@ import org.eclipse.stem.core.common.Identifiable;
import org.eclipse.stem.core.graph.Graph;
import org.eclipse.stem.core.graph.GraphPackage;
import org.eclipse.stem.core.graph.Node;
-import org.eclipse.stem.data.geography.ISOKey;
import org.eclipse.stem.definitions.adapters.spatial.SpatialProviderAdapter;
import org.eclipse.stem.definitions.nodes.NodesFactory;
import org.eclipse.stem.definitions.nodes.Region;
import org.eclipse.stem.definitions.nodes.impl.RegionImpl;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.geography.propertydata.RegionPropertyData;
import org.eclipse.stem.internal.data.propertydata.PropertyData;
diff --git a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/GeographicRelationshipPropertyFileSpecification.java b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/GeographicRelationshipPropertyFileSpecification.java
index 086ea17..927cfc5 100644
--- a/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/GeographicRelationshipPropertyFileSpecification.java
+++ b/geography/org.eclipse.stem.internal.data.geography/src/org/eclipse/stem/internal/data/geography/specifications/GeographicRelationshipPropertyFileSpecification.java
@@ -19,8 +19,8 @@ import org.eclipse.stem.core.STEMURI;
import org.eclipse.stem.core.graph.Edge;
import org.eclipse.stem.core.graph.EdgeLabel;
import org.eclipse.stem.core.graph.GraphFactory;
-import org.eclipse.stem.data.geography.ISOKey;
import org.eclipse.stem.definitions.nodes.impl.RegionImpl;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.geography.propertydata.GeographicRelationshipPropertyData;
import org.eclipse.stem.internal.data.propertydata.RelationshipPropertyData;
import org.eclipse.stem.internal.data.specifications.RelationshipGraphPropertyFileSpecification;
diff --git a/geography/org.eclipse.stem.internal.data.geography/update.xml b/geography/org.eclipse.stem.internal.data.geography/update.xml
index d2ff26a..76b9bb1 100644
--- a/geography/org.eclipse.stem.internal.data.geography/update.xml
+++ b/geography/org.eclipse.stem.internal.data.geography/update.xml
@@ -95,6 +95,7 @@
<pathelement location="${path.sourceplugin}/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.core/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.definitions/${targetBin}" />
+ <pathelement location="${pluginRootDirectory}/${ID_ROOT}.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.data.geography/${targetBin}" />
<fileset dir="${baseLocation}/plugins/">
diff --git a/population/org.eclipse.stem.internal.data.geography.population.human.models/META-INF/MANIFEST.MF b/population/org.eclipse.stem.internal.data.geography.population.human.models/META-INF/MANIFEST.MF
index c35b8f1..38cdf27 100644
--- a/population/org.eclipse.stem.internal.data.geography.population.human.models/META-INF/MANIFEST.MF
+++ b/population/org.eclipse.stem.internal.data.geography.population.human.models/META-INF/MANIFEST.MF
@@ -6,6 +6,7 @@ Bundle-Version: 2.0.0.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.stem.core,
org.eclipse.stem.definitions,
+ org.eclipse.stem.geography,
org.eclipse.stem.data.geography,
org.eclipse.stem.data.geography.models,
org.eclipse.stem.internal.data,
diff --git a/population/org.eclipse.stem.internal.data.geography.population.human.models/src/org/eclipse/stem/internal/data/geography/population/human/models/PopulationModelGenerator.java b/population/org.eclipse.stem.internal.data.geography.population.human.models/src/org/eclipse/stem/internal/data/geography/population/human/models/PopulationModelGenerator.java
index a1f7163..6bcc9a4 100644
--- a/population/org.eclipse.stem.internal.data.geography.population.human.models/src/org/eclipse/stem/internal/data/geography/population/human/models/PopulationModelGenerator.java
+++ b/population/org.eclipse.stem.internal.data.geography.population.human.models/src/org/eclipse/stem/internal/data/geography/population/human/models/PopulationModelGenerator.java
@@ -22,7 +22,7 @@ import java.util.Map;
import org.eclipse.emf.common.util.URI;
import org.eclipse.stem.core.Constants;
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.ModelGenerator;
import org.eclipse.stem.internal.data.PluginFileGenerator;
import org.eclipse.stem.internal.data.generatedplugin.DublinCore;
diff --git a/population/org.eclipse.stem.internal.data.geography.population.human.models/src/org/eclipse/stem/internal/data/geography/population/human/models/PopulationModelSpecification.java b/population/org.eclipse.stem.internal.data.geography.population.human.models/src/org/eclipse/stem/internal/data/geography/population/human/models/PopulationModelSpecification.java
index b09c40c..4588462 100644
--- a/population/org.eclipse.stem.internal.data.geography.population.human.models/src/org/eclipse/stem/internal/data/geography/population/human/models/PopulationModelSpecification.java
+++ b/population/org.eclipse.stem.internal.data.geography.population.human.models/src/org/eclipse/stem/internal/data/geography/population/human/models/PopulationModelSpecification.java
@@ -21,8 +21,8 @@ import org.eclipse.stem.core.Utility;
import org.eclipse.stem.core.graph.Graph;
import org.eclipse.stem.core.model.Model;
import org.eclipse.stem.core.model.ModelPackage;
-import org.eclipse.stem.data.geography.ISOKey;
import org.eclipse.stem.definitions.labels.LabelsPackage;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.generatedplugin.DublinCore;
import org.eclipse.stem.internal.data.geography.specifications.AdminLevelSet;
import org.eclipse.stem.internal.data.geography.specifications.CountryGraphPropertyFileSpecification;
diff --git a/population/org.eclipse.stem.internal.data.geography.population.human.models/update.xml b/population/org.eclipse.stem.internal.data.geography.population.human.models/update.xml
index c7a69bd..ec7bc05 100644
--- a/population/org.eclipse.stem.internal.data.geography.population.human.models/update.xml
+++ b/population/org.eclipse.stem.internal.data.geography.population.human.models/update.xml
@@ -95,6 +95,7 @@
<pathelement location="${path.sourceplugin}/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.core/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.definitions/${targetBin}" />
+ <pathelement location="${pluginRootDirectory}/${ID_ROOT}.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data.geography.models/${targetBin}" />
diff --git a/population/org.eclipse.stem.internal.data.geography.population.human/update.xml b/population/org.eclipse.stem.internal.data.geography.population.human/update.xml
index 91323a2..2c8381d 100644
--- a/population/org.eclipse.stem.internal.data.geography.population.human/update.xml
+++ b/population/org.eclipse.stem.internal.data.geography.population.human/update.xml
@@ -86,6 +86,7 @@
<pathelement location="${path.sourceplugin}/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.core/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.definitions/${targetBin}" />
+ <pathelement location="${pluginRootDirectory}/${ID_ROOT}.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.data.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data.geography/${targetBin}" />
diff --git a/population/org.eclipse.stem.internal.data.geography.population/META-INF/MANIFEST.MF b/population/org.eclipse.stem.internal.data.geography.population/META-INF/MANIFEST.MF
index 57090d3..0499d84 100644
--- a/population/org.eclipse.stem.internal.data.geography.population/META-INF/MANIFEST.MF
+++ b/population/org.eclipse.stem.internal.data.geography.population/META-INF/MANIFEST.MF
@@ -6,6 +6,7 @@ Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.stem.core,
org.eclipse.stem.definitions,
+ org.eclipse.stem.geography,
org.eclipse.stem.data.geography,
org.eclipse.stem.internal.data,
org.eclipse.stem.internal.data.geography,
diff --git a/population/org.eclipse.stem.internal.data.geography.population/src/org/eclipse/stem/internal/data/geography/propertydata/PopulationPropertyData.java b/population/org.eclipse.stem.internal.data.geography.population/src/org/eclipse/stem/internal/data/geography/propertydata/PopulationPropertyData.java
index 7cbf45f..4496f3c 100644
--- a/population/org.eclipse.stem.internal.data.geography.population/src/org/eclipse/stem/internal/data/geography/propertydata/PopulationPropertyData.java
+++ b/population/org.eclipse.stem.internal.data.geography.population/src/org/eclipse/stem/internal/data/geography/propertydata/PopulationPropertyData.java
@@ -13,7 +13,7 @@ package org.eclipse.stem.internal.data.geography.propertydata;
*******************************************************************************/
import org.eclipse.stem.definitions.nodes.GeographicFeature;
-import org.eclipse.stem.data.geography.ISOKey;
+import org.eclipse.stem.geography.names.ISOKey;
/**
* This class contains the data from a property that specifies the number of
diff --git a/population/org.eclipse.stem.internal.data.geography.population/src/org/eclipse/stem/internal/data/geography/specifications/CountryPopulationLabelPropertyFileSpecification.java b/population/org.eclipse.stem.internal.data.geography.population/src/org/eclipse/stem/internal/data/geography/specifications/CountryPopulationLabelPropertyFileSpecification.java
index 7cc4d9c..94b7bbc 100644
--- a/population/org.eclipse.stem.internal.data.geography.population/src/org/eclipse/stem/internal/data/geography/specifications/CountryPopulationLabelPropertyFileSpecification.java
+++ b/population/org.eclipse.stem.internal.data.geography.population/src/org/eclipse/stem/internal/data/geography/specifications/CountryPopulationLabelPropertyFileSpecification.java
@@ -16,11 +16,11 @@ import java.util.Properties;
import org.eclipse.stem.core.graph.Graph;
import org.eclipse.stem.core.graph.Node;
import org.eclipse.stem.core.graph.NodeLabel;
-import org.eclipse.stem.data.geography.ISOKey;
import org.eclipse.stem.definitions.labels.LabelsFactory;
import org.eclipse.stem.definitions.labels.PopulationLabel;
import org.eclipse.stem.definitions.labels.impl.PopulationLabelImpl;
import org.eclipse.stem.definitions.nodes.impl.RegionImpl;
+import org.eclipse.stem.geography.names.ISOKey;
import org.eclipse.stem.internal.data.geography.propertydata.PopulationPropertyData;
import org.eclipse.stem.internal.data.propertydata.PropertyData;
diff --git a/population/org.eclipse.stem.internal.data.geography.population/update.xml b/population/org.eclipse.stem.internal.data.geography.population/update.xml
index 1d10ca5..13d8104 100644
--- a/population/org.eclipse.stem.internal.data.geography.population/update.xml
+++ b/population/org.eclipse.stem.internal.data.geography.population/update.xml
@@ -86,6 +86,7 @@
<pathelement location="${path.sourceplugin}/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.core/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.definitions/${targetBin}" />
+ <pathelement location="${pluginRootDirectory}/${ID_ROOT}.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.data.population/${targetBin}" />
<fileset dir="${baseLocation}/plugins/">
diff --git a/population/org.eclipse.stem.internal.data.population.human/update.xml b/population/org.eclipse.stem.internal.data.population.human/update.xml
index 77af844..cc175cb 100644
--- a/population/org.eclipse.stem.internal.data.population.human/update.xml
+++ b/population/org.eclipse.stem.internal.data.population.human/update.xml
@@ -86,6 +86,7 @@
<pathelement location="${path.sourceplugin}/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.core/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.definitions/${targetBin}" />
+ <pathelement location="${pluginRootDirectory}/${ID_ROOT}.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.internal.data/${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.data.population/${targetBin}" />
<fileset dir="${baseLocation}/plugins/">

Back to the top