/** * Read the informations contains in the PROJECTION node and put it into the * set of parameters. * * @param ll the children of the PROJECTION node */ private void parseProjection(List<PrjElement> ll) { String proj = getString(ll.get(0)); String prj = PrjValueParameters.PROJNAMES.get(proj.replaceAll("[^a-zA-Z0-9]", "").toLowerCase()); proj = prj != null ? prj : proj; params.put(ProjKeyParameters.proj, proj); }
/** * Return the informations contains in an AXIS node in a list of String. * * @param ll the children of the UNIT node */ private List<String> getAxis(List<PrjElement> ll) { List<String> result = new ArrayList<String>(); String axisName = getString(ll.get(0)); String axis = PrjValueParameters.AXISNAMES.get(axisName.replaceAll("[^a-zA-Z0-9]", "").toLowerCase()); if (axis != null) { result.add(axis); } else { result.add(axisName); } result.add(getString(ll.get(1))); return result; }
/** * Read the informations contains in a PARAMETER node and put it into the * set of parameters. * * @param ll the children of the PARAMETER node */ private void parseParameter(List<PrjElement> ll) { String param = getString(ll.get(0)); String parm = PrjValueParameters.PARAMNAMES.get(param.toLowerCase().replaceAll("[^a-zA-Z0-9]", "")); if (parm != null) { parseNumber(ll.get(1), parm); } }
/** * Return the authority code contains in the AUTHORITY node in parameter. * * @param ll the children of the AUTHORITY node */ private String getAuthority(List<PrjElement> ll) { String auth = getString(ll.get(0)); PrjElement authorityCode = ll.get(1); String code ; if(authorityCode instanceof PrjNumberElement){ code = String.valueOf(Math.round(getNumber(authorityCode))); } else{ code = getString(authorityCode); } return auth + ':' + code; }
/** * 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); } } }
/** * 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 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); } }
String datum = getString(ll.get(0)); String datm = PrjValueParameters.DATUMNAMES.get(datum.toLowerCase() .replaceAll("^d_","")