Package ca.carleton.gcrc.geom

Examples of ca.carleton.gcrc.geom.MultiPoint


      // data and none is defined in the document
      if( exifData.containsLongLat()
       && false == docDescriptor.isGeometryDescriptionAvailable() ) {
       
        Point point = new Point(exifData.computeLong(),exifData.computeLat());
        MultiPoint mp = new MultiPoint();
        mp.addPoint(point);
       
        GeometryDescriptor geomDesc = docDescriptor.getGeometryDescription();
        geomDesc.setGeometry(mp);
      }
    }
View Full Code Here


      // data and none is defined in the document
      if( exifData.containsLongLat()
       && false == conversionContext.isGeometryDescriptionAvailable() ) {
       
        Point point = new Point(exifData.computeLong(),exifData.computeLat());
        MultiPoint mp = new MultiPoint();
        mp.addPoint(point);
       
        GeometryDescriptor geomDesc = conversionContext.getGeometryDescription();
        geomDesc.setGeometry(mp);
      }
    }
View Full Code Here

   
    return polygon;
  }
 
  private MultiPoint parseMultiPoint(BufferedReader br) throws Exception {
    MultiPoint multiPoint = new MultiPoint();
   
    skipWhiteSpaces(br);
    popLeftParen(br);
   
    boolean done = false;
    do {
      skipWhiteSpaces(br);
      if( checkForLeftParen(br) ) {
        Point point = parsePoint(br);
        multiPoint.addPoint(point);
      } else {
        List<Number> positions = parsePositions(br);
        if( positions.size() < 2 ){
          throw new Exception("A point must have 2 or more positions");
        }

        Point point = new Point(positions);
        multiPoint.addPoint(point);
      }

      if( checkForRightParen(br) ) {
        done = true;
      } else {
View Full Code Here

      JSONArray points = geometryObj.getJSONArray("coordinates");
      if( null == points ) {
        throw new Exception("A geometry must contain an array called 'coordinates'");
      }
     
      MultiPoint multiPoint = new MultiPoint();
     
      for(int pointIndex=0,pointEnd=points.length(); pointIndex<pointEnd; ++pointIndex){
        JSONArray coordinates = points.getJSONArray(pointIndex);
        Point point = new Point();
        for(int coordIndex=0,coordEnd=coordinates.length(); coordIndex<coordEnd; ++coordIndex){
          double position = coordinates.getDouble(coordIndex);
          point.addPosition(position);
        }
        multiPoint.addPoint(point);
      }
     
      return multiPoint;
     
    } catch(Exception e) {
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.geom.MultiPoint

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.