/** * Return the children of the PrjElement in parameter if it is an instance * of PrjNodeElement and if its name is the same as the name given in * parameter,else it throws a PrjParserException. * * @param e the PrjElement to match * @param name the name of the desired PrjElement */ private List<PrjElement> matchNode(PrjElement e, String name) { return matchNode(e, name, true); }
/** * Return the informations contains in an UNIT node in a list of String. * * @param ll the children of the UNIT node */ private List<String> getUnit(List<PrjElement> ll) { List<String> result = new ArrayList<String>(); String unit = getString(ll.get(0)); String unt = PrjValueParameters.UNITNAMES.get(unit.replaceAll("[^a-zA-Z0-9]", "").toLowerCase()); if (unt != null) { result.add(unt); } else { result.add(unit); } result.add(String.valueOf(getNumber(ll.get(1)))); if (ll.size() > 2) { result.add(getAuthority(matchNode(ll.get(2), PrjKeyParameters.AUTHORITY))); } return result; }
/** * Read the informations contains in the VERT_DATUM node and put it into the * set of parameters. * * @param ll the children of the VERT_DATUM node */ private void parseVertDatum(List<PrjElement> ll) { String datum = getString(ll.get(0)); String datm = PrjValueParameters.DATUMNAMES.get(datum.toLowerCase().replaceAll("[^a-zA-Z0-9]", "")); datum = datm != null ? datm : datum; params.put(PrjKeyParameters.VERTDATUM, datum); parseNumber(ll.get(1), PrjKeyParameters.VERTDATUMTYPE); if (ll.size() > 2) { String auth = getAuthority(matchNode(ll.get(2), PrjKeyParameters.AUTHORITY)); params.put(PrjKeyParameters.VERTDATUMREFNAME, auth); } }
/** * Read the informations contains in the PRIMEM node and put it into the set * of parameters. * * @param ll the children of the PRIMEM node */ private void parsePrimeM(List<PrjElement> ll) { String pm = getString(ll.get(0)); String prm = PrjValueParameters.PRIMEMERIDIANNAMES.get(pm.replaceAll("[^a-zA-Z0-9]", "").toLowerCase()); if (prm != null) { params.put(ProjKeyParameters.pm, prm); } else { params.put(ProjKeyParameters.pm, pm); parseNumber(ll.get(1), PrjKeyParameters.PMVALUE); if (ll.size() > 2) { String auth = getAuthority(matchNode(ll.get(2), PrjKeyParameters.AUTHORITY)); params.put(PrjKeyParameters.PRIMEMREFNAME, auth); } } }
/** * Read the informations contains in the SPHEROID node and put it into the * set of parameters. * * @param ll the children of the SPHEROID node */ private void parseSpheroid(List<PrjElement> ll) { String ellps = getString(ll.get(0)); String elps = PrjValueParameters.ELLIPSOIDNAMES.get(ellps.toLowerCase().replaceAll("[^a-zA-Z0-9]", "")); ellps = elps != null ? elps : ellps; params.put(ProjKeyParameters.ellps, ellps); parseNumber(ll.get(1), ProjKeyParameters.a); parseNumber(ll.get(2), ProjKeyParameters.rf); if (ll.size() > 3) { String auth = getAuthority(matchNode(ll.get(3), PrjKeyParameters.AUTHORITY)); params.put(PrjKeyParameters.SPHEROIDREFNAME, auth); } }
List<PrjElement> ll = matchNode(el, PrjKeyParameters.COMPDCS, false); if (ll == null) { ll = matchNode(el, PrjKeyParameters.PROJCS, false); if (ll == null) { ll = matchNode(el, PrjKeyParameters.GEOGCS, false); if (ll == null) { ll = matchNode(el, PrjKeyParameters.GEOCCS, false); if (ll == null) { ll = matchNode(el, PrjKeyParameters.VERTCS); parseVertcs(ll, true); } else {