int pcode_12n13n14 ( int [ ] pos , int [ ] dlen , int hoff , int len , boolean isZ , String structName , int code ) { //int vlen = len; int vlen = 0 ; for ( int i = 0 ; i < len ; i ++ ) { vlen = vlen + dlen [ i ] ; } ArrayList dims = new ArrayList ( ) ; Dimension sDim = new Dimension ( "graphicSymbolSize" , vlen ) ; ncfile . addDimension ( null , sDim ) ; dims . add ( sDim ) ; Structure dist = new Structure ( ncfile , null , null , structName ) ; dist . setDimensions ( dims ) ; ncfile . addVariable ( null , dist ) ; dist . addAttribute ( new Attribute ( CDM . LONG_NAME , "special graphic symbol for code " + code ) ) ; Variable i0 = new Variable ( ncfile , null , dist , "x_start" ) ; i0 . setDimensions ( ( String ) null ) ; i0 . setDataType ( DataType . FLOAT ) ; i0 . addAttribute ( new Attribute ( CDM . UNITS , "KM" ) ) ; dist . addMemberVariable ( i0 ) ; Variable j0 = new Variable ( ncfile , null , dist , "y_start" ) ; j0 . setDimensions ( ( String ) null ) ; j0 . setDataType ( DataType . FLOAT ) ; j0 . addAttribute ( new Attribute ( CDM . UNITS , "KM" ) ) ; dist . addMemberVariable ( j0 ) ; int [ ] pos1 = new int [ len ] ; int [ ] dlen1 = new int [ len ] ; System . arraycopy ( dlen , 0 , dlen1 , 0 , len ) ; System . arraycopy ( pos , 0 , pos1 , 0 , len ) ; dist . setSPobject ( new Vinfo ( 0 , 0 , 0 , 0 , hoff , 0 , isR , isZ , pos1 , dlen1 , code , 0 ) ) ; return 1 ; }
construct a dataset for special graphic symbol packet with code 12 13 and 14