com.vividsolutions.jts.io.ParseException.getMessage()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中com.vividsolutions.jts.io.ParseException.getMessage()方法的一些代码示例,展示了ParseException.getMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ParseException.getMessage()方法的具体详情如下:
包路径:com.vividsolutions.jts.io.ParseException
类名称:ParseException
方法名:getMessage

ParseException.getMessage介绍

暂无

代码示例

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis

private Geometry readTextObject() throws IOException {
 try {
  mifText_ = mif_.getToken(' ', true, true);
 } catch (final ParseException e) {
  throw new IOException(e.getMessage());
 }
 final Coordinate c1 = readMIFCoordinate();
 final Coordinate c2 = readMIFCoordinate();
 final Coordinate p = new Coordinate((c1.x + c2.x) / 2, (c1.y + c2.y) / 2);
 return geomFactory_.createPoint(p);
}

代码示例来源:origin: org.n52.epos/epos-transform-om

@Override
public void parseValue(XmlObject value, MapEposEvent result) {
  Geometry geom;
  try {
    geom = GMLGeometryFactory.parseGeometry(value);
  } catch (ParseException e) {
    logger.warn(e.getMessage(), e);
    return;
  }
  if (geom != null) {
    result.put(MapEposEvent.GEOMETRY_KEY, geom);
  }
}

代码示例来源:origin: org.geotools/gt-mif

private Geometry readTextObject() throws IOException {
    try {
      mifText = mif.getToken(' ', true, true);
    } catch (ParseException e) {
      throw new IOException(e.getMessage());
    }
    Coordinate c1 = readMIFCoordinate();
    Coordinate c2 = readMIFCoordinate();
    Coordinate p = new Coordinate((c1.x + c2.x) / 2, (c1.y + c2.y) / 2);
    return geomFactory.createPoint(p);
  }
}

代码示例来源:origin: org.n52.epos/epos-pattern-util

private static Geometry extractGeometry(Object g0) {
  if (g0 instanceof Geometry) {
    //geometry given -> cast
    return (Geometry) g0;
  }
  else {
    //parse string
    WKTReader r = new WKTReader();
    try {
      return r.read(g0.toString());
    }
    catch (ParseException e) {
      logger.warn(e.getMessage(), e);
    }
  }
  return null;
}

代码示例来源:origin: org.n52.wps/52n-wps-io-impl

@Override
public JTSGeometryBinding parse(InputStream input, String mimeType, String schema) {
  
  try {
    Geometry g = new WKTReader().read(new InputStreamReader(input));	
    
    return new JTSGeometryBinding(g);
    
  } catch (ParseException e) {
    LOGGER.error(e.getMessage(), e);
  }finally{
    try {
      input.close();
    } catch (IOException e) {
      LOGGER.error(e.getMessage(), e);
    }
  }
  
  return null;
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis

throw new IOException(_evt.getMessage());

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis

public FeatureCollection open(final InputStream _in) throws IOException{
 if (gmlInput_ == null) {
  return null;
 }
 try {
  final InputStreamReader inputStreamReader = new InputStreamReader(_in, CtuluLibFile.getUTF8Charset());
  return read(new BufferedReader(inputStreamReader), "inputStream");
 } catch (final ParseException _evt) {
  FuLog.error(_evt);
  throw new IOException(_evt.getMessage());
 } catch (final SchemaException _evt) {
  FuLog.error(_evt);
  throw new IOException(_evt.getMessage());
 } finally {}
}

代码示例来源:origin: org.n52.epos/epos-pattern-eml

logger.warn(e.getMessage(), e);

代码示例来源:origin: org.n52.epos/epos-pattern-eml

geom = GMLGeometryFactory.parseGeometry(children[0]);
} catch (ParseException e) {
  logger.warn(e.getMessage(), e);

代码示例来源:origin: org.n52.wps/52n-wps-io-geotools

"An error has occurred while accessing provided data", e);
} catch (ParseException e) {
  LOGGER.error(e.getMessage(), e);
  throw new RuntimeException(
      "An error has occurred while accessing provided data", e);

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis

public GMLInputTemplate getInputTemplate(final InputStream _f) throws IOException {
 InputStreamReader inputStreamReader = null;
 try {
  inputStreamReader = new InputStreamReader(_f, CtuluLibFile.getUTF8Charset());
  return inputTemplate(inputStreamReader);
 } catch (final IOException _evt) {
  FuLog.error(_evt);
  throw _evt;
 } catch (final ParseException _evt) {
  FuLog.error(_evt);
  throw new IOException(_evt.getMessage());
 } catch (final SAXException _evt) {
  FuLog.error(_evt);
  throw new IOException(_evt.getMessage());
 } catch (final ParserConfigurationException _evt) {
  FuLog.error(_evt);
  throw new IOException(_evt.getMessage());
 } finally {
  // if (inputStreamReader != null) inputStreamReader.close();
 }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis

public FeatureCollection open(final File _f) throws IOException {
 final GMLInputTemplate input = getInputTemplate(_f);
 if (input == null) {
  return null;
 }
 setInputTemplate(input);
 InputStreamReader inputStreamReader = null;
 try {
  inputStreamReader = new InputStreamReader(getInputStream(_f), CtuluLibFile.getUTF8Charset());
  return read(new BufferedReader(inputStreamReader), _f.getName());
 } catch (final ParseException _evt) {
  FuLog.error(_evt);
  throw new IOException(_evt.getMessage());
 } catch (final SchemaException _evt) {
  FuLog.error(_evt);
  throw new IOException(_evt.getMessage());
 } finally {
  if (inputStreamReader != null) {
   inputStreamReader.close();
  }
 }
}

代码示例来源:origin: net.di2e.ecdr.libs/cdr-rest-search-commons

@Override
public T intersects( String propertyName, String wkt ) {
  logEntry( "intersects", propertyName, wkt );
  boolean isBbox = false;
  try {
    WKTReader reader = new WKTReader();
    isBbox = reader.read( wkt ).isRectangle();
  } catch ( ParseException e ) {
    LOGGER.warn( "WKT could not be parsed into geometry object [{}]: " + e.getMessage() );
  }
  return callHandleGeoMethod( propertyName, wkt, null, isBbox ? GeospatialFilterOptions.BBOX : GeospatialFilterOptions.INTERSECTS, null );
}

代码示例来源:origin: org.geotools/gt2-main

org.opengis.filter.expression.Literal geometry(Token start, Token end)
    throws ExpressionException {
  if (reader == null)
    reader = new WKTReader();
  try {
    Geometry g = reader.read(input.substring(start.beginColumn - 1,end.endColumn));
    return factory.literal(g);
  } catch (com.vividsolutions.jts.io.ParseException e) {
    throw new ExpressionException(e.getMessage(),start);
  } catch (Exception e) {
    throw new ExpressionException("Error building WKT Geometry",start,e);
  }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis

private void initRead() throws IOException {
 if (!init_) {
  init_ = true;
  try {
   final GMLReader reader = new GMLReader();
   final FeatureCollection collection = reader.open(f_);
   if (collection != null) {
    it_ = collection.features();
   } else {
    it_ = null;
   }
   type_ = reader.gmlInput_.toFeatureSchema();
  } catch (final SAXException _evt) {
   FuLog.error(_evt);
   throw new IOException(_evt.getMessage());
  } catch (final ParseException _evt) {
   FuLog.error(_evt);
   throw new IOException(_evt.getMessage());
  } catch (final SchemaException _evt) {
   FuLog.error(_evt);
   throw new IOException(_evt.getMessage());
  }
 }
}

代码示例来源:origin: org.geotools/gt-cql

/**
 * Builds geometry
 * 
 * @param geometry
 * @return a geometry
 * @throws CQLException
 */
public Literal buildGeometry(final IToken geometry) throws CQLException {
  try {
    String wktGeom = scanExpression(geometry);
    // transforms wkt to vividsolution geometry
    String vividGeom = transformWKTGeometry(wktGeom);
    WKTReader reader = new WKTReader();
    Geometry g = reader.read(vividGeom);
    Literal literal = filterFactory.literal(g);
    return literal;
  } catch (com.vividsolutions.jts.io.ParseException e) {
    throw new CQLException(e.getMessage(), geometry, e, this.cqlSource);
  } catch (Exception e) {
    throw new CQLException("Error building WKT Geometry: " + e.getMessage(),geometry, e, this.cqlSource);
  }
}

代码示例来源:origin: org.geotools/gt2-cql

/**
 * Builds geometry
 * 
 * @param geometry
 * @return a geometry
 * @throws CQLException
 */
private Literal buildGeometry(final Token geometry) throws CQLException {
  try {
    String wktGeom = scanExpression(geometry);
    // transforms wkt to vividsolution geometry
    String vividGeom = transformWKTGeometry(wktGeom);
    Geometry g = WKT_READER.read(vividGeom);
    Literal literal = filterFactory.literal(g);
    return literal;
  } catch (com.vividsolutions.jts.io.ParseException e) {
    throw new CQLException(e.getMessage(), geometry, this.cqlSource);
  } catch (Exception e) {
    throw new CQLException("Error building WKT Geometry", geometry, e, this.cqlSource);
  }
}

代码示例来源:origin: nl.cloudfarming.client/planning-tactical

@Override
public void save(WizardDescriptor wizardDescriptor) {
  Operation operation;
    try {
      operation = saveWizardContent(wizardDescriptor);
      planningEventProducer.triggerEvent(new OperationPlanEvent(operation, PlanEventKey.NEW_OPERATION));
    } catch (RemedyNotFoundException ex) {
      LOG.error(ex.getMessage(), ex);
    } catch (ProductionUnitNotFoundException ex) {
      LOG.error(ex.getMessage(), ex);
    } catch (ParseException ex) {
      LOG.error(ex.getMessage(), ex);
    }
}

代码示例来源:origin: deegree/deegree3

ir.addPreparedArgument( new SQLIdentifier( slot.getColumn() ), wkt, sb.toString() );
} catch ( ParseException e ) {
  String msg = "Could not write as WKB " + geom + ": " + e.getMessage();
  LOG.debug( msg, e );
  throw new IllegalArgumentException();

代码示例来源:origin: net.di2e.ecdr.libs/cdr-rest-search-commons

LOGGER.warn( "WKT could not be parsed into a [{}] object wkt=[{}]: [{}]", supportedGeoOptions, wkt, e.getMessage() );

相关文章