Package com.vividsolutions.jts.io

Examples of com.vividsolutions.jts.io.ParseException


        case DB2WKBConstants.wkbMultiPolygon2D :
          return readMultiPolygon();
        case DB2WKBConstants.wkbGeomCollection2D :
          return readGeometryCollection();
      }
      throw new ParseException("Unknown WKB type " + geometryType);
      //return null;
    }
View Full Code Here


      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);
    }
View Full Code Here

      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);
    }
View Full Code Here

      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);
    }
View Full Code Here

        tokenizer.commentChar('#');

        try {
            return readGeometryTaggedText();
        } catch (IOException e) {
            throw new ParseException(e.toString());
        }
    }
View Full Code Here

                return Double.NaN;
            } else {
                try {
                    return Double.parseDouble(tokenizer.sval);
                } catch (NumberFormatException ex) {
                    throw new ParseException("Invalid number: " + tokenizer.sval);
                }
            }
        }
        }
        parseError("number");
View Full Code Here

            Assert.shouldNeverReachHere("Unexpected NUMBER token");
        if (tokenizer.ttype == StreamTokenizer.TT_EOL)
            Assert.shouldNeverReachHere("Unexpected EOL token");

        String tokenStr = tokenString();
        throw new ParseException("Expected " + expected + " but found " + tokenStr);
    }
View Full Code Here

        } else if (type.equalsIgnoreCase("COMPOUNDCURVE")) {
            return readCompoundCurveText();
        } else if (type.equalsIgnoreCase("CURVEPOLYGON")) {
            return readCurvePolygonText();
        }
        throw new ParseException("Unknown geometry type: " + type);
    }
View Full Code Here

    private LineString readCircularStringText() throws IOException, ParseException {
        List<Coordinate> coordinates = getCoordinateList( true );
        if (coordinates.size() == 0) {
            return geometryFactory.createLineString(new Coordinate[0]);
        } else if (coordinates.size() < 3) {
            throw new ParseException("A CIRCULARSTRING must contain at least 3 control points");
        } else {
            double[] controlPoints = toControlPoints(coordinates);
            return geometryFactory.createCurvedGeometry(2, controlPoints);
        }
    }
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.io.ParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.