Package chunmap.model.elem

Examples of chunmap.model.elem.Envelope


    try {
      return shpReader.getShapeEnvelop(id);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return new Envelope();
  }
View Full Code Here


        String[] str = text.split(",");

        CPoint p1 = getPoint(str[0]);
        CPoint p2 = getPoint(str[1]);

        return new Envelope(p1, p2);
      } else
        throw new IllegalArgumentException("Unknow geometry");

    } catch (Exception ex) {
      WktParseException ex2 = new WktParseException();
View Full Code Here

  }
 
  private void drawLabel(Graphics g, Geometry geo, String text, View view) {
    if (text == null || text == "") return;
   
    Envelope env=geo.getEnvelop().transform(view.world2Screen());
    if(env.getWidth()+env.getHeight()<labelHide)return;
   
    AttributedString astring = new AttributedString(text);
    astring.addAttribute(TextAttribute.FOREGROUND, stringColor);
    CPoint p = env.getCenter();
    g.drawString(astring.getIterator(), (int) p.getX(), (int) p.getY());
  }
View Full Code Here

  public Envelope getShapeEnvelop(long id) throws IOException {
    int index = getIndex(id) + 8;// 加8表示跳过记录头信息,包括记录号和记录长度。
    shaperf.seek(index);
    int type = Integer.reverseBytes(shaperf.readInt());

    Envelope elp;
    if (type == ShapefileType.Null)
      return new Envelope();
    else if (type == ShapefileType.Point || type == ShapefileType.PointM
        || type == ShapefileType.PointZ) {
      elp = new GeoPoint(helper.readPoint(shaperf)).getEnvelop();
    } else {
      elp = helper.readEnvelop(shaperf);
View Full Code Here

    double xMin = reverseBytes(br.readDouble());
    double yMin = reverseBytes(br.readDouble());
    double xMax = reverseBytes(br.readDouble());
    double yMax = reverseBytes(br.readDouble());

    return new Envelope(xMin, yMin, xMax, yMax);
  }
View Full Code Here

    return new Coordinate2D(x, y);
  }

  public MultiPoint readMultiPoint(RandomAccessFile br) throws IOException {

    Envelope env = readEnvelop(br);
    int numPoints = Integer.reverseBytes(br.readInt());

    List<CPoint> points = readPointList(br, numPoints);
   
    List<GeoPoint> geoPointList=new ArrayList<GeoPoint>();
View Full Code Here

  public MultiLineString readMultiLine(RandomAccessFile br)
      throws IOException {

    List<LineString> multiPath = new ArrayList<LineString>();
    Envelope env = readEnvelop(br);

    int numParts = Integer.reverseBytes(br.readInt());
    int numPoints = Integer.reverseBytes(br.readInt());

    // 几何体中第一个点在点集里面的索引,从零开始。
View Full Code Here

  // 读取多边形
  public MultiPolygon readMultiPolygon(RandomAccessFile br)
      throws IOException {

    List<Polygon> polygons = new ArrayList<Polygon>();
    Envelope env = readEnvelop(br);

    int numParts = Integer.reverseBytes(br.readInt());
    int numPoints = Integer.reverseBytes(br.readInt());
    // 几何体中第一个点在点集里面的索引,从零开始。
    int[] parts = new int[numParts];
View Full Code Here

     
      //Log.log(Logger.Debug, "url is " + s);
      capabilities.reponse(out);
    } else {
      String bbox = request.getParameter("BBOX");
      Envelope envelop = parseEnvelop(bbox);
      int width = Integer.valueOf(request.getParameter("WIDTH"));
      int height = Integer.valueOf(request.getParameter("HEIGHT"));
      String format = parseFormat(request.getParameter("FORMAT"));
     
      if (requestStr.equalsIgnoreCase("GetMap")) {
View Full Code Here

    double minx = Double.valueOf(ss[0]);
    double miny = Double.valueOf(ss[1]);
    double maxx = Double.valueOf(ss[2]);
    double maxy = Double.valueOf(ss[3]);

    Envelope envelop = new Envelope(minx, miny, maxx, maxy);
    return envelop;
  }
View Full Code Here

TOP

Related Classes of chunmap.model.elem.Envelope

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.