Package ca.carleton.gcrc.geom

Examples of ca.carleton.gcrc.geom.Geometry


           
            if( JSONSupport.containsKey(jsonDoc, "nunaliit_geom") ) {
              JSONObject jsonGeom = jsonDoc.getJSONObject("nunaliit_geom");
              String wkt = jsonGeom.optString("wkt", null);
              if( null != wkt ){
                Geometry geometry = wktParser.parseWkt(wkt);
                jsonWriter.key("geometry");
                geoWriter.writeGeometry(jsonWriter, geometry);
              }
            }
           
View Full Code Here


        // BBOX
        {
          boolean include = false;
          BoundingBox boundingBox = new BoundingBox();
          for(GeoJsonFeature feature : features){
            Geometry geometry = feature.getGeometry();
            if( null != geometry ){
              geometry.extendBoundingBox(boundingBox);
              include = true;
            }
          }
          if( include ){
            JSONArray bbox = new JSONArray();
View Full Code Here

    // Last Updated
    obj.put("nunaliit_last_updated", approvedContext.getLastUpdatedObject());
   
    // Geometry
    {
      Geometry geometry = feature.getGeometry();
      if( null != geometry ) {
        // WKT
        StringWriter wkt = new StringWriter();
        wktWriter.write(geometry, wkt);
       
        // Bounding box
        BoundingBox bb = geometry.getBoundingBox();
        JSONArray bbox = new JSONArray();
        bbox.put( bb.getMinX() );
        bbox.put( bb.getMinY() );
        bbox.put( bb.getMaxX() );
        bbox.put( bb.getMaxY() );
View Full Code Here

        // BBOX
        {
          boolean include = false;
          BoundingBox boundingBox = new BoundingBox();
          for(GeoJsonFeature feature : features){
            Geometry geometry = feature.getGeometry();
            if( null != geometry ){
              geometry.extendBoundingBox(boundingBox);
              include = true;
            }
          }
          if( include ){
            JSONArray bbox = new JSONArray();
View Full Code Here

    // Last Updated
    obj.put("nunaliit_last_updated", docDescriptor.getLastUpdatedObject().toJson());
   
    // Geometry
    {
      Geometry geometry = feature.getGeometry();
      if( null != geometry ) {
        // WKT
        StringWriter wkt = new StringWriter();
        wktWriter.write(geometry, wkt);
       
        // Bounding box
        BoundingBox bb = geometry.getBoundingBox();
        JSONArray bbox = new JSONArray();
        bbox.put( bb.getMinX() );
        bbox.put( bb.getMinY() );
        bbox.put( bb.getMaxX() );
        bbox.put( bb.getMaxY() );
View Full Code Here

        // BBOX
        {
          boolean include = false;
          BoundingBox boundingBox = new BoundingBox();
          for(GeoJsonFeature feature : features){
            Geometry geometry = feature.getGeometry();
            if( null != geometry ){
              geometry.extendBoundingBox(boundingBox);
              include = true;
            }
          }
          if( include ){
            JSONArray bbox = new JSONArray();
View Full Code Here

    // Last Updated
    obj.put("nunaliit_last_updated", approvedContext.getLastUpdatedObject().toJson());
   
    // Geometry
    {
      Geometry geometry = feature.getGeometry();
      if( null != geometry ) {
        // WKT
        StringWriter wkt = new StringWriter();
        wktWriter.write(geometry, wkt);
       
        // Bounding box
        BoundingBox bb = geometry.getBoundingBox();
        JSONArray bbox = new JSONArray();
        bbox.put( bb.getMinX() );
        bbox.put( bb.getMinY() );
        bbox.put( bb.getMaxX() );
        bbox.put( bb.getMaxY() );
View Full Code Here

    return parseGeometry(bufReader);
  }
 
  private Geometry parseGeometry(BufferedReader bufReader) throws Exception {
   
    Geometry geometry = null;
    try {
      skipWhiteSpaces(bufReader);
      String identifier = readIdentifier(bufReader);
     
      if( "point".equalsIgnoreCase(identifier) ) {
View Full Code Here

   
    boolean done = false;
    do {
      skipWhiteSpaces(br);

      Geometry geometry = parseGeometry(br);
      geometryCollection.addGeometry(geometry);

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

      // Check object "geometry"
      JSONObject geometryObj = featureObj.getJSONObject("geometry");
      if( null == geometryObj ) {
        throw new Exception("Features should contain an object called 'geometry'");
      }
      Geometry geom = null;
      try {
        geom = parseGeometry(geometryObj);
      } catch(Exception e) {
        throw new Exception("Error while parsing feature geometry", e);
      }
View Full Code Here

TOP

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

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.