Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 KB | None | 0 0
  1. /**
  2.      * Create SeShapeFilter
  3.      * @param connection
  4.      * @param layerId
  5.      * @return
  6.      */
  7.     public SeShapeFilter[] sticky(SeConnection _connection, String _layerQName){
  8.         Rectangle worldRect = m_drawingPanel.getWorld();   
  9.         int id = 0;
  10.         if (_layerQName.equalsIgnoreCase("SDE.GEO_ADMIN.ADMINAREA_1_BUNDESLAENDER")) {
  11.             id = 17;
  12.         } else if (_layerQName.equalsIgnoreCase("SDE.GEO_ADMIN.AREA_WALD_BMN31")) {
  13.             id = 66;
  14.         } else if (_layerQName.equalsIgnoreCase("SDE.GEO_ADMIN.ADMINAREA_1_BUNDESLAENDER_BMN31")) {
  15.             id = 60;
  16.         } else if (_layerQName.equalsIgnoreCase("SDE.GEO_ADMIN.AREA_GEWAESSER_BMN31")) {
  17.             id = 65;
  18.         } else if (_layerQName.equalsIgnoreCase("SDE.GEO_ADMIN.AREA_WOHNGEBIETE_BMN31")) {
  19.             id = 70;
  20.         }
  21.         if(id != 0){
  22.             try {
  23.                     SeLayer layer = new SeLayer(_connection, new SeObjectId(id));
  24.                            
  25.                     SeCoordinateReference coordSys = layer.getCoordRef();
  26.                     SeShape bbox;
  27.                    
  28.                     bbox = new SeShape(coordSys);
  29.                     SeExtent extent;
  30.                     if( id == 17){
  31.                         extent = new SeExtent(worldRect.getMinX() / 10000, worldRect.getMinY() / 10000, worldRect.getMaxX() / 10000, worldRect.getMaxY() / 10000);
  32.    
  33.                     }
  34.                     else {
  35.                         extent = new SeExtent(worldRect.getMinX(), worldRect.getMinY(), worldRect.getMaxX(), worldRect.getMaxY());
  36.    
  37.                     }
  38.                    
  39.                     bbox.generateRectangle(extent);
  40.                    
  41.                     SeShapeFilter filters[] = new SeShapeFilter[] {
  42.                             new SeShapeFilter(layer.getQualifiedName(), "SHAPE", bbox, SeFilter.METHOD_ENVP)
  43.                     };
  44.                    
  45.                     return filters;
  46.                    
  47.                 } catch (SeException e) {
  48.                     // TODO Auto-generated catch block
  49.                     e.printStackTrace();
  50.             }
  51.         }
  52.         return new SeShapeFilter[] {};
  53.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement