本文整理了Java中com.vividsolutions.jts.io.ParseException.<init>()
方法的一些代码示例,展示了ParseException.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ParseException.<init>()
方法的具体详情如下:
包路径:com.vividsolutions.jts.io.ParseException
类名称:ParseException
方法名:<init>
[英]Creates a ParseException
with e
s detail message.
[中]使用e
的详细信息创建ParseException
。
代码示例来源:origin: com.vividsolutions/jts
private void parseErrorWithLine(String msg)
throws ParseException
{
throw new ParseException(msg + " (line " + tokenizer.lineno() + ")");
}
代码示例来源:origin: com.vividsolutions/jts
/**
* Reads a Well-Known Text representation of a {@link Geometry}
* from a {@link Reader}.
*
*@param reader a Reader which will return a <Geometry Tagged Text>
* string (see the OpenGIS Simple Features Specification)
*@return a <code>Geometry</code> read from <code>reader</code>
*@throws ParseException if a parsing problem occurs
*/
public Geometry read(Reader reader) throws ParseException {
tokenizer = new StreamTokenizer(reader);
// set tokenizer to NOT parse numbers
tokenizer.resetSyntax();
tokenizer.wordChars('a', 'z');
tokenizer.wordChars('A', 'Z');
tokenizer.wordChars(128 + 32, 255);
tokenizer.wordChars('0', '9');
tokenizer.wordChars('-', '-');
tokenizer.wordChars('+', '+');
tokenizer.wordChars('.', '.');
tokenizer.whitespaceChars(0, ' ');
tokenizer.commentChar('#');
try {
return readGeometryTaggedText();
}
catch (IOException e) {
throw new ParseException(e.toString());
}
}
代码示例来源:origin: com.vividsolutions/jts
private MultiLineString readMultiLineString() throws IOException, ParseException
{
int numGeom = dis.readInt();
LineString[] geoms = new LineString[numGeom];
for (int i = 0; i < numGeom; i++) {
Geometry g = readGeometry();
if (! (g instanceof LineString))
throw new ParseException(INVALID_GEOM_TYPE_MSG + "MultiLineString");
geoms[i] = (LineString) g;
}
return factory.createMultiLineString(geoms);
}
代码示例来源:origin: com.vividsolutions/jts
private MultiPoint readMultiPoint() throws IOException, ParseException
{
int numGeom = dis.readInt();
Point[] geoms = new Point[numGeom];
for (int i = 0; i < numGeom; i++) {
Geometry g = readGeometry();
if (! (g instanceof Point))
throw new ParseException(INVALID_GEOM_TYPE_MSG + "MultiPoint");
geoms[i] = (Point) g;
}
return factory.createMultiPoint(geoms);
}
代码示例来源:origin: com.vividsolutions/jts
private MultiPolygon readMultiPolygon() throws IOException, ParseException
{
int numGeom = dis.readInt();
Polygon[] geoms = new Polygon[numGeom];
for (int i = 0; i < numGeom; i++) {
Geometry g = readGeometry();
if (! (g instanceof Polygon))
throw new ParseException(INVALID_GEOM_TYPE_MSG + "MultiPolygon");
geoms[i] = (Polygon) g;
}
return factory.createMultiPolygon(geoms);
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis
/**
* Get the name of the FeatureElement tag.
*/
public String getFeatureElementName() throws ParseException {
if (loaded_) {
return featureTag_;
}
throw new ParseException("requested FeatureCollectionElementName w/o loading the template");
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis
/**
* Get the name of the FeatureCollectionElement tag.
*/
public String getFeatureCollectionElementName() throws ParseException {
if (loaded_) {
return collectionTag_;
}
throw new ParseException("requested FeatureCollectionElementName w/o loading the template");
}
代码示例来源:origin: org.gvnix/org.gvnix.jpa.geo
/**
* m-values sicherstellen
*
* @throws ParseException
*/
private void setHasM(boolean hasM) throws ParseException {
if (this.hasM == null) {
this.hasM = hasM;
}
else if (this.hasM != hasM) {
throw new ParseException("Inkonsistent use of m-values.");
}
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis
/**
* Returns the column name for the 'index'th column.
*
* @param _index 0=first
*/
public String columnName(final int _index) throws ParseException {
if (loaded_) {
return ((ColumnDescription) columnDefinitions_.get(_index)).columnName_;
}
throw new ParseException("requested columnName w/o loading the template");
}
代码示例来源:origin: com.vividsolutions/jts-core
private void parseErrorWithLine(String msg)
throws ParseException
{
throw new ParseException(msg + " (line " + tokenizer.lineno() + ")");
}
代码示例来源:origin: deegree/deegree3
public Geometry read( Reader reader )
throws ParseException {
try {
return read( IOUtils.toString( reader ) );
} catch ( IOException e ) {
// wrap the exception nicely as to not break 172643521 API calls
throw new ParseException( e );
}
}
代码示例来源:origin: com.vividsolutions/jts
break;
default:
throw new ParseException("Unknown WKB type " + geometryType);
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis
private GMLInputTemplate inputTemplate(final java.io.Reader _r) throws IOException, ParseException, SAXException,
ParserConfigurationException {
final GMLInputTemplate gmlTemplate = new GMLInputTemplate();
gmlTemplate.load(_r);
_r.close();
if (!(gmlTemplate.loaded_)) {
throw new ParseException("Failed to load GML input template");
}
return gmlTemplate;
}
代码示例来源:origin: com.vividsolutions/jts-core
private MultiPolygon readMultiPolygon() throws IOException, ParseException
{
int numGeom = dis.readInt();
Polygon[] geoms = new Polygon[numGeom];
for (int i = 0; i < numGeom; i++) {
Geometry g = readGeometry();
if (! (g instanceof Polygon))
throw new ParseException(INVALID_GEOM_TYPE_MSG + "MultiPolygon");
geoms[i] = (Polygon) g;
}
return factory.createMultiPolygon(geoms);
}
代码示例来源:origin: org.geotools.jdbc/gt-jdbc-db2
private MultiPoint readMultiPoint() throws IOException, ParseException
{
int numGeom = dis.readInt();
Point[] geoms = new Point[numGeom];
for (int i = 0; i < numGeom; i++) {
Geometry g = readGeometry();
if (! (g instanceof Point))
throw new ParseException(INVALID_GEOM_TYPE_MSG + "MultiPoint");
geoms[i] = (Point) g;
}
return factory.createMultiPoint(geoms);
}
代码示例来源:origin: org.geotools.jdbc/gt-jdbc-db2
private MultiLineString readMultiLineString() throws IOException, ParseException
{
int numGeom = dis.readInt();
LineString[] geoms = new LineString[numGeom];
for (int i = 0; i < numGeom; i++) {
Geometry g = readGeometry();
if (! (g instanceof LineString))
throw new ParseException(INVALID_GEOM_TYPE_MSG + "MultiLineString");
geoms[i] = (LineString) g;
}
return factory.createMultiLineString(geoms);
}
代码示例来源:origin: com.vividsolutions/jts-core
private MultiPoint readMultiPoint() throws IOException, ParseException
{
int numGeom = dis.readInt();
Point[] geoms = new Point[numGeom];
for (int i = 0; i < numGeom; i++) {
Geometry g = readGeometry();
if (! (g instanceof Point))
throw new ParseException(INVALID_GEOM_TYPE_MSG + "MultiPoint");
geoms[i] = (Point) g;
}
return factory.createMultiPoint(geoms);
}
代码示例来源:origin: com.vividsolutions/jts-core
private MultiLineString readMultiLineString() throws IOException, ParseException
{
int numGeom = dis.readInt();
LineString[] geoms = new LineString[numGeom];
for (int i = 0; i < numGeom; i++) {
Geometry g = readGeometry();
if (! (g instanceof LineString))
throw new ParseException(INVALID_GEOM_TYPE_MSG + "MultiLineString");
geoms[i] = (LineString) g;
}
return factory.createMultiLineString(geoms);
}
代码示例来源:origin: org.geotools.jdbc/gt-jdbc-db2
private MultiPolygon readMultiPolygon() throws IOException, ParseException
{
int numGeom = dis.readInt();
Polygon[] geoms = new Polygon[numGeom];
for (int i = 0; i < numGeom; i++) {
Geometry g = readGeometry();
if (! (g instanceof Polygon))
throw new ParseException(INVALID_GEOM_TYPE_MSG + "MultiPolygon");
geoms[i] = (Polygon) g;
}
return factory.createMultiPolygon(geoms);
}
代码示例来源:origin: deegree/deegree3
public Geometry read( String wkt )
throws ParseException {
try {
org.postgis.Geometry g = org.postgis.PGgeometry.geomFromString( wkt );
byte[] bs = new BinaryWriter().writeBinary( g );
return WKBReader.read( bs, crs );
} catch ( SQLException e ) {
e.printStackTrace();
// wrap the exception nicely as to not break 172643521 API calls
throw new ParseException( e );
}
}
内容来源于网络,如有侵权,请联系作者删除!