Package chunmap.model.elem

Examples of chunmap.model.elem.EnvelopeBuf


    {
        return "LineStringEditor [" + points + "]";
    }
    private Envelope getEnvelop()
    {
        EnvelopeBuf env = new EnvelopeBuf();
        for (CPoint p : points)
        {
            env.extendEnvelop(p);
        }
        return env.toEnvelop();
    }
View Full Code Here


    public static VectorLayer createGeometryLayer(List<Geometry> gs)
    {
        if (gs.size() == 0) return null;

        FeatureCollection fc = new FeatureList();
        EnvelopeBuf eb = new EnvelopeBuf();
        for(Geometry g : gs){
          ShapeFeature f = createFeature(g);
            fc.insert(f);
            f.setFeatureClass(fc);
            eb.mergeEnvelop(g.getEnvelop());
        }

        fc.setMetadata( new LayerMetadata("Geometry",gs.get(0).getGeometryType()));
        fc.setEnvelope(eb.toEnvelop());

        return new VectorLayer(fc);
    }
View Full Code Here

    }

    public static VectorLayer createFeatureLayer(List<Feature> fs)
    {
      FeatureList fc = new FeatureList();
        EnvelopeBuf eb = new EnvelopeBuf();
        for (Feature f : fs)
        {
            fc.insert(f);
            eb.mergeEnvelop(f.getEnvelop());
        }

        fc.setMetadata (new LayerMetadata("Feature",GeometryType.GeometryCollection));
        fc.setEnvelope ( eb.toEnvelop());

        return new VectorLayer(fc);
    }
View Full Code Here

    public ViewPort(int width, int height, double buffer)
    {
        _viewHeight = height;
        _viewWidth = width;
        _scale = 1f;
        _viewEnvelop = new EnvelopeBuf(0, 0, width, height);
        setBufferEnvelope();
        _center = _viewEnvelop.getCenter();
        _buffer = buffer;
    }
View Full Code Here

            if (value == null) return;

            if (value.getWidth() == 0 || value.getHeight() == 0)
            {
                //因为点的边框宽度无穷小
                EnvelopeBuf eb= new EnvelopeBuf(value);
                eb.bufferEnvelop(0.1);
                value = eb;
            }
            _scale = computeScale(value);
            _center = value.getCenter();
            computerEnvelope();
View Full Code Here

        double x = _center.getX();
        double y = _center.getY();
        double dx = (_viewWidth / _scale) / 2d;
        double dy = (_viewHeight / _scale) / 2d;

        _viewEnvelop = new EnvelopeBuf(x - dx, y - dy, x + dx, y + dy);
        setBufferEnvelope();
    }
View Full Code Here

  //------------------------------------------------------------------------geometry

  @Override
  protected Envelope calculateEnvelop() {
    EnvelopeBuf env =new EnvelopeBuf();
    for (CPoint p : points) {
      env.extendEnvelop(p);
    }
    return env.toEnvelop();
  }
View Full Code Here

    //#endregion

    public void reComputeEnvelope()
    {
        final EnvelopeBuf eb = new EnvelopeBuf();
        this.each(new VisitAction(){
      @Override
      public void execute(Feature f) {
        eb.mergeEnvelop(f.getEnvelop());
      }});
        envelope = eb.toEnvelop();
    }
View Full Code Here

    };
  }

  @Override
  protected Envelope calculateEnvelop() {
    EnvelopeBuf env = new EnvelopeBuf();
    for (E g : geometrys) {
      env.mergeEnvelop(g.getEnvelop());
    }
    return env.toEnvelop();
  }
View Full Code Here

  public Envelope getEnvelop() {
    return envelop;
  }

  public void reComputeEnvelop() {
    EnvelopeBuf env = new EnvelopeBuf();
    for (Layer lyr : layers) {
      env.mergeEnvelop(lyr.getEnvelop());
    }
    envelop = env.toEnvelop();
  }
View Full Code Here

TOP

Related Classes of chunmap.model.elem.EnvelopeBuf

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.