Package ca.carleton.gcrc.geom

Examples of ca.carleton.gcrc.geom.Geometry


     
      GeometryCollection geometryCollection = new GeometryCollection();
     
      for(int i=0,e=geometries.length(); i<e; ++i){
        JSONObject gObj = geometries.getJSONObject(i);
        Geometry g = parseGeometry(gObj);
        geometryCollection.addGeometry(g);
      }
     
      return geometryCollection;
     
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

           
            if( containsGeometry ) {
              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

  public boolean accepts(Document doc) throws Exception {
    if( filterType == Filter.ALL ) {
      return true;
    }
   
    Geometry geometry = null;
    try {
      JSONObject jsonDoc = doc.getJSONObject();
      if( JSONSupport.containsKey(jsonDoc, "nunaliit_geom") ) {
        JSONObject jsonGeom = jsonDoc.getJSONObject("nunaliit_geom");
        String wkt = jsonGeom.optString("wkt", null);
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.