Examples of GeoObject


Examples of org.geoscript.js.GeoObject

     * @param funObj
     * @return
     */
    public static Object write(Context cx, Scriptable thisObj,
            Object[] args, Function funObj) {
        GeoObject geo = null;
        if (args.length == 1) {
            Object geoObj = args[0];
            if (geoObj instanceof GeoObject) {
                geo = (GeoObject) geoObj;
            }
        }
        if (geo == null) {
            throw ScriptRuntime.constructError("Error",
                    "The write function expects a single object argument");
        }
        return geo.getJson();
    }
View Full Code Here

Examples of org.mati.geotech.model.GeoObject

 
  public void makeTest() {
    _rects.clear();
    _rtree.clean();
   
    GeoObject rects[] =
    {
      new GeoObject0,   0,100,100),
      new GeoObject(120, 120,100,100),
     
      new GeoObject(700, 700,100,100),
      new GeoObject(900, 900,100,100),
     
      new GeoObject(200, 180,100,100),
//      new Rect(  0, 900,100,100),     
//      new Rect(200, 100,100,100),
//      new Rect(300, 100,100,100),
//      new Rect(400, 100,100,100),
     
//      new Rect(450, 450,100,100),
      new GeoObject(300, 300,100,100),
     
//      new Rect(300, 500,100,100),
//      new Rect(200, 300,100,100),
      new GeoObject(200, 500,100,100)
       
    };
   
    for(GeoObject r:rects) {
      add(r);
View Full Code Here

Examples of org.mati.geotech.model.GeoObject

    double h=100;
    boolean canOverlap=true;
   
    boolean skip = false;
    while(aNOR > 0) {
      GeoObject r = new GeoObject(
          getWorldRect().getX() + Math.random()*(getWidth()-w),
          getWorldRect().getY() + Math.random()*(getHeight()-h),
          Math.random()*(w-10)+10, Math.random()*(h-10)+10);
     
      if(!canOverlap) {
        skip=false;
        for(Rect cur : _rects) {
          if(r.haveCross(cur)) { skip = true; break; }
        }
      }
      if(!skip) {
        _rects.add(r);
        _rtree.addElement(r);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.