45                         SAXParser parser=SAXParserFactory.newInstance().newSAXParser();
 
   46                         InputStream stream = 
new ByteArrayInputStream(geometryLiteral.getBytes(StandardCharsets.UTF_8));
 
   47                         GPXHandler handler=
new GPXHandler();
 
   48                         parser.parse(stream, handler);
 
   49                         GeometryFactory fac=
new GeometryFactory();
 
   50                         if(handler.coordinates.size()==1 && handler.coordinates.get(0).size()==1) {
 
   51                                 return fac.createPoint(handler.coordinates.get(0).get(0));
 
   53                         if(handler.coordinates.size()==1 && handler.coordinates.get(0).size()>1) {
 
   54                                 return fac.createLineString(handler.coordinates.get(0).toArray(
new Coordinate[0]));
 
   59                 } 
catch (SAXException | IOException | ParserConfigurationException e) {
 
   60                         throw new AssertionError(
"There was an error parsing GPXLiteral: " + geometryLiteral);
 
   62                 throw new AssertionError(
"Error parsing GPXLiteral: " + geometryLiteral);