Package ca.carleton.gcrc.geom

Examples of ca.carleton.gcrc.geom.MultiLineString


   
    return multiPoint;
  }
 
  private MultiLineString parseMultiLineString(BufferedReader br) throws Exception {
    MultiLineString multiLineString = new MultiLineString();
   
    skipWhiteSpaces(br);
    popLeftParen(br);
   
    boolean done = false;
    do {
      skipWhiteSpaces(br);

      LineString lineString = parseLineString(br);
      multiLineString.addLineString(lineString);

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


      JSONArray lineStrings = geometryObj.getJSONArray("coordinates");
      if( null == lineStrings ) {
        throw new Exception("A geometry must contain an array called 'coordinates'");
      }
     
      MultiLineString multiLineString = new MultiLineString();
     
      for(int lsIndex=0,lsEnd=lineStrings.length(); lsIndex<lsEnd; ++lsIndex){
        JSONArray points = lineStrings.getJSONArray(lsIndex);
        LineString lineString = new LineString();
     
        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);
          }
          lineString.addPoint(point);
        }
       
        multiLineString.addLineString(lineString);
      }
     
      return multiLineString;
     
    } catch(Exception e) {
View Full Code Here

TOP

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

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.