亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? featureclass.java~97~

?? CreateMyFirstMap
?? JAVA~97~
字號:
package myfirstmap;
import com.mapinfo.mapj.MapJ;
import com.mapinfo.unit.LinearUnit;
import com.mapinfo.util.DoublePoint;
import com.mapinfo.util.DoubleRect;
import com.mapinfo.dp.tab.TABDataProviderHelper;
import com.mapinfo.dp.tab.TABTableDescHelper;
import com.mapinfo.mapxtreme.client.MapXtremeDataProviderRef;
import com.mapinfo.mapj.AbstractLayer;
import com.mapinfo.mapj.Layers;
//import com.mapinfo.mapj.Layer;
import com.mapinfo.mapj.FeatureLayer;
import com.mapinfo.dp.TableInfo;
import java.util.List;
import java.util.ArrayList;
import com.mapinfo.dp.util.RewindableFeatureSet;
import com.mapinfo.dp.FeatureSet;
import com.mapinfo.dp.Feature;
import com.mapinfo.dp.Attribute;
import com.mapinfo.dp.Geometry;
import com.mapinfo.dp.PointGeometry;
import com.mapinfo.dp.VectorGeometry;
import com.mapinfo.dp.PointList;
import com.mapinfo.mapj.FeatureFactory;
import com.mapinfo.graphics.Rendition;
import  com.mapinfo.graphics.RenditionImpl;
import java.awt.Color;
import com.mapinfo.dp.annotation.AnnotationDataProvider;
import com.mapinfo.dp.annotation.AnnotationDataProviderHelper;
import com.mapinfo.dp.annotation.AnnotationTableDescHelper;
import com.mapinfo.dp.util.LocalDataProviderRef;
import com.mapinfo.dp.PrimaryKey;
import com.mapinfo.mapxtreme.client.MapXtremeImageRenderer;
import com.mapinfo.xmlprot.mxtj.ImageRequestComposer;
import com.mapinfo.dp.AttOperator;
import com.mapinfo.dp.AttTuple;
import com.mapinfo.dp.QueryParams;
public class FeatureClass
{
  private   String mapxtremeURL="http://901-32:8083/mapxtreme47/mapxtreme";
  private   String mdfFilePath="E:\\MapInfo\\study\\mapmdf\\pla2.mdf";
  public FeatureClass()
  {
  }
  public  void getInfoFromFeature()
  {
   MapJ mapj=new MapJ();
   DoublePoint point=new DoublePoint(018.9608,34.2729);
   DoubleRect bound=new DoubleRect(point,0.31,0.21);
   mapj.setBounds(bound) ;
   LinearUnit unit=LinearUnit.kilometer ;
   mapj.setDistanceUnits(unit) ;
   mapj.setDeviceBounds(new DoubleRect(0,0,800,600)) ;
   //
  try
  {
    mapj.loadMapDefinition(mdfFilePath);
    Layers layers=mapj.getLayers() ;
    AbstractLayer abstractLayer=null;
    FeatureLayer featureLayer=null;
    String layerName;
    TableInfo tableInfo=null;
    List columns=new ArrayList();
    Attribute attribute=null;
    Geometry geom=null;
    PointGeometry pointGeom=null;
    int attributeCount=0;
    DoubleRect rect=null;
    DoublePoint dbPoint=null;
    PointList pointList=null;
    VectorGeometry vectorGeometry=null;
    int count=0;
    for(int i=0;i<layers.size() ;i++)
    {
      featureLayer=(FeatureLayer)layers.get(i) ;
      layerName=featureLayer.getName() ;
      tableInfo=featureLayer.getTableInfo() ;
      //必須清空,因為下次執行下一個表時,如果它們的字段不一樣,那么在“FeatureSet fSet=featureLayer.searchAll(columns,null);”就會出現錯誤
      count=0;
      columns.clear() ;
      for(int j=0;j<tableInfo.getColumnCount() ;j++)
      {
        String columnName=tableInfo.getColumnName(j) ;
        columns.add(columnName) ;
      }
      //perform a search to get the features(records) from the layer
      FeatureSet fSet=featureLayer.searchAll(columns,null);
      RewindableFeatureSet rfSet=new RewindableFeatureSet(fSet);
      //get the first attribute
      Feature feature=rfSet.getNextFeature() ;
      //the loop throuth all feature in the layer
      while(feature!=null)
      {
        /* get the first attribute (columnData) from the feature Note: If
        we want to re-use the Attribute object later on (after the
        getNextFeature loop), we would need to make a copy of the
        Attribute object, using the copy constructor.
        */
        attribute=feature.getAttribute(0) ;//it's error here
        //get a count of all attributes in the layer
        attributeCount=feature.getAttributeCount() ;
        //get a reference to the grographic information from the feature
        geom=feature.getGeometry() ;
        //if the geometry is a point
        if(geom.getType() ==Geometry.TYPE_POINT )
        {
          pointGeom=(PointGeometry)geom;
          // get the minimum bounding rectangle for the feature
          rect=pointGeom.getBounds() ;
          // get the x,y location where the feature’s label will be
          // anchored
          dbPoint=pointGeom.getLabelPoint(null);
        }else
        {
          vectorGeometry = (VectorGeometry) geom;

          rect = vectorGeometry.getBounds();
          dbPoint = vectorGeometry.getLabelPoint(null);
          double[] points;
          int offset=0;
          int numPoints;
           int pointListCount=vectorGeometry.getPointListCount() ;
          for (int ii=0;ii<vectorGeometry.getPointListCount();++ii)
          {
            // Get the next Point List
            pointList = vectorGeometry.getNextPointList();
            // determine the number of Points in the point group
             numPoints = pointList.getPointCount();
            // Create the point array large enough to hold all the
            // points
            points = new double[numPoints];
            // Call getNextPoints which will put the points into the
            // array
            pointList.getNextPoints(points, offset, numPoints/2);
           }//end this for above
        }//end else
       count++;
        if((count>332)&&(layerName.equals("Line") ))
       {
         System.out.println(">99") ;
       }
       feature=rfSet.getNextFeature() ;
      }//end while
      //rewind the featureSet for the future use
      rfSet.rewind() ;
    }//end the most outer for
  }catch(java.io.IOException  ioe)
  {
    System.out.println("get a "+ioe.getClass() +"\nwith message "+ioe.getMessage() ) ;
    ioe.printStackTrace() ;
  }catch(Exception e)
  {
    System.out.println("get a "+e.getClass() +"\nwith message "+e.getMessage() ) ;
    e.printStackTrace() ;
  }
}//end this function

public void createVariousFeature()
{
  MapJ mapj=new MapJ();
  DoublePoint point=new DoublePoint(108.9608,34.2729);
  DoubleRect bound=new DoubleRect(point ,0.31,0.21);
  mapj.setBounds(bound) ;
  LinearUnit unit=LinearUnit.kilometer ;
  mapj.setDistanceUnits(unit) ;
  mapj.setDeviceBounds(new DoubleRect(0,0,800,600)) ;
  try
  {
  //  mapj.loadMapDefinition(mdfFilePath);
    FeatureFactory feaFac=mapj.getFeatureFactory() ;
    //set attribute object
    Attribute[] attributes=new Attribute[4];
    attributes[0]=new Attribute("feature1");
    attributes[1]=new Attribute("ellpise");
    attributes[2]=new Attribute("point");
    attributes[3]=new Attribute("polyline");
    //set up the rendition object
    //this will not work for a tab files. for tab files we must use
    //com.mapinfo.tab.TABStyleFactory to create an appropirate rendition object
    Rendition rend=RenditionImpl.getDefaultRendition() ;
    //for circle ,specify the edge color and fill color
    rend.setValue(Rendition.STROKE ,Color.cyan );
    rend.setValue(Rendition.FILL ,Color.green );
    // For points, specify the symbol size, font, and color
    rend.setValue(Rendition.SYMBOL_STRING, "@");
    rend.setValue(Rendition.FONT_SIZE, 16);
    rend.setValue(Rendition.FONT_FAMILY, "MapInfo Shields");
    rend.setValue(Rendition.SYMBOL_FOREGROUND, Color.blue);
// For lines, specify the line color and width
    rend.setValue(Rendition.STROKE, Color.green);
    rend.setValue(Rendition.STROKE_WIDTH, 4);
// For ellipses, specify the fill color and opacity
    rend.setValue(Rendition.FILL, Color.blue);
    rend.setValue(Rendition.FILL_OPACITY, new Float(0.40));

    //create circular region
    int circleType=1;
     double circleRadius=2;
    int circleResolution=12;
    //for elliptical region
    //create a integer variable to set the coordsys system of the region.o set for map coordsys,1 set for screen coordsys
    int ellipseType=1;
    //create a variable to set the rotation angle of the ellipse in radiant
    double xRadius=1.0;
    double yRadius=0.25;
    //create a integer variable to specify the number of point to describe the ellipse. if 0,the default 12 will be used
    int ellipseResolution=12;
    //create an annotation layer for storing the feature we are creating
    AnnotationTableDescHelper annotationTDHelper=new AnnotationTableDescHelper("Annotations");
    AnnotationDataProviderHelper annotationDPHelper=new AnnotationDataProviderHelper();
    LocalDataProviderRef localDPRef=new LocalDataProviderRef(annotationDPHelper);
    FeatureLayer annotationLayer=(FeatureLayer)mapj.getLayers() .insertLayer(localDPRef,annotationTDHelper,0,"Annotations");
    //PrimaryKey is taken as an argument by all the create methods and
//cannot be null
    Feature retFeature;
    PrimaryKey pkey = new PrimaryKey(attributes[0]);
    //set the center point for the circle
    DoublePoint centerPoint=new DoublePoint(108.9608,34.2729);
    // Create a Circular Region
    retFeature = feaFac.createCircularRegion(circleType,//type
                                             /*
if the Type is 0, MapJ creates a region whose points are all the same geographic distance from the
 center. Due to the curvature of the earth, and due to the way that coordinate systems and
 map projections work, such a circle might appear lop-sided, rather than circular.
If the type parameter is 1, MapJ creates a region that appears circular on the screen.
However, different points on the circle might not be the same geographic distance from the center
of the circle.
type - An integer representing the type of coordinate system to use in creation of the circle.
Use 0 for map coords and 1 for screen coords.
*/
centerPoint,// The center of the circle given as a DoublePoint.
circleRadius,//the radius of the circle
LinearUnit.mile,//the linear unit of the distance
circleResolution,// The number of points describing the circle. If 0 it will use default of 12.
rend,//The rendition associated with this feature, may be null.
null, //The rendition associated with the label for this feature, may be null.
null,//attributes,//Attributes that are associated with this feature, may be null.
pkey//the PrimaryKey of the new Feature, may be null.
);
    //add the new feature to the annotation layer
    PrimaryKey pkey2=annotationLayer.addFeature(retFeature) ;
//create the ellipse region
DoublePoint    ellipseCenter=new DoublePoint(108.9608,34.3729);
retFeature=feaFac.createEllipticalRegion(ellipseType,ellipseCenter,0,xRadius,yRadius,
   LinearUnit.mile  , ellipseResolution,rend,null,null,new PrimaryKey(attributes[1]));
  annotationLayer.addFeature(retFeature) ;
//creae point
retFeature=feaFac.createPoint(new DoublePoint(108.8,34.2729),rend,null,new PrimaryKey(attributes[2]));
  annotationLayer.addFeature(retFeature) ;
//create ployline
  // Create PolyLine using a 2 x 6 double matrix
// Row 1 contains 3 points(x,y,x,y,x,y) and 2 line segments.
// Row 2 contains 3 points(x,y,x,y,x,y) and 2 line segments.
double pts[][] = { {108.8608,34.2720, 108.8908,34.2720,108.9208,34.270},
      {108.8908,34.2680, 108.8608,34.2680,108.8408,34.2720} };
retFeature = feaFac.createPolyLine(pts, rend, null, null, new PrimaryKey(attributes[3]));
  annotationLayer.addFeature(retFeature) ;
     //
     MapXtremeImageRenderer render=new MapXtremeImageRenderer(mapxtremeURL);
     ImageRequestComposer imageRC=ImageRequestComposer.create(mapj,256,Color.white ,"image/png");
     render.render(imageRC) ;
     render.toFile("E:\\MapInfo\\study\\png\\created.png") ;
  }catch(Exception e)
  {
    System.out.println("get a "+e.getClass() +"\nwith message "+e.getMessage() ) ;
    e.printStackTrace() ;
  }
}
public void searchFeature()
{
  MapJ mapj=new MapJ();
  DoublePoint centerPoint=new DoublePoint(108.9608,34.2729);
  DoubleRect bound=new DoubleRect(centerPoint,0.31,0.21);
  mapj.setBounds(bound) ;
  mapj.setDeviceBounds(new DoubleRect(0,0,800,600)) ;
  Layers layers=null;
  FeatureLayer featureLayer;
  FeatureSet featureSet=null;
  double searchRadius=2;
  List resList=new ArrayList();
  RewindableFeatureSet rfSet=null;
  Feature feature=null;
  try
  {
    mapj.loadMapDefinition(mdfFilePath);
    layers=mapj.getLayers() ;
    int count=0;
    String layerName;
    for(int i=0;i<layers.size() ;i++)
    {
      featureLayer=(FeatureLayer)layers.get(i) ;
      layerName=featureLayer.getName() ;
      feature=null;
      count=0;
//      featureSet=featureLayer.searchWithinRadius(resList,centerPoint,searchRadius,LinearUnit.kilometer ,null);
  //  DoubleRect rect=new DoubleRect(108.9608,34.2729,108.9908,34.3729);
  //    featureSet=featureLayer.searchWithinRectangle(resList,rect,null);
   //   featureSet=featureLayer.searchAtPoint(resList,centerPoint,null) ;
    /*  Attribute attLength=new Attribute(1022);
      String searchCol="length";

      if(layerName.equals("line") )
      {
      featureSet=featureLayer.searchByAttribute(resList,searchCol,attLength,null);
      rfSet=new RewindableFeatureSet(featureSet);
      feature=rfSet.getNextFeature() ;
      }*/
      int searchLen=1022;
      String searchColumn="length";
      //create name list
      List nameList=new ArrayList();
      nameList.add(searchColumn) ;
      //create value list
      List valueList=new ArrayList();
      Attribute searchAttr=new Attribute(searchLen);
      AttTuple searchTuple=new AttTuple(searchAttr);
      valueList.add(searchTuple);
      //create operator list
      List operatorList=new ArrayList();
      operatorList.add(AttOperator.eq ) ;
      //do the search
      if(layerName.equals("line") )
      {
      featureSet=featureLayer.searchByAttributes(resList,nameList,operatorList,valueList,QueryParams.m_defaultQP );
      rfSet=new RewindableFeatureSet(featureSet);
      feature=rfSet.getNextFeature() ;
      //下面這個是練習,練習如何得到feature對應的列值,因為一個層實際上對應的就是一個表,所以一個feature
         //對應的應該就是一列
         for(int ii=0;ii<feature.getAttributeCount() ;ii++)
         {
           Attribute att=feature.getAttribute(ii) ;
           String str=att.getString() ;
           str="wait";
         }

      }

      while(feature!=null)
      {
        count++;
        feature=rfSet.getNextFeature() ;
        //下面這個是練習,練習如何得到feature對應的列值,因為一個層實際上對應的就是一個表,所以一個feature
       //對應的應該就是一列
       for(int ii=0;ii<feature.getAttributeCount() ;ii++)
       {
         Attribute att=feature.getAttribute(ii) ;
         String str=att.getString() ;
         str="wait";
       }

      }
      System.out.println("there are "+count+" in "+layerName+" layer ") ;
    }
  }catch(java.io.IOException  ioe)
  {
    System.out.println("get a  "+ioe.getClass() +"\nwith message "+ioe.getMessage() ) ;
  }catch(Exception e)
  {
    System.out.println("get a "+e.getClass() +"\nwith message "+e.getMessage() ) ;
  }
}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性感一区二区三区| 国产精品美女久久久久高潮| 狠狠色狠狠色综合| 亚洲视频电影在线| 一区二区理论电影在线观看| 亚洲第一在线综合网站| 久久成人免费日本黄色| 99久久99久久综合| 欧美人动与zoxxxx乱| 久久午夜羞羞影院免费观看| 1024成人网| 麻豆精品在线观看| 94-欧美-setu| 日韩精品一区二区三区三区免费| 中文字幕亚洲区| 日本免费新一区视频| 不卡一区二区三区四区| 欧美另类一区二区三区| 亚洲国产精品成人久久综合一区| 亚洲线精品一区二区三区| 激情五月激情综合网| 91蝌蚪porny九色| 精品国产电影一区二区| 亚洲精品中文在线影院| 精品一区二区免费| 在线一区二区视频| 国产三级精品三级在线专区| 婷婷综合久久一区二区三区| 国产黄色精品视频| 欧美一区二区三区婷婷月色| 国产精品灌醉下药二区| 久久99国产精品麻豆| 欧美午夜电影网| 中文字幕欧美国产| 久久成人av少妇免费| 欧美亚一区二区| 中文字幕一区二区三区四区| 日韩和欧美的一区| a级精品国产片在线观看| 精品裸体舞一区二区三区| 亚洲国产另类精品专区| 欧美一区二区三区男人的天堂| 中文字幕制服丝袜成人av| 久久99精品国产麻豆婷婷洗澡| 欧洲精品在线观看| 国产精品久久久久久久久搜平片| 韩国在线一区二区| 91精品国产色综合久久| 亚洲午夜久久久久久久久久久 | 精品视频在线免费| 国产精品久久久久久亚洲伦| 国产主播一区二区三区| 宅男在线国产精品| 亚洲第一av色| 欧美日韩在线三区| 一级日本不卡的影视| 91在线小视频| 亚洲男女一区二区三区| 成人av在线影院| 国产精品免费人成网站| 国产成a人亚洲| 久久久久国产精品厨房| 精品一区二区三区久久久| 精品免费一区二区三区| 青青草视频一区| 欧美一区二区黄色| 日韩vs国产vs欧美| 91精品国产乱| 免费在线观看一区二区三区| 欧美系列日韩一区| 一区二区三区日韩| 欧美视频你懂的| 亚洲一区二区三区自拍| 精品1区2区3区| 日韩av一区二| 欧美videossexotv100| 青娱乐精品在线视频| 精品少妇一区二区三区免费观看| 久久99精品久久久久婷婷| 亚洲精品一区二区三区精华液 | 国产精品久久久久久福利一牛影视| 国产精品99久久久| 久久久久亚洲蜜桃| 成人性生交大片免费看中文| 中文字幕亚洲一区二区va在线| 91美女在线视频| 亚洲国产日韩av| 91精品国产一区二区人妖| 麻豆国产91在线播放| 精品国产精品网麻豆系列| 成人手机在线视频| 亚洲人精品一区| 欧美手机在线视频| 免费看日韩精品| 国产日韩视频一区二区三区| 91麻豆免费看| 日韩在线播放一区二区| 欧美精品一区二区不卡| 床上的激情91.| 亚洲一区二区欧美| 日韩欧美一区电影| 成人免费视频免费观看| 夜夜精品浪潮av一区二区三区 | 韩国av一区二区三区四区| 国产欧美日韩在线视频| 色噜噜狠狠成人中文综合| 日日摸夜夜添夜夜添国产精品| 亚洲精品在线免费播放| 色一区在线观看| 青青国产91久久久久久| 国产精品不卡一区| 91精品国产综合久久久久久漫画 | 韩国v欧美v亚洲v日本v| 国产精品久久二区二区| 欧美欧美午夜aⅴ在线观看| 国产一区二区免费视频| 亚洲另类一区二区| 精品免费99久久| 91免费视频大全| 九九视频精品免费| 亚洲靠逼com| 欧美精品一区二区三区一线天视频| 99re在线精品| 久久精品理论片| 亚洲视频免费看| 精品第一国产综合精品aⅴ| 欧洲一区二区三区在线| 国产精品 日产精品 欧美精品| 亚洲一区精品在线| 国产精品午夜春色av| 欧美一区二区三区电影| 97精品久久久午夜一区二区三区 | 色琪琪一区二区三区亚洲区| 麻豆国产精品官网| 亚洲午夜免费视频| 国产精品久久久久久久久果冻传媒| 日韩一区二区三区高清免费看看| 色诱视频网站一区| 久久午夜色播影院免费高清| 黑人精品欧美一区二区蜜桃| 日本伊人午夜精品| 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 日韩欧美国产午夜精品| 欧美mv日韩mv亚洲| 国产精品麻豆久久久| 成人天堂资源www在线| 欧美一区二区黄色| 久久99精品视频| 911精品国产一区二区在线| 51久久夜色精品国产麻豆| 国产女人水真多18毛片18精品视频| 蜜臀av性久久久久蜜臀aⅴ| 成人免费视频app| 日韩三级视频在线观看| 亚洲成人综合视频| 成人网在线播放| 久久久国产精品午夜一区ai换脸| 国产精品亚洲成人| 日韩欧美不卡在线观看视频| 精品一区二区精品| 亚洲卡通欧美制服中文| 精品国免费一区二区三区| 欧美高清激情brazzers| 国产一区二区三区精品视频| 亚洲区小说区图片区qvod| 国产精品三级av| 精品理论电影在线| 欧美精品三级在线观看| 国产一区二区视频在线播放| 国产精品一区二区黑丝| 中文字幕第一页久久| 色哟哟一区二区| 久久99久久99| 日韩av电影天堂| 亚洲精品成人天堂一二三| 91.xcao| 亚洲自拍另类综合| 国产成人av一区二区三区在线| 亚洲综合一二区| 26uuu亚洲综合色欧美 | 亚洲美女在线一区| 91国在线观看| 奇米色一区二区三区四区| 久久久久久久久蜜桃| av一本久道久久综合久久鬼色| 亚洲人成网站在线| 亚洲精品一区二区三区影院| 亚洲视频中文字幕| 国产精品福利在线播放| 国产日韩av一区| 中文字幕精品一区二区三区精品| 久久精品国产免费| 久久99久国产精品黄毛片色诱| 九九视频精品免费| 国产电影一区在线| www.亚洲激情.com| 在线视频一区二区三区| 欧美日本韩国一区| 精品88久久久久88久久久| 国产精品麻豆一区二区|