/** * Instances which have same name, authority and parameters are equal. */ public boolean equals(Object oo) { if (this == oo) return true; if (!(oo instanceof CoordinateTransform)) return false; CoordinateTransform o = (CoordinateTransform) oo; if (!getName().equals(o.getName())) return false; if (!getAuthority().equals(o.getAuthority())) return false; if (!(getTransformType() == o.getTransformType())) return false; List<Parameter> oparams = o.getParameters(); if (params.size() != oparams.size()) return false; for (int i = 0; i < params.size(); i++) { Parameter att = params.get(i); Parameter oatt = oparams.get(i); if (!att.getName().equals(oatt.getName())) return false; //if (!att.getValue().equals(oatt.getValue())) return false; } return true; }
/** * Instances which have same name, authority and parameters are equal. */ public boolean equals(Object oo) { if (this == oo) return true; if (!(oo instanceof CoordinateTransform)) return false; CoordinateTransform o = (CoordinateTransform) oo; if (!getName().equals(o.getName())) return false; if (!getAuthority().equals(o.getAuthority())) return false; if (!(getTransformType() == o.getTransformType())) return false; List<Parameter> oparams = o.getParameters(); if (params.size() != oparams.size()) return false; for (int i = 0; i < params.size(); i++) { Parameter att = params.get(i); Parameter oatt = oparams.get(i); if (!att.getName().equals(oatt.getName())) return false; //if (!att.getValue().equals(oatt.getValue())) return false; } return true; }
/** * Instances which have same name, authority and parameters are equal. */ public boolean equals(Object oo) { if (this == oo) return true; if (!(oo instanceof CoordinateTransform)) return false; CoordinateTransform o = (CoordinateTransform) oo; if (!getName().equals(o.getName())) return false; if (!getAuthority().equals(o.getAuthority())) return false; if (!(getTransformType() == o.getTransformType())) return false; List<Parameter> oparams = o.getParameters(); if (params.size() != oparams.size()) return false; for (int i = 0; i < params.size(); i++) { Parameter att = params.get(i); Parameter oatt = oparams.get(i); if (!att.getName().equals(oatt.getName())) return false; //if (!att.getValue().equals(oatt.getValue())) return false; } return true; }
private Element writeCoordTransform(CoordinateTransform ct) { Element ctElem = new Element("coordTransform"); ctElem.setAttribute("name", ct.getName()); ctElem.setAttribute("transformType", ct.getTransformType().toString()); List params = ct.getParameters(); for (int i = 0; i < params.size(); i++) { Parameter param = (Parameter) params.get(i); Element pElem = new Element("parameter"); pElem.setAttribute("name", param.getName()); pElem.setAttribute("value", param.getStringValue()); ctElem.addContent(pElem); } return ctElem; }
private Element writeCoordTransform(CoordinateTransform ct) { Element ctElem = new Element("coordTransform"); ctElem.setAttribute("name", ct.getName()); ctElem.setAttribute("transformType", ct.getTransformType().toString()); List params = ct.getParameters(); for (int i = 0; i < params.size(); i++) { Parameter param = (Parameter) params.get(i); Element pElem = new Element("parameter"); pElem.setAttribute("name", param.getName()); pElem.setAttribute("value", param.getStringValue()); ctElem.addContent(pElem); } return ctElem; }
private Element writeCoordTransform(CoordinateTransform ct) { Element ctElem = new Element("coordTransform"); ctElem.setAttribute("name", ct.getName()); ctElem.setAttribute("transformType", ct.getTransformType().toString()); List params = ct.getParameters(); for (int i = 0; i < params.size(); i++) { Parameter param = (Parameter) params.get(i); Element pElem = new Element("parameter"); pElem.setAttribute("name", param.getName()); pElem.setAttribute("value", param.getStringValue()); ctElem.addContent(pElem); } return ctElem; }
private static CoverageTransform makeTransform(ucar.nc2.dataset.CoordinateTransform dt) { AttributeContainerHelper atts = new AttributeContainerHelper(dt.getName()); for (Parameter p : dt.getParameters()) atts.addAttribute(new Attribute(p)); return new CoverageTransform(dt.getName(), atts, dt.getTransformType() == TransformType.Projection); }
private Element makeCoordTransform( CoordinateTransform coordTransform) { Element elem = new Element("coordinateTransform", ncNS); elem.setAttribute("name", coordTransform.getName()); elem.setAttribute("authority", coordTransform.getAuthority()); if (coordTransform.getTransformType() != null) elem.setAttribute("transformType", coordTransform.getTransformType().toString()); List<Parameter> params = coordTransform.getParameters(); for (Parameter p : params) { elem.addContent(makeAttribute(p, "parameter")); } return elem; }
private Element writeCoordTransform(CoordinateTransform ct) { Element ctElem = new Element("coordTransform"); ctElem.setAttribute("name", ct.getName()); ctElem.setAttribute("transformType", ct.getTransformType().toString()); for (Parameter param : ct.getParameters()) { Element pElem = new Element("parameter"); pElem.setAttribute("name", param.getName()); pElem.setAttribute("value", param.getStringValue()); ctElem.addContent(pElem); } return ctElem; }
private Element makeCoordTransform( CoordinateTransform coordTransform) { Element elem = new Element("coordinateTransform", ncNS); elem.setAttribute("name", coordTransform.getName()); elem.setAttribute("authority", coordTransform.getAuthority()); if (coordTransform.getTransformType() != null) elem.setAttribute("transformType", coordTransform.getTransformType().toString()); List<Parameter> params = coordTransform.getParameters(); for (Parameter p : params) { elem.addContent(makeAttribute(p, "parameter")); } return elem; }
private Element makeCoordTransform( CoordinateTransform coordTransform) { Element elem = new Element("coordinateTransform", thredds.client.catalog.Catalog.ncmlNS); elem.setAttribute("name", coordTransform.getName()); elem.setAttribute("authority", coordTransform.getAuthority()); if (coordTransform.getTransformType() != null) elem.setAttribute("transformType", coordTransform.getTransformType().toString()); List<Parameter> params = coordTransform.getParameters(); for (Parameter p : params) { elem.addContent(makeAttribute(p, "parameter")); } return elem; }
private Element writeCoordTransform(CoordinateTransform ct) { Element ctElem = new Element("coordTransform"); ctElem.setAttribute("name", ct.getName()); ctElem.setAttribute("transformType", ct.getTransformType().toString()); for (Parameter param : ct.getParameters()) { Element pElem = new Element("parameter"); pElem.setAttribute("name", param.getName()); pElem.setAttribute("value", param.getStringValue()); ctElem.addContent(pElem); } return ctElem; }
private Element writeCoordTransform(CoordinateTransform ct) { Element ctElem = new Element("coordTransform"); ctElem.setAttribute("name", ct.getName()); ctElem.setAttribute("transformType", ct.getTransformType().toString()); for (Parameter param : ct.getParameters()) { Element pElem = new Element("parameter"); pElem.setAttribute("name", param.getName()); pElem.setAttribute("value", param.getStringValue()); ctElem.addContent(pElem); } return ctElem; }
/** * Create a "dummy" Coordinate Transform Variable based on the given CoordinateTransform. * This creates a scalar Variable with dummy data, and adds the Parameters of the CoordinateTransform * as attributes. * @param ds for this dataset * @param ct based on the CoordinateTransform * @return the Coordinate Transform Variable. You must add it to the dataset. */ static public VariableDS makeDummyTransformVariable(NetcdfDataset ds, CoordinateTransform ct) { VariableDS v = new VariableDS( ds, null, null, ct.getName(), DataType.CHAR, "", null, null); List<Parameter> params = ct.getParameters(); for (Parameter p : params) { if (p.isString()) v.addAttribute(new Attribute(p.getName(), p.getStringValue())); else { double[] data = p.getNumericValues(); Array dataA = Array.factory(DataType.DOUBLE, new int[]{data.length}, data); v.addAttribute(new Attribute(p.getName(), dataA)); } } v.addAttribute( new Attribute(_Coordinate.TransformType, ct.getTransformType().toString())); // fake data Array data = Array.factory(DataType.CHAR, new int[] {}, new char[] {' '}); v.setCachedData(data, true); return v; }
/** * Create a "dummy" Coordinate Transform Variable based on the given CoordinateTransform. * This creates a scalar Variable with dummy data, and adds the Parameters of the CoordinateTransform * as attributes. * @param ds for this dataset * @param ct based on the CoordinateTransform * @return the Coordinate Transform Variable. You must add it to the dataset. */ static public VariableDS makeDummyTransformVariable(NetcdfDataset ds, CoordinateTransform ct) { VariableDS v = new VariableDS( ds, null, null, ct.getName(), DataType.CHAR, "", null, null); List<Parameter> params = ct.getParameters(); for (Parameter p : params) { if (p.isString()) v.addAttribute(new Attribute(p.getName(), p.getStringValue())); else { double[] data = p.getNumericValues(); Array dataA = Array.factory(double.class, new int[]{data.length}, data); v.addAttribute(new Attribute(p.getName(), dataA)); } } v.addAttribute( new Attribute(_Coordinate.TransformType, ct.getTransformType().toString())); // fake data Array data = Array.factory(DataType.CHAR.getPrimitiveClassType(), new int[] {}, new char[] {' '}); v.setCachedData(data, true); return v; }
/** * Create a "dummy" Coordinate Transform Variable based on the given CoordinateTransform. * This creates a scalar Variable with dummy data, and adds the Parameters of the CoordinateTransform * as attributes. * @param ds for this dataset * @param ct based on the CoordinateTransform * @return the Coordinate Transform Variable. You must add it to the dataset. */ static public VariableDS makeDummyTransformVariable(NetcdfDataset ds, CoordinateTransform ct) { VariableDS v = new VariableDS( ds, null, null, ct.getName(), DataType.CHAR, "", null, null); List<Parameter> params = ct.getParameters(); for (Parameter p : params) { if (p.isString()) v.addAttribute(new Attribute(p.getName(), p.getStringValue())); else { double[] data = p.getNumericValues(); Array dataA = Array.factory(double.class, new int[]{data.length}, data); v.addAttribute(new Attribute(p.getName(), dataA)); } } v.addAttribute( new Attribute(_Coordinate.TransformType, ct.getTransformType().toString())); // fake data Array data = Array.factory(DataType.CHAR.getPrimitiveClassType(), new int[] {}, new char[] {' '}); v.setCachedData(data, true); return v; }
List<Parameter> params = ct.getParameters(); for (Parameter pp : params) { Element ppElem = new Element("param");
List<Parameter> params = ct.getParameters(); for (Parameter pp : params) { Element ppElem = new Element("param");
List<Parameter> params = ct.getParameters(); for (Parameter pp : params) { Element ppElem = new Element("param");