Object go = ((Property) defaultGeometry).getValue();
if (go instanceof MultiLineString) {
int nrls = ((MultiLineString) go).getNumGeometries();
for (int li = 0; li < nrls; li++) {
Geometry ls = ((MultiLineString) go).getGeometryN(li);
RteType rte = toRte((LineString) ls);
if (nameStr != null)
rte.setName(nameStr);
if (commentStr != null)
rte.setCmt(commentStr);
if (descriptionStr != null)
rte.setDesc(descriptionStr);
gpxType.getRte().add(rte);
}
} else if (go instanceof LineString) {
RteType rte = toRte((LineString) go);
if (nameStr != null)
rte.setName(nameStr);
if (commentStr != null)
rte.setCmt(commentStr);
if (descriptionStr != null)
rte.setDesc(descriptionStr);
gpxType.getRte().add(rte);
} else if (go instanceof MultiPoint) {
int nrpt = ((MultiPoint) go).getNumGeometries();
for (int pi = 0; pi < nrpt; pi++) {
Geometry pt = ((MultiPoint) go).getGeometryN(pi);